From 1c1620e48ff6b807aed0c955792b4e8a17614c20 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Wed, 9 Nov 2022 09:54:13 -0600 Subject: Implement initial state randomization in sim --- tb/top/conspiracion.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tb/top/conspiracion.cpp') diff --git a/tb/top/conspiracion.cpp b/tb/top/conspiracion.cpp index c671e77..b73bd4b 100644 --- a/tb/top/conspiracion.cpp +++ b/tb/top/conspiracion.cpp @@ -116,6 +116,16 @@ int main(int argc, char **argv) Verilated::commandArgs(argc, argv); + for(char **arg = argv; *arg; ++arg) + { + if(**arg == '+') + { + *arg = NULL; + argc = arg - argv; + break; + } + } + args::ArgumentParser parser("Simulador proyecto final CE3201"); args::ValueFlagList init_regs @@ -220,6 +230,10 @@ int main(int argc, char **argv) tick(); }; + top.reset_reset_n = 0; + cycle(); + top.reset_reset_n = 1; + for(unsigned i = 0; i < *cycles; ++i) { cycle(); -- cgit v1.2.3