OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [scripts/] [make/] [Makefile-board-modelsim.inc] - Blame information for rev 651

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 542 julius
# Modelsim script generation, compile and run rules for board simulations
2
 
3
#
4
# Modelsim-specific settings
5
#
6 560 julius
VOPT_ARGS+=$(QUIET) -suppress 2241
7 542 julius
 
8 651 julius
# If certain versions of modelsim don't have the vopt executable, define
9
# MGC_NO_VOPT=1 when running to skip use of the vopt executable
10
ifeq ($(MGC_NO_VOPT), 1)
11
MGC_VOPT_EXE= \# skipped: vopt
12
 
13
# When no vopt stage, actual vsim target changes, and extra options
14
# must be passed depending on FPGA tech
15
ifeq ($(FPGA_VENDOR), xilinx)
16
MGC_VSIM_TGT=orpsoc_testbench glbl
17
else
18
MGC_VSIM_TGT=orpsoc_testbench -L $(BACKEND_LIB)
19
endif
20
 
21
else
22
MGC_VOPT_EXE= vopt
23
MGC_VSIM_TGT=tb
24
endif
25
 
26
 
27 542 julius
# If VCD dump is desired, tell Modelsim not to optimise
28
# away everything.
29
ifeq ($(VCD), 1)
30
#VOPT_ARGS=-voptargs="+acc=rnp"
31 560 julius
VOPT_ARGS+=+acc=rnpqv
32 542 julius
endif
33
 
34
# VSIM commands
35
# Suppressed warnings - 3009: Failed to open $readmemh() file
36
# Suppressed warnings - 3009: Module 'blah' does not have a `timescale directive in effect, but previous modules do.
37
# Suppressed warnings - 8598: Non-positive replication multiplier inside concat. Replication will be ignored
38 560 julius
VSIM_ARGS+=  -suppress 7 -suppress 3009 -suppress 8598 -c $(QUIET) -do "set StdArithNoWarnings 1; run -all; exit"
39 542 julius
 
