######################################################################
|
######################################################################
|
#### ####
|
#### ####
|
#### VPI Makefile ####
|
#### VPI Makefile ####
|
#### ####
|
#### ####
|
#### Description ####
|
#### Description ####
|
#### Makefile for VPI libraries ####
|
#### Makefile for VPI libraries ####
|
#### ####
|
#### ####
|
#### To Do: ####
|
#### To Do: ####
|
#### Add compatability for other simulators (Cadence, etc.) ####
|
#### Add compatability for other simulators (Cadence, etc.) ####
|
#### ####
|
#### ####
|
#### Author(s): ####
|
#### Author(s): ####
|
#### - jb, jb@orsoc.se ####
|
#### - jb, jb@orsoc.se ####
|
#### ####
|
#### ####
|
#### ####
|
#### ####
|
######################################################################
|
######################################################################
|
#### ####
|
#### ####
|
#### Copyright (C) 2009 Authors and OPENCORES.ORG ####
|
#### Copyright (C) 2009 Authors and OPENCORES.ORG ####
|
#### ####
|
#### ####
|
#### This source file may be used and distributed without ####
|
#### This source file may be used and distributed without ####
|
#### restriction provided that this copyright statement is not ####
|
#### restriction provided that this copyright statement is not ####
|
#### removed from the file and that any derivative work contains ####
|
#### removed from the file and that any derivative work contains ####
|
#### the original copyright notice and the associated disclaimer. ####
|
#### the original copyright notice and the associated disclaimer. ####
|
#### ####
|
#### ####
|
#### This source file is free software; you can redistribute it ####
|
#### This source file is free software; you can redistribute it ####
|
#### and/or modify it under the terms of the GNU Lesser General ####
|
#### and/or modify it under the terms of the GNU Lesser General ####
|
#### Public License as published by the Free Software Foundation; ####
|
#### Public License as published by the Free Software Foundation; ####
|
#### either version 2.1 of the License, or (at your option) any ####
|
#### either version 2.1 of the License, or (at your option) any ####
|
#### later version. ####
|
#### later version. ####
|
#### ####
|
#### ####
|
#### This source is distributed in the hope that it will be ####
|
#### This source is distributed in the hope that it will be ####
|
#### useful, but WITHOUT ANY WARRANTY; without even the implied ####
|
#### useful, but WITHOUT ANY WARRANTY; without even the implied ####
|
#### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ####
|
#### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ####
|
#### PURPOSE. See the GNU Lesser General Public License for more ####
|
#### PURPOSE. See the GNU Lesser General Public License for more ####
|
#### details. ####
|
#### details. ####
|
#### ####
|
#### ####
|
#### You should have received a copy of the GNU Lesser General ####
|
#### You should have received a copy of the GNU Lesser General ####
|
#### Public License along with this source; if not, download it ####
|
#### Public License along with this source; if not, download it ####
|
#### from http://www.opencores.org/lgpl.shtml ####
|
#### from http://www.opencores.org/lgpl.shtml ####
|
#### ####
|
#### ####
|
######################################################################
|
######################################################################
|
|
|
SOURCE_FILES= jp_vpi.c rsp-rtl_sim.c gdb.c
|
SOURCE_FILES= jp_vpi.c rsp-rtl_sim.c gdb.c
|
|
|
# Uncomment this line to enable debugging of all VPI code
|
# Uncomment this line to enable debugging of all VPI code
|
|
|
#DEBUG_DEFINES=-DDEBUG -DDEBUG2 -DDEBUG_ON=1 -DDEBUG_GDB=1 -DDEBUG_CMDS=1
|
#DEBUG_DEFINES=-DDEBUG -DDEBUG2 -DDEBUG_ON=1 -DDEBUG_GDB=1 -DDEBUG_CMDS=1
|
|
|
|
# Due to a difference in the type for a memory array passed back to the VPI
|
|
# interface, we must indicate whether we're compiling the jp_vpi module for use
|
|
# with Modelsim or with Icarus. We do this via defines passed at compile time,
|
|
# -DSIMULATOR_VPI
|
|
|
|
# Set V=1 when calling make to enable verbose output
|
|
# mainly for debugging purposes.
|
|
ifeq ($(V), 1)
|
|
Q=
|
|
QUIET=
|
|
else
|
|
Q ?=@
|
|
QUIET=-quiet
|
|
endif
|
|
|
all: jp_vpi
|
all: jp_vpi
|
|
|
jp_vpi: $(SOURCE_FILES)
|
jp_vpi: $(SOURCE_FILES)
|
iverilog-vpi $(SOURCE_FILES) $(DEBUG_DEFINES)
|
iverilog-vpi $(SOURCE_FILES) $(DEBUG_DEFINES) -DICARUS_VPI
|
|
|
|
SOURCE_FILES= jp_vpi.c rsp-rtl_sim.c gdb.c
|
|
OBJ_FILES= jp_vpi.o rsp-rtl_sim.o gdb.o
|
|
|
|
MODELTECH_INC_PATH=$(MGC_PATH)/modeltech/include
|
|
# Modelsim VPI compile commands
|
|
msim_jp_vpi.sl: $(OBJ_FILES)
|
|
ld -shared -E -o $@ $?
|
|
%.o: %.c
|
|
$(Q)echo; echo "\t### Building VPI debug components for Modelsim ###"; echo;
|
|
$(Q)gcc -g ${DEBUG_DEFINES} -I${MODELTECH_INC_PATH} \
|
|
-l${MODELTECH_INC_PATH} \
|
|
-DMODELSIM_VPI \
|
|
-c $< -o $*.o
|
|
|
clean:
|
clean:
|
rm -f *.o *~ jp_vpi.vpi
|
$(Q)echo; echo "\t### Cleaning VPI debug directory ###"; echo;
|
|
$(Q)rm -f *.o *~ jp_vpi.vpi msim_jp_vpi.sl
|
|
|