From 9a2d37e02b5a4eb0460a59713e36d94f75e6e3f7 Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Wed, 12 Jun 2024 09:57:20 -0700 Subject: [PATCH] common.mk: Add run-binary-as-background target Instead of taking up the current interactive shell, this spawns an asynchronous process and relinquishes the shell back to user. Makes it easy to run multiple sims. TODO Currently only done for run-binary-debug --- common.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/common.mk b/common.mk index 539beae9..e620f31a 100644 --- a/common.mk +++ b/common.mk @@ -350,7 +350,9 @@ run-binaries-fast: check-binaries $(addsuffix .run.fast,$(wildcard $(BINARIES))) # run simulator with as much debug info as possible run-binary-debug: check-binary $(BINARY).run.debug +run-binary-debug-bg: check-binary $(BINARY).run.debug.bg run-binaries-debug: check-binaries $(addsuffix .run.debug,$(wildcard $(BINARIES))) +run-binaries-debug-bg: check-binaries $(addsuffix .run.debug.bg,$(wildcard $(BINARIES))) %.run.debug: %.check-exists $(SIM_DEBUG_PREREQ) | $(output_dir) if [ "$*" != "none" ]; then riscv64-unknown-elf-objdump -D -S $* > $(call get_sim_out_name,$*).dump ; fi @@ -364,6 +366,19 @@ run-binaries-debug: check-binaries $(addsuffix .run.debug,$(wildcard $(BINARIES) $(BINARY_ARGS) \ >(spike-dasm > $(call get_sim_out_name,$*).out) | tee $(call get_sim_out_name,$*).log) +%.run.debug.bg: %.check-exists $(SIM_DEBUG_PREREQ) | $(output_dir) + if [ "$*" != "none" ]; then riscv64-unknown-elf-objdump -D -S $* > $(call get_sim_out_name,$*).dump ; fi + (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) \ + $* \ + $(BINARY_ARGS) \ + >(spike-dasm > $(call get_sim_out_name,$*).out) >$(call get_sim_out_name,$*).log \ + & echo "PID=$$!") + run-fast: run-asm-tests-fast run-bmark-tests-fast #########################################################################################