Support multi-loadarch RTL sims
This commit is contained in:
12
common.mk
12
common.mk
@@ -320,8 +320,14 @@ else ifneq ($(LOADMEM),)
|
||||
get_loadmem_flag = +loadmem=$(LOADMEM)
|
||||
endif
|
||||
|
||||
ifneq ($(LOADARCH),_)
|
||||
get_loadarch_flag = +loadarch=$(subst mem.elf,loadarch,$(1))
|
||||
endif
|
||||
|
||||
# get the output path base name for simulation outputs, First arg is the binary
|
||||
get_sim_out_name = $(output_dir)/$(call get_out_name,$(1))
|
||||
# sim flags that are common to run-binary/run-binary-fast/run-binary-debug
|
||||
get_common_sim_flags = $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(call get_loadmem_flag,$(1)) $(call get_loadarch_flag,$(1))
|
||||
|
||||
.PHONY: %.run %.run.debug %.run.fast
|
||||
|
||||
@@ -330,14 +336,14 @@ run-binary: $(BINARY).run check-binary
|
||||
run-binaries: $(addsuffix .run,$(BINARIES)) check-binaries
|
||||
|
||||
%.run: %.check-exists $(SIM_PREREQ) | $(output_dir)
|
||||
(set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(call get_loadmem_flag,$*) $(SEED_FLAG) $(VERBOSE_FLAGS) $(PERMISSIVE_OFF) $* </dev/null 2> >(spike-dasm > $(call get_sim_out_name,$*).out) | tee $(call get_sim_out_name,$*).log)
|
||||
(set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(call get_common_sim_flags,$*) $(VERBOSE_FLAGS) $(PERMISSIVE_OFF) $* </dev/null 2> >(spike-dasm > $(call get_sim_out_name,$*).out) | tee $(call get_sim_out_name,$*).log)
|
||||
|
||||
# run simulator as fast as possible (no insn disassembly)
|
||||
run-binary-fast: $(BINARY).run.fast check-binary
|
||||
run-binaries-fast: $(addsuffix .run.fast,$(BINARIES)) check-binaries
|
||||
|
||||
%.run.fast: %.check-exists $(SIM_PREREQ) | $(output_dir)
|
||||
(set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(call get_loadmem_flag,$*) $(SEED_FLAG) $(PERMISSIVE_OFF) $* </dev/null | tee $(call get_sim_out_name,$*).log)
|
||||
(set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(call get_common_sim_flags,$*) $(PERMISSIVE_OFF) $* </dev/null | tee $(call get_sim_out_name,$*).log)
|
||||
|
||||
# run simulator with as much debug info as possible
|
||||
run-binary-debug: $(BINARY).run.debug check-binary
|
||||
@@ -347,7 +353,7 @@ run-binaries-debug: $(addsuffix .run.debug,$(BINARIES)) check-binaries
|
||||
ifneq (none,$*)
|
||||
riscv64-unknown-elf-objdump -D $* > $(call get_sim_out_name,$*).dump
|
||||
endif
|
||||
(set -o pipefail && $(NUMA_PREFIX) $(sim_debug) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(call get_loadmem_flag,$*) $(SEED_FLAG) $(VERBOSE_FLAGS) $(call get_waveform_flag,$(call get_sim_out_name,$*)) $(PERMISSIVE_OFF) $* </dev/null 2> >(spike-dasm > $(call get_sim_out_name,$*).out) | tee $(call get_sim_out_name,$*).log)
|
||||
(set -o pipefail && $(NUMA_PREFIX) $(sim_debug) $(PERMISSIVE_ON) $(call get_common_sim_flags,$*) $(VERBOSE_FLAGS) $(call get_waveform_flag,$(call get_sim_out_name,$*)) $(PERMISSIVE_OFF) $* </dev/null 2> >(spike-dasm > $(call get_sim_out_name,$*).out) | tee $(call get_sim_out_name,$*).log)
|
||||
|
||||
run-fast: run-asm-tests-fast run-bmark-tests-fast
|
||||
|
||||
|
||||
@@ -254,10 +254,10 @@ LOADMEM ?=
|
||||
LOADARCH ?=
|
||||
|
||||
ifneq ($(LOADARCH),)
|
||||
override BINARY = $(LOADARCH)/mem.elf
|
||||
override get_out_name = $(shell basename $(LOADARCH))
|
||||
override BINARY = $(addsuffix /mem.elf,$(LOADARCH))
|
||||
override BINARIES = $(addsuffix /mem.elf,$(LOADARCH))
|
||||
override get_out_name = $(shell basename $(dir $(1)))
|
||||
override LOADMEM = 1
|
||||
override SIM_FLAGS += +loadarch=$(LOADARCH)/loadarch
|
||||
endif
|
||||
|
||||
#########################################################################################
|
||||
|
||||
Reference in New Issue
Block a user