Skip to content
Snippets Groups Projects
Commit 1e23e6d5 authored by dwf1m12's avatar dwf1m12
Browse files

Fix VCS simulation and clean up sim makefile

parent 0c48b4f6
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ MTI_VC_OPTIONS += -f $(TBENCH_VC) $(ADP_OPTIONS) ...@@ -22,7 +22,7 @@ MTI_VC_OPTIONS += -f $(TBENCH_VC) $(ADP_OPTIONS)
MTI_RUN_OPTIONS = -voptargs=+acc MTI_RUN_OPTIONS = -voptargs=+acc
# VCS options # VCS options
VCS_OPTIONS = +vcs+lic+wait +v2k +lint=all,noTMR,noVCDE -debug VCS_OPTIONS = +vcs+lic+wait +v2k -sverilog -override_timescale=1ns/1ps +lint=all,noTMR,noVCDE -debug
VCS_SIM_OPTION = +vcs+lic+wait +vcs+flush+log -assert nopostproc VCS_SIM_OPTION = +vcs+lic+wait +vcs+flush+log -assert nopostproc
VCS_VC_OPTIONS = -f $(TBENCH_VC) $(ADP_OPTIONS) VCS_VC_OPTIONS = -f $(TBENCH_VC) $(ADP_OPTIONS)
...@@ -73,28 +73,38 @@ compile_mti: NANOSOC_DEFINES += IMEM_0_RAM_PRELOAD ...@@ -73,28 +73,38 @@ compile_mti: NANOSOC_DEFINES += IMEM_0_RAM_PRELOAD
compile_vcs: NANOSOC_DEFINES += IMEM_0_RAM_PRELOAD compile_vcs: NANOSOC_DEFINES += IMEM_0_RAM_PRELOAD
compile_xm: NANOSOC_DEFINES += IMEM_0_RAM_PRELOAD compile_xm: NANOSOC_DEFINES += IMEM_0_RAM_PRELOAD
# Generate verilog .vc filelist from flists
flist_vfiles_nanosoc: gen_defs
@if [ ! -d $(SIM_DIR) ] ; then \
mkdir -p $(SIM_DIR); \
fi
@if [ ! -d $(SIM_DIR)/logs ] ; then \
mkdir -p $(SIM_DIR)/logs; \
fi
@cd $(SIM_DIR); python $(SOCLABS_SOCTOOLS_FLOW_DIR)/bin/filelist_compile.py -f $(TBENCH_VC) -a -v -o tbench.vc
# ------- VCS ----------- # ------- VCS -----------
# Compile RTL # Compile RTL
compile_vcs : gen_defs compile_vcs : gen_defs flist_vfiles_nanosoc
vcs $(VCS_OPTIONS) $(VCS_VC_OPTIONS) $(DEFINES_VC) | tee compile_vcs.log cd $(SIM_DIR); vcs $(VCS_OPTIONS) -f tbench.vc $(DEFINES_VC) | tee compile_vcs.log
# Run simulation in batch mode # Run simulation in batch mode
run_vcs : code run_vcs : code compile_vcs
@if [ ! -d logs ] ; then \ @echo quit > $(SIM_DIR)/quit.do
mkdir logs; \ cd $(SIM_DIR); ./simv $(VCS_SIM_OPTION) -define ADP_FILE=adp.cmd < quit.do | tee logs/run_$(TESTNAME).log ;
fi
@echo quit > quit.do
./simv $(VCS_SIM_OPTION) < quit.do | tee logs/run_$(TESTNAME).log ;
# Run simulation in interactive mode # Run simulation in interactive mode
sim_vcs : code sim_vcs : code compile_vcs
./simv -gui +vcs+lic+wait +vcs+flush+log & cd $(SIM_DIR); ./simv -gui +vcs+lic+wait +vcs+flush+log &
# ------- XM ----------- # ------- XM -----------
# Compile RTL # Compile RTL
compile_xm : bootrom gen_defs compile_xm : bootrom gen_defs flist_vfiles_nanosoc
@echo ADP_FILE @echo ADP_FILE
@echo $(ADP_OPTIONS) @echo $(ADP_OPTIONS)
cd $(SIM_DIR); xmprep +overwrite $(XM_VC_OPTIONS) $(DEFINES_VC) +debug -timescale 1ns/1ps -top $(TB_TOP) | tee compile_xm.log cd $(SIM_DIR); xmprep +overwrite $(XM_VC_OPTIONS) $(DEFINES_VC) +debug -timescale 1ns/1ps -top $(TB_TOP) | tee compile_xm.log
...@@ -105,9 +115,6 @@ compile_xm : bootrom gen_defs ...@@ -105,9 +115,6 @@ compile_xm : bootrom gen_defs
# Run simulation in batch mode # Run simulation in batch mode
run_xm : code compile_xm run_xm : code compile_xm
@if [ ! -d $(SIM_DIR)/logs ] ; then \
mkdir $(SIM_DIR)/logs; \
fi
@echo run > $(SIM_DIR)/run.tcl.tmp @echo run > $(SIM_DIR)/run.tcl.tmp
@echo exit >> $(SIM_DIR)/run.tcl.tmp @echo exit >> $(SIM_DIR)/run.tcl.tmp
@mv $(SIM_DIR)/run.tcl.tmp $(SIM_DIR)/run.tcl @mv $(SIM_DIR)/run.tcl.tmp $(SIM_DIR)/run.tcl
...@@ -120,21 +127,11 @@ sim_xm : code compile_xm ...@@ -120,21 +127,11 @@ sim_xm : code compile_xm
# ------- MTI ----------- # ------- MTI -----------
# Compile RTL # Compile RTL
compile_mti : bootrom gen_defs compile_mti : bootrom gen_defs flist_vfiles_nanosoc lib_mti
@mkdir -p $(SIM_DIR) cd $(SIM_DIR); vlog -incr -lint +v2k -f tbench.vc $(ADP_OPTIONS) $(DEFINES_VC) | tee compile_mti.log
@cd $(SIM_DIR)
@if [ -d work ] ; then \
true ; \
else \
vlib work; \
fi
cd $(SIM_DIR); vlog -incr -lint +v2k $(MTI_VC_OPTIONS) $(DEFINES_VC) | tee compile_mti.log
# Run simulation in batch mode # Run simulation in batch mode
run_mti : code compile_mti run_mti : code compile_mti
@if [ ! -d $(SIM_DIR)/logs ] ; then \
mkdir $(SIM_DIR)/logs; \
fi
@echo "run -all" > $(SIM_DIR)/run.tcl.tmp @echo "run -all" > $(SIM_DIR)/run.tcl.tmp
@echo "quit -f" >> $(SIM_DIR)/run.tcl.tmp @echo "quit -f" >> $(SIM_DIR)/run.tcl.tmp
@mv $(SIM_DIR)/run.tcl.tmp $(SIM_DIR)/run.tcl @mv $(SIM_DIR)/run.tcl.tmp $(SIM_DIR)/run.tcl
...@@ -152,7 +149,11 @@ sim_mti : code compile_mti ...@@ -152,7 +149,11 @@ sim_mti : code compile_mti
# Create work directory # Create work directory
lib_mti : lib_mti :
vlib work @if [ -d $(SIM_DIR)/work ] ; then \
true ; \
else \
vlib $(SIM_DIR)/work; \
fi
# Generate Make filelist from flists # Generate Make filelist from flists
flist_makefile_nanosoc: gen_defs flist_makefile_nanosoc: gen_defs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment