Skip to content

Commit

Permalink
Add makefile flag to disable binary disassembly during sims
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed Jul 16, 2024
1 parent d0a9520 commit 0fffe7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ run-binary-debug: check-binary $(BINARY).run.debug
run-binaries-debug: check-binaries $(addsuffix .run.debug,$(BINARIES))

%.run.debug: %.check-exists $(SIM_DEBUG_PREREQ) | $(output_dir)
ifeq (1,$(DUMP_BINARY))
if [ "$*" != "none" ]; then riscv64-unknown-elf-objdump -D -S $* > $(call get_sim_out_name,$*).dump ; fi
endif
(set -o pipefail && $(NUMA_PREFIX) $(sim_debug) \
$(PERMISSIVE_ON) \
$(call get_common_sim_flags,$*) \
Expand Down
4 changes: 3 additions & 1 deletion variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ HELP_SIMULATION_VARIABLES = \
" LOADMEM = riscv elf binary that should be loaded directly into simulated DRAM. LOADMEM=1 will load the BINARY elf" \
" LOADARCH = path to a architectural checkpoint directory that should end in .loadarch/, for restoring from a checkpoint" \
" VERBOSE_FLAGS = flags used when doing verbose simulation [$(VERBOSE_FLAGS)]" \
" TIMEOUT_CYCLES = number of clock cycles before simulator times out, defaults to 10000000"
" TIMEOUT_CYCLES = number of clock cycles before simulator times out, defaults to 10000000" \
" DUMP_BINARY = set to '1' to disassemble the target binary"

# include default simulation rules
HELP_COMMANDS = \
Expand Down Expand Up @@ -261,6 +262,7 @@ VERBOSE_FLAGS ?= +verbose
get_out_name = $(subst $() $(),_,$(notdir $(basename $(1))))
LOADMEM ?=
LOADARCH ?=
DUMP_BINARY ?= 1

ifneq ($(LOADARCH),)
override BINARY = $(addsuffix /mem.elf,$(LOADARCH))
Expand Down

0 comments on commit 0fffe7d

Please sign in to comment.