Skip to content

Commit

Permalink
add -fst-noinit flag to sim for not initializing the state from the f…
Browse files Browse the repository at this point in the history
…st file
  • Loading branch information
aiju committed Jul 24, 2024
1 parent 6b4f11d commit 76d06ed
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion passes/sat/sim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ struct SimShared
std::vector<TriggeredAssertion> triggered_assertions;
std::vector<DisplayOutput> display_output;
bool serious_asserts = false;
bool fst_noinit = false;
bool initstate = true;
};

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

if (initial) {
did_something |= top->setInitState();
if (!fst_noinit) did_something |= top->setInitState();
initialize_stable_past();
initial = false;
}
Expand Down Expand Up @@ -2672,6 +2673,10 @@ struct SimPass : public Pass {
log(" fail the simulation command if, in the course of simulating,\n");
log(" any of the asserts in the design fail\n");
log("\n");
log(" -fst-noinit\n");
log(" do not initialize latches and memories from an input FST or VCD file\n");
log(" (use the initial defined by the design instead)\n");
log("\n");
log(" -q\n");
log(" disable per-cycle/sample log message\n");
log("\n");
Expand Down Expand Up @@ -2834,6 +2839,10 @@ struct SimPass : public Pass {
worker.serious_asserts = true;
continue;
}
if (args[argidx] == "-fst-noinit") {
worker.fst_noinit = true;
continue;
}
if (args[argidx] == "-x") {
worker.ignore_x = true;
continue;
Expand Down

0 comments on commit 76d06ed

Please sign in to comment.