Skip to content

Commit 76d06ed

Browse files
committed
add -fst-noinit flag to sim for not initializing the state from the fst file
1 parent 6b4f11d commit 76d06ed

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

passes/sat/sim.cc

+10-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ struct SimShared
123123
std::vector<TriggeredAssertion> triggered_assertions;
124124
std::vector<DisplayOutput> display_output;
125125
bool serious_asserts = false;
126+
bool fst_noinit = false;
126127
bool initstate = true;
127128
};
128129

@@ -1553,7 +1554,7 @@ struct SimWorker : SimShared
15531554
bool did_something = top->setInputs();
15541555

15551556
if (initial) {
1556-
did_something |= top->setInitState();
1557+
if (!fst_noinit) did_something |= top->setInitState();
15571558
initialize_stable_past();
15581559
initial = false;
15591560
}
@@ -2672,6 +2673,10 @@ struct SimPass : public Pass {
26722673
log(" fail the simulation command if, in the course of simulating,\n");
26732674
log(" any of the asserts in the design fail\n");
26742675
log("\n");
2676+
log(" -fst-noinit\n");
2677+
log(" do not initialize latches and memories from an input FST or VCD file\n");
2678+
log(" (use the initial defined by the design instead)\n");
2679+
log("\n");
26752680
log(" -q\n");
26762681
log(" disable per-cycle/sample log message\n");
26772682
log("\n");
@@ -2834,6 +2839,10 @@ struct SimPass : public Pass {
28342839
worker.serious_asserts = true;
28352840
continue;
28362841
}
2842+
if (args[argidx] == "-fst-noinit") {
2843+
worker.fst_noinit = true;
2844+
continue;
2845+
}
28372846
if (args[argidx] == "-x") {
28382847
worker.ignore_x = true;
28392848
continue;

0 commit comments

Comments
 (0)