-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RANDOM_SEED variable to set random init for VCS and Verilator simulations #629
Conversation
@@ -47,13 +47,11 @@ VCS_OPTS = -notice -line $(VCS_CC_OPTS) $(VCS_NONCC_OPTS) $(VCS_DEFINE_OPTS) $(E | |||
# vcs simulator rules | |||
######################################################################################### | |||
$(sim): $(sim_vsrcs) $(sim_common_files) $(dramsim_lib) $(EXTRA_SIM_REQS) | |||
rm -rf csrc && $(VCS) $(VCS_OPTS) -o $@ \ | |||
-debug_pp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-debug_pp
is already defined in VCS_OPTS
@@ -29,6 +29,7 @@ sim = $(sim_dir)/$(sim_prefix)-$(MODEL_PACKAGE)-$(CONFIG) | |||
sim_debug = $(sim_dir)/$(sim_prefix)-$(MODEL_PACKAGE)-$(CONFIG)-debug | |||
|
|||
WAVEFORM_FLAG=-v$(sim_out_name).vcd | |||
SEED_FLAG=+verilator+seed+I$(RANDOM_SEED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thing we added support for these flags 😝
I'm with Colin on this. We should just print the seed if we don't already.
…On Sun, Jul 19, 2020 at 4:23 PM Jerry Zhao ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In variables.mk
<#629 (comment)>:
> @@ -167,6 +167,7 @@ PERMISSIVE_OFF=+permissive-off
BINARY ?=
override SIM_FLAGS += +dramsim +dramsim_ini_dir=$(TESTCHIP_DIR)/src/main/resources/dramsim2_ini +max-cycles=$(timeout_cycles)
VERBOSE_FLAGS ?= +verbose
+RANDOM_SEED ?= 1
The current behavior in VCS uses 1 as the seed for every run. I think
having default be deterministic makes more sense, otherwise it will always
be annoying to reproduce some non-determinism-induced bug.
Users looking for randomness can just set RANDOM_SEED=$RANDOM
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#629 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTWDAC5JTWFUJYFTCLNZ6LR4N575ANCNFSM4O5JDQLA>
.
|
The seed is already printed in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Setting
RANDOM_SEED
now lets you control the random seed for VCS and Verilator. LeavingRANDOM_SEED
unset results in randomly generated seed.Related issue:
Type of change: new feature
Impact: software change
Release Notes