@@ -16,16 +16,19 @@ 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" \
2224" ASPECTS = comma separated list of Chisel aspect flows to run (e.x. chipyard.upf.ChipTopUPFAspect)"
2325
24- EXTRA_GENERATOR_REQS ?= $( BOOTROM_TARGETS )
26+ EXTRA_GENERATOR_REQS ?=
2527EXTRA_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# ########################################################################################
@@ -100,15 +104,9 @@ TAPEOUT_VLOG_SOURCES = $(call lookup_srcs_by_multiple_type,$(TAPEOUT_SOURCE_DIRS
100104SBT_SOURCE_DIRS = $(addprefix $(base_dir ) /,generators tools)
101105SBT_SOURCES = $(call lookup_srcs,$(SBT_SOURCE_DIRS ) ,sbt) $(base_dir ) /build.sbt $(base_dir ) /project/plugins.sbt $(base_dir ) /project/build.properties
102106
103- # ########################################################################################
104- # copy over bootrom files
105- # ########################################################################################
106107$(build_dir ) :
107108 mkdir -p $@
108109
109- $(BOOTROM_TARGETS ) : $(build_dir ) /bootrom.% .img: $(TESTCHIP_RSRCS_DIR ) /testchipip/bootrom/bootrom.% .img | $(build_dir )
110- cp -f $< $@
111-
112110# ########################################################################################
113111# compile scala jars
114112# ########################################################################################
@@ -233,6 +231,8 @@ $(TOP_SMEMS_CONF) $(MODEL_SMEMS_CONF) &: $(MFC_SMEMS_CONF) $(MFC_MODEL_HRCHY_JS
233231 --model-module-name $(MODEL ) \
234232 --out-dut-smems-conf $(TOP_SMEMS_CONF ) \
235233 --out-model-smems-conf $(MODEL_SMEMS_CONF )
234+ # for blackboxed SRAMs: add custom.mems.conf as blackbox and use generated module name in blackbox verilog source
235+ -[ -f $(GEN_COLLATERAL_DIR)/custom.mems.conf ] && cat $(GEN_COLLATERAL_DIR)/custom.mems.conf >> $(TOP_SMEMS_CONF)
236236
237237# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
238238TOP_MACROCOMPILER_MODE ?= --mode synflops
@@ -256,7 +256,7 @@ ifneq (,$(EXT_FILELISTS))
256256else
257257 rm -f $@
258258endif
259- sort -u $(sim_files) $(ALL_MODS_FILELIST) | grep -v '.*\.\(svh\|h\)$$' >> $@
259+ sort -u $(sim_files) $(ALL_MODS_FILELIST) | grep -v '.*\.\(svh\|h\|conf\ )$$' >> $@
260260 echo "$(TOP_SMEMS_FILE)" >> $@
261261 echo "$(MODEL_SMEMS_FILE)" >> $@
262262
@@ -305,15 +305,15 @@ get_loadarch_flag = +loadarch=$(subst mem.elf,loadarch,$(1))
305305endif
306306
307307# 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 ) )
308+ get_sim_out_name = $(output_dir ) /$(call get_out_name,$(1 ) )$( if $( EXTRA_SIM_OUT_NAME ) ,. $( EXTRA_SIM_OUT_NAME ) ,)
309309# sim flags that are common to run-binary/run-binary-fast/run-binary-debug
310310get_common_sim_flags = $(SIM_FLAGS ) $(EXTRA_SIM_FLAGS ) $(SEED_FLAG ) $(call get_loadmem_flag,$(1 ) ) $(call get_loadarch_flag,$(1 ) )
311311
312312.PHONY : % .run % .run.debug % .run.fast
313313
314314# run normal binary with hardware-logged insn dissassembly
315315run-binary : check-binary $(BINARY ) .run
316- run-binaries : check-binaries $(addsuffix .run,$(BINARIES ) )
316+ run-binaries : check-binaries $(addsuffix .run,$(wildcard $( BINARIES ) ) )
317317
318318% .run : % .check-exists $(SIM_PREREQ ) | $(output_dir )
319319 (set -o pipefail && $( NUMA_PREFIX) $( sim) \
@@ -327,7 +327,7 @@ run-binaries: check-binaries $(addsuffix .run,$(BINARIES))
327327
328328# run simulator as fast as possible (no insn disassembly)
329329run-binary-fast : check-binary $(BINARY ) .run.fast
330- run-binaries-fast : check-binaries $(addsuffix .run.fast,$(BINARIES ) )
330+ run-binaries-fast : check-binaries $(addsuffix .run.fast,$(wildcard $( BINARIES ) ) )
331331
332332% .run.fast : % .check-exists $(SIM_PREREQ ) | $(output_dir )
333333 (set -o pipefail && $( NUMA_PREFIX) $( sim) \
@@ -340,7 +340,9 @@ run-binaries-fast: check-binaries $(addsuffix .run.fast,$(BINARIES))
340340
341341# run simulator with as much debug info as possible
342342run-binary-debug : check-binary $(BINARY ) .run.debug
343- run-binaries-debug : check-binaries $(addsuffix .run.debug,$(BINARIES ) )
343+ run-binary-debug-bg : check-binary $(BINARY ) .run.debug.bg
344+ run-binaries-debug : check-binaries $(addsuffix .run.debug,$(wildcard $(BINARIES ) ) )
345+ run-binaries-debug-bg : check-binaries $(addsuffix .run.debug.bg,$(wildcard $(BINARIES ) ) )
344346
345347% .run.debug : % .check-exists $(SIM_DEBUG_PREREQ ) | $(output_dir )
346348ifeq (1,$(DUMP_BINARY ) )
@@ -356,6 +358,19 @@ endif
356358 $(BINARY_ARGS) \
357359 </dev/null 2> >(spike-dasm > $(call get_sim_out_name,$*).out) | tee $(call get_sim_out_name,$*).log)
358360
361+ % .run.debug.bg : % .check-exists $(SIM_DEBUG_PREREQ ) | $(output_dir )
362+ if [ " $* " != " none" ]; then riscv64-unknown-elf-objdump -D -S $* > $( call get_sim_out_name,$* ) .dump ; fi
363+ (set -o pipefail && $( NUMA_PREFIX) $( sim_debug) \
364+ $(PERMISSIVE_ON ) \
365+ $(call get_common_sim_flags,$* ) \
366+ $(VERBOSE_FLAGS ) \
367+ $(call get_waveform_flag,$(call get_sim_out_name,$* ) ) \
368+ $(PERMISSIVE_OFF ) \
369+ $* \
370+ $(BINARY_ARGS ) \
371+ < /dev/null 2> >( spike-dasm > $( call get_sim_out_name,$* ) .out) > $(call get_sim_out_name,$* ) .log \
372+ & echo " PID=$$ !" )
373+
359374run-fast : run-asm-tests-fast run-bmark-tests-fast
360375
361376# ########################################################################################
0 commit comments