Switch to LOADMEM=1, LOADARCH=loadarch flags

This commit is contained in:
Jerry Zhao
2023-04-12 16:22:39 -07:00
parent b41806b6a0
commit 7aaa233d73
4 changed files with 25 additions and 25 deletions

View File

@@ -319,24 +319,14 @@ run-fast: run-asm-tests-fast run-bmark-tests-fast
#########################################################################################
# helper rules to run simulator with fast loadmem
# LEGACY - use LOADMEM=1 instead
#########################################################################################
run-binary-loadmem: check-binary
run-binary-loadmem: $(SIM_PREREQ) | $(output_dir)
run-binary-loadmem: run-binary
run-binary-loadmem: override SIM_FLAGS += +loadmem=$(BINARY)
run-binary-debug-loadmem: check-binary
run-binary-debug-loadmem: $(SIM_DEBUG_REREQ) | $(output_dir)
run-binary-debug-loadmem: run-binary-debug
run-binary-debug-loadmem: override SIM_FLAGS += +loadmem=$(BINARY)
run-binary-fast-loadmem: check-binary
run-binary-fast-loadmem: $(SIM_PREREQ) | $(output_dir)
run-binary-fast-loadmem: run-binary-fast
run-binary-fast-loadmem: override SIM_FLAGS += +loadmem=$(BINARY)
# Legacy targets for backwards compat
run-binary-hex: run-binary-loadmem
run-binary-debug-hex: run-binary-debug-loadmem
run-binary-fast-hex: run-binary-fast-loadmem
run-binary-hex: run-binary
run-binary-hex: override SIM_FLAGS += +loadmem=$(BINARY)
run-binary-debug-hex: run-binary-debug
run-binary-debug-hex: override SIM_FLAGS += +loadmem=$(BINARY)
run-binary-fast-hex: run-binary-fast
run-binary-fast-hex: override SIM_FLAGS += +loadmem=$(BINARY)
#########################################################################################
# run assembly/benchmarks rules

View File

@@ -155,13 +155,8 @@ Loadmem files should be ELF files. In the most common use case, this can be the
.. code-block:: shell
make run-binary BINARY=test.riscv EXTRA_SIM_FLAGS="+loadmem=test.riscv"
For convenience, special ``-loadmem`` targets are provided to automatically rely on loadmem to read in the binary.
.. code-block:: shell
make run-binary-loadmem BINARY=test.riscv
make run-binary BINARY=test.riscv LOADMEM=test.riscv
make run-binary BINART=test.riscv LOADMEM=1
Generating Waveforms
-----------------------

View File

@@ -43,7 +43,7 @@ Spike-as-a-Tile can be configured with custom IPC, commit logging, and other beh
.. code-block:: shell
make CONFIG=SpikeUltraFastConfig run-binary-loadmem BINARY=hello.riscv EXTRA_SPIKE_FLAGS="+spike-ipc=10000 +spike-fast-clint +spike-debug"
make CONFIG=SpikeUltraFastConfig run-binary BINARY=hello.riscv EXTRA_SPIKE_FLAGS="+spike-ipc=10000 +spike-fast-clint +spike-debug" LOADMEM=1
* ``+spike-ipc=``: Sets the maximum number of instructions Spike can retire in a single "tick", or cycle of the uncore simulation.

View File

@@ -248,6 +248,21 @@ BINARY ?=
override SIM_FLAGS += +dramsim +dramsim_ini_dir=$(TESTCHIP_DIR)/src/main/resources/dramsim2_ini +max-cycles=$(timeout_cycles)
VERBOSE_FLAGS ?= +verbose
sim_out_name = $(output_dir)/$(subst $() $(),_,$(notdir $(basename $(BINARY))))
LOADMEM ?=
LOADARCH ?=
ifneq ($(LOADARCH),)
override BINARY = $(LOADARCH)/mem.elf
override SIM_FLAGS += +loadarch=$(LOADARCH)/loadarch
endif
ifeq ($(LOADMEM),1)
# If LOADMEM=1, assume BINARY is the loadmem elf
override SIM_FLAGS += +loadmem=$(BINARY)
else ifneq ($(LOADMEM),)
# Otherwise, assume the variable points to an elf file
override SIM_FLAGS += +loadmem=$(LOADMEM)
endif
#########################################################################################
# build output directory for compilation