Line 39... |
Line 39... |
#### 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 ####
|
#### ####
|
#### ####
|
######################################################################
|
######################################################################
|
|
|
# Use: Type "make rtl-tests" to run all of the tests on the RTL model
|
# Usage:
|
# run in the Icarus Verilog simulator.
|
#
|
|
# make rtl-tests
|
# The results and output of the simulation are in the results path,
|
#
|
# in parallel to the simulation run and bin paths. This directory is
|
# Run the software tests in the RTL model of the ORPSoC being
|
# not checked into the repository, but is created when simulations are
|
# simulated with an event-driven simulator like Icarus. Also
|
# run.
|
# possible to use Cadence's Verilog simulators with the
|
|
# "rtl-nc-tests" target.
|
|
#
|
|
# make vlt-tests
|
|
#
|
|
# Run all the software tests in the RTL model which has been
|
|
# converted into a cycle-accurate SystemC model with Verilator.
|
|
#
|
|
|
|
# Simulation results:
|
|
#
|
|
# The results and output of the event-driven simulations are in the
|
|
# results path, in parallel to the simulation run and bin paths.
|
|
|
|
# Specific tests:
|
|
#
|
# To run an individual test, specify it in the variable TESTS when
|
# To run an individual test, specify it in the variable TESTS when
|
# calling make, like "make rtl-tests TESTS="mmu-nocache mul-idcd-O2".
|
# calling make, eg:
|
|
#
|
|
# make rtl-tests TESTS="mmu-nocache mul-idcd-O2"
|
|
|
|
# UART printf:
|
|
#
|
|
# It is possible to enable printf to the console via the UART when
|
|
# running the event-driven simulators. To do this define UART_PRINTF=1
|
|
# when calling make. The SystemC cycle-acccurate model uses this by
|
|
# default.
|
|
|
|
# VCDs:
|
|
#
|
# VCD (value change dumps, usable in a waveform viewer, such as gtkwave
|
# VCD (value change dumps, usable in a waveform viewer, such as gtkwave
|
# to inspect the internals of the system graphically) files can be
|
# to inspect the internals of the system graphically) files can be
|
# generated by calling the make with VCD=1, like "make rtl-tests VCD=1"
|
# generated by defining a variable VCD, eg.
|
# and a vcd file will be created in the simulation results directory,
|
#
|
# and named according to the test run which generated it.
|
# make rtl-tests VCD=1
|
|
#
|
|
# and a dump file will be created in the simulation results directory,
|
|
# and named according to the test run which generated it. This is
|
|
# possible for both event-driven and cycle-accurate simulations.
|
|
# However the cycle-accurate
|
|
|
# The rtl simulations can also be run with Cadences NCSim by using
|
# The rtl simulations can also be run with Cadences NCSim by using
|
# rtl-nc-tests in the place of rtl-tests.
|
# rtl-nc-tests in the place of rtl-tests.
|
|
|
# It is possible to speed up the simulation slightly by disabling
|
# It is possible to speed up the simulation slightly by disabling
|
Line 298... |
Line 328... |
|
|
# List of System C models - use this list to link the sources into the Verilator
|
# List of System C models - use this list to link the sources into the Verilator
|
# build directory
|
# build directory
|
SYSC_MODELS=OrpsocAccess TraceSC
|
SYSC_MODELS=OrpsocAccess TraceSC
|
|
|
|
ifdef VCD
|
|
VLT_FLAGS +=-trace
|
|
endif
|
|
|
# Only need the trace target if we are tracing
|
# Only need the trace target if we are tracing
|
ifneq (,$(findstring -trace, $(VLT_FLAGS)))
|
ifneq (,$(findstring -trace, $(VLT_FLAGS)))
|
VLT_TRACEOBJ = SpTraceVcdC
|
VLT_TRACEOBJ = SpTraceVcdC
|
endif
|
endif
|
|
|
Line 404... |
Line 438... |
CURRENT_TEST_SW_DIR=$(SW_DIR)/`echo $$TEST | cut -d "-" -f 1`; \
|
CURRENT_TEST_SW_DIR=$(SW_DIR)/`echo $$TEST | cut -d "-" -f 1`; \
|
$(MAKE) -C $$CURRENT_TEST_SW_DIR $$TEST $(TEST_SW_MAKE_OPTS) UART_PRINTF=1; \
|
$(MAKE) -C $$CURRENT_TEST_SW_DIR $$TEST $(TEST_SW_MAKE_OPTS) UART_PRINTF=1; \
|
rm -f $(SIM_RUN_DIR)/$(SIM_SRAM_MEM_FILE); \
|
rm -f $(SIM_RUN_DIR)/$(SIM_SRAM_MEM_FILE); \
|
ln -s $$CURRENT_TEST_SW_DIR/$$TEST.vmem $(SIM_RUN_DIR)/$(SIM_SRAM_MEM_FILE); \
|
ln -s $$CURRENT_TEST_SW_DIR/$$TEST.vmem $(SIM_RUN_DIR)/$(SIM_SRAM_MEM_FILE); \
|
echo "\t#### Beginning simulation ####"; \
|
echo "\t#### Beginning simulation ####"; \
|
time -p $(SIM_VLT_DIR)/Vorpsoc_top; \
|
time -p $(SIM_VLT_DIR)/Vorpsoc_top $$TEST; \
|
if [ $$? -gt 0 ]; then exit $$?; fi; \
|
if [ $$? -gt 0 ]; then exit $$?; fi; \
|
TEST_RESULT=1; \
|
TEST_RESULT=1; \
|
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`;\
|