@@ -16,6 +16,8 @@ HELP_COMPILATION_VARIABLES += \
1616" EXTRA_SIM_LDFLAGS = additional LDFLAGS for building simulators" \
1717" EXTRA_SIM_SOURCES = additional simulation sources needed for simulator" \
1818" EXTRA_SIM_REQS = additional make requirements to build the simulator" \
19+ " EXTRA_SIM_OUT_NAME = additional suffix appended to the simulation .out log filename" \
20+ " EXTRA_SIM_PREPROC_DEFINES = additional Verilog preprocessor defines passed to the simulator" \
1921" ENABLE_YOSYS_FLOW = if set, add compilation flags to enable the vlsi flow for yosys(tutorial flow)" \
2022" EXTRA_CHISEL_OPTIONS = additional options to pass to the Chisel compiler" \
2123" MFC_BASE_LOWERING_OPTIONS = override lowering options to pass to the MLIR FIRRTL compiler" \
@@ -26,6 +28,7 @@ EXTRA_SIM_CXXFLAGS ?=
2628EXTRA_SIM_LDFLAGS ?=
2729EXTRA_SIM_SOURCES ?=
2830EXTRA_SIM_REQS ?=
31+ EXTRA_SIM_OUT_NAME ?=
2932
3033ifneq ($(ASPECTS ) , )
3134 comma = ,
@@ -67,6 +70,7 @@ include $(base_dir)/generators/ibex/ibex.mk
6770include $(base_dir ) /generators/ara/ara.mk
6871include $(base_dir ) /generators/tracegen/tracegen.mk
6972include $(base_dir ) /generators/nvdla/nvdla.mk
73+ include $(base_dir ) /generators/radiance/radiance.mk
7074include $(base_dir ) /tools/torture.mk
7175
7276# ########################################################################################
@@ -233,6 +237,8 @@ $(TOP_SMEMS_CONF) $(MODEL_SMEMS_CONF) &: $(MFC_SMEMS_CONF) $(MFC_MODEL_HRCHY_JS
233237 --model-module-name $(MODEL ) \
234238 --out-dut-smems-conf $(TOP_SMEMS_CONF ) \
235239 --out-model-smems-conf $(MODEL_SMEMS_CONF )
240+ # for blackboxed SRAMs: add custom.mems.conf as blackbox and use generated module name in blackbox verilog source
241+ -[ -f $(GEN_COLLATERAL_DIR)/custom.mems.conf ] && cat $(GEN_COLLATERAL_DIR)/custom.mems.conf >> $(TOP_SMEMS_CONF)
236242
237243# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
238244TOP_MACROCOMPILER_MODE ?= --mode synflops
@@ -256,7 +262,7 @@ ifneq (,$(EXT_FILELISTS))
256262else
257263 rm -f $@
258264endif
259- sort -u $(sim_files) $(ALL_MODS_FILELIST) | grep -v '.*\.\(svh\|h\)$$' >> $@
265+ sort -u $(sim_files) $(ALL_MODS_FILELIST) | grep -v '.*\.\(svh\|h\|conf\ )$$' >> $@
260266 echo "$(TOP_SMEMS_FILE)" >> $@
261267 echo "$(MODEL_SMEMS_FILE)" >> $@
262268
@@ -305,15 +311,15 @@ get_loadarch_flag = +loadarch=$(subst mem.elf,loadarch,$(1))
305311endif
306312
307313# get the output path base name for simulation outputs, First arg is the binary
308- get_sim_out_name = $(output_dir ) /$(call get_out_name,$(1 ) )
314+ get_sim_out_name = $(output_dir ) /$(call get_out_name,$(1 ) )$( if $( EXTRA_SIM_OUT_NAME ) ,. $( EXTRA_SIM_OUT_NAME ) ,)
309315# sim flags that are common to run-binary/run-binary-fast/run-binary-debug
310316get_common_sim_flags = $(SIM_FLAGS ) $(EXTRA_SIM_FLAGS ) $(SEED_FLAG ) $(call get_loadmem_flag,$(1 ) ) $(call get_loadarch_flag,$(1 ) )
311317
312318.PHONY : % .run % .run.debug % .run.fast
313319
314320# run normal binary with hardware-logged insn dissassembly
315321run-binary : check-binary $(BINARY ) .run
316- run-binaries : check-binaries $(addsuffix .run,$(BINARIES ) )
322+ run-binaries : check-binaries $(addsuffix .run,$(wildcard $( BINARIES ) ) )
317323
318324% .run : % .check-exists $(SIM_PREREQ ) | $(output_dir )
319325 (set -o pipefail && $( NUMA_PREFIX) $( sim) \
@@ -327,7 +333,7 @@ run-binaries: check-binaries $(addsuffix .run,$(BINARIES))
327333
328334# run simulator as fast as possible (no insn disassembly)
329335run-binary-fast : check-binary $(BINARY ) .run.fast
330- run-binaries-fast : check-binaries $(addsuffix .run.fast,$(BINARIES ) )
336+ run-binaries-fast : check-binaries $(addsuffix .run.fast,$(wildcard $( BINARIES ) ) )
331337
332338% .run.fast : % .check-exists $(SIM_PREREQ ) | $(output_dir )
333339 (set -o pipefail && $( NUMA_PREFIX) $( sim) \
@@ -340,7 +346,9 @@ run-binaries-fast: check-binaries $(addsuffix .run.fast,$(BINARIES))
340346
341347# run simulator with as much debug info as possible
342348run-binary-debug : check-binary $(BINARY ) .run.debug
343- run-binaries-debug : check-binaries $(addsuffix .run.debug,$(BINARIES ) )
349+ run-binary-debug-bg : check-binary $(BINARY ) .run.debug.bg
350+ run-binaries-debug : check-binaries $(addsuffix .run.debug,$(wildcard $(BINARIES ) ) )
351+ run-binaries-debug-bg : check-binaries $(addsuffix .run.debug.bg,$(wildcard $(BINARIES ) ) )
344352
345353% .run.debug : % .check-exists $(SIM_DEBUG_PREREQ ) | $(output_dir )
346354ifeq (1,$(DUMP_BINARY ) )
@@ -356,6 +364,19 @@ endif
356364 $(BINARY_ARGS) \
357365 </dev/null 2> >(spike-dasm > $(call get_sim_out_name,$*).out) | tee $(call get_sim_out_name,$*).log)
358366
367+ % .run.debug.bg : % .check-exists $(SIM_DEBUG_PREREQ ) | $(output_dir )
368+ if [ " $* " != " none" ]; then riscv64-unknown-elf-objdump -D -S $* > $( call get_sim_out_name,$* ) .dump ; fi
369+ (set -o pipefail && $( NUMA_PREFIX) $( sim_debug) \
370+ $(PERMISSIVE_ON ) \
371+ $(call get_common_sim_flags,$* ) \
372+ $(VERBOSE_FLAGS ) \
373+ $(call get_waveform_flag,$(call get_sim_out_name,$* ) ) \
374+ $(PERMISSIVE_OFF ) \
375+ $* \
376+ $(BINARY_ARGS ) \
377+ < /dev/null 2> >( spike-dasm > $( call get_sim_out_name,$* ) .out) > $(call get_sim_out_name,$* ) .log \
378+ & echo " PID=$$ !" )
379+
359380run-fast : run-asm-tests-fast run-bmark-tests-fast
360381
361382# ########################################################################################
0 commit comments