40
# VPI debugging interface set up
41
VPI_SRC_C_DIR=$(COMMON_BENCH_VERILOG_DIR)/vpi/c
42
VPI_SRCS=$(shell ls $(VPI_SRC_C_DIR)/*.[ch])
43
 
44
# Modelsim VPI compile variables
45
MODELTECH_VPILIB=msim_jp_vpi.sl
46
 
47
# Modelsim VPI settings
48
ifeq ($(VPI), 1)
49
VPI_LIBS=$(VPI_SRC_C_DIR)/$(MODELTECH_VPILIB)
50
VSIM_ARGS += -pli $(VPI_SRC_C_DIR)/$(MODELTECH_VPILIB)
51
endif
52
 
53
# Rule to make the VPI library for modelsim
54
$(VPI_SRC_C_DIR)/$(MODELTECH_VPILIB): $(VPI_SRCS)
55
        $(MAKE) -C $(VPI_SRC_C_DIR) $(MODELTECH_VPILIB)
56
 
57
#
58
# Script generation rules
59
#
60
 
61
# Backend script generation - make these rules sensitive to source and includes
62
modelsim_backend.scr: $(BOARD_BACKEND_VERILOG_SRC)
63
        $(Q)echo "+incdir+"$(TECHNOLOGY_BACKEND_VERILOG_DIR) > $@;
64
        $(Q)echo "-y " $(BOARD_BACKEND_VERILOG_DIR) >> $@;
65
        $(Q)for vsrc in $(BACKEND_TECHNOLOGY_VERILOG_SRC); do echo $$vsrc >> $@; done
66
        $(Q)echo "-y " $(TECHNOLOGY_LIBRARY_VERILOG_DIR) >> $@;
67
        $(Q)echo "+libext+.v" >> $@;
68
        $(Q)echo >> $@;
69
 
70
# DUT compile script
71
modelsim_dut.scr: $(RTL_VERILOG_SRC) $(RTL_VERILOG_INCLUDES) $(BOOTROM_VERILOG)
72
        $(Q)echo "+incdir+"$(BOARD_RTL_VERILOG_INCLUDE_DIR) > $@;
73
        $(Q)echo "+incdir+"$(BOOTROM_SW_DIR) >> $@;
74
        $(Q)echo "+incdir+"$(BOARD_BENCH_VERILOG_INCLUDE_DIR) >> $@;
75
        $(Q)echo "+libext+.v" >> $@;
76
        $(Q)for module in $(BOARD_RTL_VERILOG_MODULES); do if [ -d $(BOARD_RTL_VERILOG_DIR)/$$module ]; then echo "-y " $(BOARD_RTL_VERILOG_DIR)/$$module >> $@; fi; done
77
        $(Q)for module in $(COMMON_RTL_VERILOG_MODULES); do if [ -d $(COMMON_RTL_VERILOG_DIR)/$$module ]; then echo "-y " $(COMMON_RTL_VERILOG_DIR)/$$module >> $@; fi; done
78
        $(Q)echo "-y " $(BOARD_BACKEND_VERILOG_DIR) >> $@;
79
        $(Q)if [ ! -z "$$GATELEVEL_MODULES" ]; \
80
                then echo "-y " $(BOARD_SYN_OUT_DIR) >> $@; \
81
                echo "+libext+.vm" >> $@; \
82
        fi
83
ifeq ($(FPGA_VENDOR), xilinx)
84 560 julius
        $(Q)echo "-y "$(TECHNOLOGY_LIBRARY_VERILOG_DIR)"/src/unisims" >> $@;
85
        $(Q)echo "-y "$(TECHNOLOGY_LIBRARY_VERILOG_DIR)"/src/XilinxCoreLib" >> $@;
86 542 julius
endif
87
        $(Q)echo >> $@
88
 
89
modelsim_bench.scr: $(BOARD_BENCH_VERILOG_SRC) $(COMMON_BENCH_VERILOG_SRC)
90
        $(Q)echo "+incdir+"$(BOARD_BENCH_VERILOG_INCLUDE_DIR) > $@;
91
        $(Q)echo "+incdir+"$(COMMON_BENCH_VERILOG_INCLUDE_DIR) >> $@;
92
        $(Q)for path in $(BENCH_VERILOG_SUBDIRS); do echo "+incdir+"$$path >> $@; done
93
        $(Q)for path in $(BENCH_VERILOG_SUBDIRS); do echo "-y "$$path >> $@; done
94
        $(Q)echo "+incdir+"$(BOARD_RTL_VERILOG_INCLUDE_DIR) >> $@;
95
        $(Q)echo "+libext+.v" >> $@;
96
        $(Q)for vsrc in $(BOARD_BENCH_VERILOG_SRC); do echo $$vsrc >> $@; done
97
        $(Q)for vsrc in $(COMMON_BENCH_VERILOG_SRC); do echo $$vsrc >> $@; done
98
ifeq ($(FPGA_VENDOR), xilinx)
99 560 julius
        $(Q)echo "+incdir+"$(TECHNOLOGY_LIBRARY_VERILOG_DIR)"/src" >> $@;
100 542 julius
endif
101
        $(Q)echo >> $@
102
 
103
#
104
# Build rules
105
#
106
 
107
# Modelsim backend library compilation rules
108
BACKEND_LIB=lib_backend
109
$(BACKEND_LIB): modelsim_backend.scr
110
        $(Q)if [ ! -e $@ ]; then vlib $@; fi
111
        $(Q)echo; echo "\t### Compiling backend library ###"; echo
112
        $(Q)vlog -nologo $(QUIET) -work $@ -f $<
113
 
114
# Compile DUT into "work" library
115
work: modelsim_dut.scr
116
        $(Q)if [ ! -e $@ ]; then vlib $@; fi
117
        $(Q)echo; echo "\t### Compiling Verilog design library ###"; echo
118 558 julius
        $(Q)vlog $(QUIET) -f $< $(DUT_TOP_FILE)
119
        $(Q)if [ "$(RTL_VHDL_SRC)" != "" ]; then \
120
                echo; echo "\t### Compiling VHDL design library ###"; \
121
                echo; \
122
                vcom -93 $(QUIET) $(RTL_VHDL_SRC); \
123
        fi
124 542 julius
 
125
#
126 558 julius
# Run rule, one for each vendor
127 542 julius
#
128
 
129
.PHONY : $(MODELSIM)
130
ifeq ($(FPGA_VENDOR), actel)
131
$(MODELSIM): modelsim_bench.scr $(TEST_DEFINES_VLG) $(BACKEND_LIB) $(VPI_LIBS) work
132
        $(Q)echo; echo "\t### Compiling testbench ###"; echo
133 558 julius
        $(Q)vlog $(QUIET) -nologo -incr $(BENCH_TOP_FILE) -f $<
134 651 julius
        $(Q)$(MGC_VOPT_EXE) $(QUIET) $(RTL_TESTBENCH_TOP_NAME) $(VOPT_ARGS) -L $(BACKEND_LIB) -o tb
135 542 julius
        $(Q)echo; echo "\t### Launching simulation ###"; echo
136 651 julius
        $(Q)vsim $(VSIM_ARGS) $(MGC_VSIM_TGT)
137 542 julius
endif
138
 
139
ifeq ($(FPGA_VENDOR), xilinx)
140
$(MODELSIM): modelsim_bench.scr $(TEST_DEFINES_VLG) $(VPI_LIBS) work
141
        $(Q)echo; echo "\t### Compiling Xilinx support libs, user design & testbench ###"; echo
142 560 julius
ifeq ($(DO_XILINX_COMPXLIB), 1)
143 562 julius
        $(Q)$(TECHNOLOGY_BACKEND_BIN_DIR)/compxlib $(XLIB_ARGS)
144 560 julius
endif
145 558 julius
        $(Q)vlog $(QUIET) -nologo -incr $(BENCH_TOP_FILE) -f $<
146 651 julius
        $(Q)$(MGC_VOPT_EXE) $(QUIET) glbl $(RTL_TESTBENCH_TOP_NAME) $(VOPT_ARGS) -o tb
147 542 julius
        $(Q)echo; echo "\t### Launching simulation ###"; echo
148 651 julius
        $(Q)vsim $(VSIM_ARGS) $(MGC_VSIM_TGT)
149 542 julius
endif
150
 
151 558 julius
ifeq ($(FPGA_VENDOR), altera)
152
$(MODELSIM): modelsim_bench.scr $(TEST_DEFINES_VLG) $(BACKEND_LIB) $(VPI_LIBS) work
153
        $(Q)echo; echo "\t### Compiling testbench ###"; echo
154
        $(Q)vlog $(QUIET) -nologo -incr $(BENCH_TOP_FILE) -f $<
155 651 julius
        $(Q)$(MGC_VOPT_EXE) $(QUIET) $(RTL_TESTBENCH_TOP_NAME) $(VOPT_ARGS) -L $(BACKEND_LIB) -o tb
156 558 julius
        $(Q)echo; echo "\t### Launching simulation ###"; echo
157 651 julius
        $(Q)vsim $(VSIM_ARGS) $(MGC_VSIM_TGT)
158 558 julius
endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.