@@ -16,6 +16,8 @@ HELP_COMPILATION_VARIABLES += \
16
16
" EXTRA_SIM_LDFLAGS = additional LDFLAGS for building simulators" \
17
17
" EXTRA_SIM_SOURCES = additional simulation sources needed for simulator" \
18
18
" 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" \
19
21
" ENABLE_YOSYS_FLOW = if set, add compilation flags to enable the vlsi flow for yosys(tutorial flow)" \
20
22
" EXTRA_CHISEL_OPTIONS = additional options to pass to the Chisel compiler" \
21
23
" MFC_BASE_LOWERING_OPTIONS = override lowering options to pass to the MLIR FIRRTL compiler" \
@@ -26,6 +28,7 @@ EXTRA_SIM_CXXFLAGS ?=
26
28
EXTRA_SIM_LDFLAGS ?=
27
29
EXTRA_SIM_SOURCES ?=
28
30
EXTRA_SIM_REQS ?=
31
+ EXTRA_SIM_OUT_NAME ?=
29
32
30
33
ifneq ($(ASPECTS ) , )
31
34
comma = ,
@@ -67,6 +70,7 @@ include $(base_dir)/generators/ibex/ibex.mk
67
70
include $(base_dir ) /generators/ara/ara.mk
68
71
include $(base_dir ) /generators/tracegen/tracegen.mk
69
72
include $(base_dir ) /generators/nvdla/nvdla.mk
73
+ include $(base_dir ) /generators/radiance/radiance.mk
70
74
include $(base_dir ) /tools/torture.mk
71
75
72
76
# ########################################################################################
@@ -233,6 +237,8 @@ $(TOP_SMEMS_CONF) $(MODEL_SMEMS_CONF) &: $(MFC_SMEMS_CONF) $(MFC_MODEL_HRCHY_JS
233
237
--model-module-name $(MODEL ) \
234
238
--out-dut-smems-conf $(TOP_SMEMS_CONF ) \
235
239
--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)
236
242
237
243
# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
238
244
TOP_MACROCOMPILER_MODE ?= --mode synflops
@@ -256,7 +262,7 @@ ifneq (,$(EXT_FILELISTS))
256
262
else
257
263
rm -f $@
258
264
endif
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\ )$$' >> $@
260
266
echo "$(TOP_SMEMS_FILE)" >> $@
261
267
echo "$(MODEL_SMEMS_FILE)" >> $@
262
268
@@ -305,15 +311,15 @@ get_loadarch_flag = +loadarch=$(subst mem.elf,loadarch,$(1))
305
311
endif
306
312
307
313
# 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 ) ,)
309
315
# sim flags that are common to run-binary/run-binary-fast/run-binary-debug
310
316
get_common_sim_flags = $(SIM_FLAGS ) $(EXTRA_SIM_FLAGS ) $(SEED_FLAG ) $(call get_loadmem_flag,$(1 ) ) $(call get_loadarch_flag,$(1 ) )
311
317
312
318
.PHONY : % .run % .run.debug % .run.fast
313
319
314
320
# run normal binary with hardware-logged insn dissassembly
315
321
run-binary : check-binary $(BINARY ) .run
316
- run-binaries : check-binaries $(addsuffix .run,$(BINARIES ) )
322
+ run-binaries : check-binaries $(addsuffix .run,$(wildcard $( BINARIES ) ) )
317
323
318
324
% .run : % .check-exists $(SIM_PREREQ ) | $(output_dir )
319
325
(set -o pipefail && $( NUMA_PREFIX) $( sim) \
@@ -327,7 +333,7 @@ run-binaries: check-binaries $(addsuffix .run,$(BINARIES))
327
333
328
334
# run simulator as fast as possible (no insn disassembly)
329
335
run-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 ) ) )
331
337
332
338
% .run.fast : % .check-exists $(SIM_PREREQ ) | $(output_dir )
333
339
(set -o pipefail && $( NUMA_PREFIX) $( sim) \
@@ -340,7 +346,9 @@ run-binaries-fast: check-binaries $(addsuffix .run.fast,$(BINARIES))
340
346
341
347
# run simulator with as much debug info as possible
342
348
run-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 ) ) )
344
352
345
353
% .run.debug : % .check-exists $(SIM_DEBUG_PREREQ ) | $(output_dir )
346
354
ifeq (1,$(DUMP_BINARY ) )
@@ -356,6 +364,19 @@ endif
356
364
$(BINARY_ARGS) \
357
365
</dev/null 2> >(spike-dasm > $(call get_sim_out_name,$*).out) | tee $(call get_sim_out_name,$*).log)
358
366
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
+
359
380
run-fast : run-asm-tests-fast run-bmark-tests-fast
360
381
361
382
# ########################################################################################
0 commit comments