From 76d06ed5060b95754f0e6f91dc7916b0ca39c62c Mon Sep 17 00:00:00 2001 From: Emily Schmidt Date: Wed, 24 Jul 2024 17:33:32 +0100 Subject: [PATCH] add -fst-noinit flag to sim for not initializing the state from the fst file --- passes/sat/sim.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index aeed16b9784..f5ad6524d10 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -123,6 +123,7 @@ struct SimShared std::vector triggered_assertions; std::vector display_output; bool serious_asserts = false; + bool fst_noinit = false; bool initstate = true; }; @@ -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; } @@ -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"); @@ -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;