1
0
rocket-chip/vsim/Makefrag

84 lines
2.3 KiB
Plaintext
Raw Normal View History

2014-09-01 05:26:55 +02:00
#--------------------------------------------------------------------
# Sources
#--------------------------------------------------------------------
# Verilog sources
bb_vsrcs = $(base_dir)/vsrc/DebugTransportModuleJtag.v \
$(base_dir)/vsrc/jtag_vpi.v \
$(base_dir)/vsrc/AsyncMailbox.v
2014-09-01 05:26:55 +02:00
sim_vsrcs = \
$(generated_dir)/$(MODEL).$(CONFIG).v \
$(generated_dir)/consts.$(CONFIG).vh \
$(base_dir)/vsrc/$(TB).v \
$(base_dir)/vsrc/SimDTM.v \
$(bb_vsrcs)
2014-09-01 05:26:55 +02:00
# C sources
sim_csrcs = \
$(base_dir)/csrc/SimDTM.cc \
$(base_dir)/csrc/jtag_vpi.c
2014-09-01 05:26:55 +02:00
#--------------------------------------------------------------------
# Build Verilog
#--------------------------------------------------------------------
verilog: $(sim_vsrcs)
.PHONY: verilog
2014-09-01 05:26:55 +02:00
#--------------------------------------------------------------------
# Build rules
#--------------------------------------------------------------------
VCS = vcs -full64
VCS_OPTS = -notice -line +lint=all,noVCDE,noONGS,noUI -error=PCWM-L -timescale=1ns/10ps -quiet \
2014-09-01 05:26:55 +02:00
+rad +v2k +vcs+lic+wait \
+vc+list -CC "-I$(VCS_HOME)/include" \
-CC "-I$(RISCV)/include" \
-CC "-std=c++11" \
-CC "-Wl,-rpath,$(RISCV)/lib" \
2015-11-06 01:42:05 +01:00
-CC "-include $(consts_header)" \
2014-09-01 05:26:55 +02:00
$(RISCV)/lib/libfesvr.so \
-sverilog \
+incdir+$(generated_dir) \
2014-09-01 05:26:55 +02:00
+define+CLOCK_PERIOD=0.5 $(sim_vsrcs) $(sim_csrcs) \
2016-04-02 01:40:13 +02:00
+define+PRINTF_COND=$(TB).printf_cond \
+define+STOP_COND=!$(TB).reset \
+define+RANDOMIZE \
2014-09-01 05:26:55 +02:00
+libext+.v \
VCS_OPTS += +vpi
VCS_OPTS += -P $(base_dir)/vsrc/jtag_vpi.tab
VCS_OPTS += -CC "-DVCS_VPI"
2014-09-01 05:26:55 +02:00
#--------------------------------------------------------------------
# Build the simulator
#--------------------------------------------------------------------
simv = $(sim_dir)/simv-$(MODEL)-$(CONFIG)
$(simv) : $(sim_vsrcs) $(sim_csrcs) $(consts_header)
2014-09-01 05:26:55 +02:00
cd $(sim_dir) && \
2015-11-06 01:42:05 +01:00
rm -rf csrc && \
2014-09-01 05:26:55 +02:00
$(VCS) $(VCS_OPTS) -o $(simv) \
-debug_pp \
2014-09-01 05:26:55 +02:00
simv_debug = $(sim_dir)/simv-$(MODEL)-$(CONFIG)-debug
$(simv_debug) : $(sim_vsrcs) $(sim_csrcs) $(consts_header)
2014-09-01 05:26:55 +02:00
cd $(sim_dir) && \
2015-11-06 01:42:05 +01:00
rm -rf csrc && \
2014-09-01 05:26:55 +02:00
$(VCS) $(VCS_OPTS) -o $(simv_debug) \
+define+DEBUG -debug_pp \
#--------------------------------------------------------------------
# Run
#--------------------------------------------------------------------
seed = $(shell date +%s)
exec_simv = $(simv) -q +ntb_random_seed_automatic
exec_simv_debug = $(simv_debug) -q +ntb_random_seed_automatic