Line 262... |
Line 262... |
ICARUS=iverilog
|
ICARUS=iverilog
|
ICARUS_VVP=vvp
|
ICARUS_VVP=vvp
|
VSIM_COMP=vlog
|
VSIM_COMP=vlog
|
VSIM=vsim
|
VSIM=vsim
|
NCVERILOG=ncverilog
|
NCVERILOG=ncverilog
|
|
SILOS=silos
|
ICARUS_COMMAND_FILE=icarus.scr
|
ICARUS_COMMAND_FILE=icarus.scr
|
VLT_COMMAND_FILE=verilator.scr
|
VLT_COMMAND_FILE=verilator.scr
|
SIM_SUCCESS_MESSAGE=deaddead
|
SIM_SUCCESS_MESSAGE=deaddead
|
MGC_COMMAND_FILE=modelsim.scr
|
MGC_COMMAND_FILE=modelsim.scr
|
|
|
Line 316... |
Line 317... |
ifeq ($(SIMULATOR), $(NCVERILOG))
|
ifeq ($(SIMULATOR), $(NCVERILOG))
|
# NCVerilog uses same command file as Icarus
|
# NCVerilog uses same command file as Icarus
|
SIM_COMMANDFILE=$(ICARUS_COMMAND_FILE)
|
SIM_COMMANDFILE=$(ICARUS_COMMAND_FILE)
|
endif
|
endif
|
|
|
|
ifeq ($(SIMULATOR), $(SILOS))
|
|
# SILOS uses same command file as Icarus (this should be default)
|
|
SIM_COMMANDFILE=$(ICARUS_COMMAND_FILE)
|
|
endif
|
|
|
|
|
GENERATED_COMMANDFILE=$(SIM_COMMANDFILE).generated
|
GENERATED_COMMANDFILE=$(SIM_COMMANDFILE).generated
|
|
|
# When Modelsim is selected as simulator, we compile
|
# When Modelsim is selected as simulator, we compile
|
# the ORPSoC system into one library called orpsoc and
|
# the ORPSoC system into one library called orpsoc and
|
# then simply re-compile the testbench and or1200_monitor
|
# then simply re-compile the testbench and or1200_monitor
|
Line 363... |
Line 370... |
ifeq ($(SIMULATOR), $(NCVERILOG))
|
ifeq ($(SIMULATOR), $(NCVERILOG))
|
SIM_COMMANDCOMPILE=echo
|
SIM_COMMANDCOMPILE=echo
|
SIM_COMMANDRUN=$(NCVERILOG) -f $(SIM_RUN_DIR)/$(GENERATED_COMMANDFILE) -Q -l $(SIM_RESULTS_DIR)/$$TEST-$(NCVERILOG)-out.log $(EVENT_SIM_FLAGS)
|
SIM_COMMANDRUN=$(NCVERILOG) -f $(SIM_RUN_DIR)/$(GENERATED_COMMANDFILE) -Q -l $(SIM_RESULTS_DIR)/$$TEST-$(NCVERILOG)-out.log $(EVENT_SIM_FLAGS)
|
endif
|
endif
|
|
|
|
# Silos
|
|
ifeq ($(SIMULATOR), $(SILOS))
|
|
SIM_COMMANDCOMPILE=echo
|
|
SIM_COMMANDRUN=$(SILOS) -b -w -f $(SIM_RUN_DIR)/$(GENERATED_COMMANDFILE) -l $(SIM_RESULTS_DIR)/$$TEST-$(SILOS)-out.log $(EVENT_SIM_FLAGS)
|
|
endif
|
|
|
|
|
# Names of memory files used in simulation
|
# Names of memory files used in simulation
|
SIM_FLASH_MEM_FILE="flash.in"
|
SIM_FLASH_MEM_FILE="flash.in"
|
FLASH_MEM_FILE_SUFFIX="-twobyte-sizefirst.hex"
|
FLASH_MEM_FILE_SUFFIX="-twobyte-sizefirst.hex"
|
SIM_SRAM_MEM_FILE="sram.vmem"
|
SIM_SRAM_MEM_FILE="sram.vmem"
|
|
|
Line 500... |
Line 514... |
echo "\t#### Compiling RTL ####"; \
|
echo "\t#### Compiling RTL ####"; \
|
$(SIM_COMMANDCOMPILE); \
|
$(SIM_COMMANDCOMPILE); \
|
echo; \
|
echo; \
|
echo "\t#### Beginning simulation ####"; \
|
echo "\t#### Beginning simulation ####"; \
|
time -p $(SIM_COMMANDRUN) ; \
|
time -p $(SIM_COMMANDRUN) ; \
|
if [ $$? -gt 0 ]; then exit $$?; fi; \
|
if [ $$? -gt 0 && $$SIMULATOR -ne $$SILOS]; then exit $$?; fi; \
|
TEST_RESULT=`cat $(SIM_RESULTS_DIR)/$$TEST-general.log | grep report | grep $(SIM_SUCCESS_MESSAGE) -c`; \
|
TEST_RESULT=`cat $(SIM_RESULTS_DIR)/$$TEST-general.log | grep report | grep $(SIM_SUCCESS_MESSAGE) -c`; \
|
echo; echo "\t####"; \
|
echo; echo "\t####"; \
|
if [ $$TEST_RESULT -gt 0 ]; then \
|
if [ $$TEST_RESULT -gt 0 ]; then \
|
echo "\t#### Test $$TEST PASSED ####";TESTS_PASSED=`expr $$TESTS_PASSED + 1`;\
|
echo "\t#### Test $$TEST PASSED ####";TESTS_PASSED=`expr $$TESTS_PASSED + 1`;\
|
else echo "\t#### Test $$TEST FAILED ####";\
|
else echo "\t#### Test $$TEST FAILED ####";\
|