diff --git a/common.mk b/common.mk index abb148fc..d055f784 100644 --- a/common.mk +++ b/common.mk @@ -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 diff --git a/sims/vcs/Makefile b/sims/vcs/Makefile index e364830b..550be3c2 100644 --- a/sims/vcs/Makefile +++ b/sims/vcs/Makefile @@ -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) $< >(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) $< >(spike-dasm > $<.out) | tee $<.log) + + ######################################################################################### # general cleanup rules ######################################################################################### diff --git a/vcs.mk b/vcs.mk index e62b3f07..2a88d39b 100644 --- a/vcs.mk +++ b/vcs.mk @@ -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