Add support for FSDB (#1072)

This commit is contained in:
Jerry Zhao
2022-01-10 09:24:05 -08:00
committed by GitHub
parent 1ce67a0997
commit a72d466646
3 changed files with 22 additions and 3 deletions

View File

@@ -257,7 +257,7 @@ $(output_dir)/%.out: $(output_dir)/% $(SIM_PREREQ)
#########################################################################################
# include build/project specific makefrags made from the generator
#########################################################################################
ifneq ($(filter run% %.run %.out %.vpd %.vcd,$(MAKECMDGOALS)),)
ifneq ($(filter run% %.run %.out %.vpd %.vcd %.fsdb,$(MAKECMDGOALS)),)
-include $(build_dir)/$(long_name).d
endif

View File

@@ -74,15 +74,20 @@ $(sim): $(sim_vsrcs) $(sim_common_files) $(dramsim_lib) $(EXTRA_SIM_REQS)
$(sim_debug): $(sim_vsrcs) $(sim_common_files) $(dramsim_lib) $(EXTRA_SIM_REQS)
rm -rf $(model_dir_debug)
$(VCS) $(VCS_OPTS) $(EXTRA_SIM_SOURCES) -o $@ -Mdir=$(model_dir_debug) \
+define+DEBUG
+define+DEBUG -debug_access+all -kdb -lca
#########################################################################################
# create a vcs vpd rule
# create vcs vpd/fsdb rules
#########################################################################################
.PRECIOUS: $(output_dir)/%.vpd %.vpd
$(output_dir)/%.vpd: $(output_dir)/% $(sim_debug)
(set -o pipefail && $(sim_debug) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(VERBOSE_FLAGS) +vcdplusfile=$@ $(PERMISSIVE_OFF) $< </dev/null 2> >(spike-dasm > $<.out) | tee $<.log)
.PRECIOUS: $(output_dir)/%.fsdb %.fsdb
$(output_dir)/%.fsdb: $(output_dir)/% $(sim_debug)
(set -o pipefail && $(sim_debug) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(VERBOSE_FLAGS) +fsdbfile=$@ $(PERMISSIVE_OFF) $< </dev/null 2> >(spike-dasm > $<.out) | tee $<.log)
#########################################################################################
# general cleanup rules
#########################################################################################

14
vcs.mk
View File

@@ -1,4 +1,14 @@
HELP_COMPILATION_VARIABLES += \
" USE_FSDB = set to '1' to build VCS simulator to emit FSDB instead of VPD."
HELP_SIMULATION_VARIABLES += \
" USE_FSDB = set to '1' to run VCS simulator emitting FSDB instead of VPD."
ifdef USE_FSDB
WAVEFORM_FLAG=+fsdbfile=$(sim_out_name).fsdb
else
WAVEFORM_FLAG=+vcdplusfile=$(sim_out_name).vpd
endif
# If ntb_random_seed unspecified, vcs uses 1 as constant seed.
# Set ntb_random_seed_automatic to actually get a random seed
@@ -55,3 +65,7 @@ PREPROC_DEFINES = \
+define+RANDOMIZE_REG_INIT \
+define+RANDOMIZE_GARBAGE_ASSIGN \
+define+RANDOMIZE_INVALID_ASSIGN
ifdef USE_FSDB
PREPROC_DEFINES += +define+FSDB
endif