From 5a4e72f57a2a9f64e7db9328b68a974986ef7da7 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 8 May 2023 13:13:09 +1200 Subject: [PATCH] Fix sim writeback check for yw_cosim Writeback of simulation state into initial state was only working for `run()` and `run_cosim_fst()`. This change moves the writeback into the `write_output_files()` function so that all simulation modes work with the writeback option. --- passes/sat/sim.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index 7c209f516..fe1635249 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -1162,6 +1162,11 @@ struct SimWorker : SimShared } for(auto& writer : outputfiles) writer->write(use_signal); + + if (writeback) { + pool wbmods; + top->writeback(wbmods); + } } void update(bool gclk) @@ -1265,11 +1270,6 @@ struct SimWorker : SimShared register_output_step(10*numcycles + 2); write_output_files(); - - if (writeback) { - pool wbmods; - top->writeback(wbmods); - } } void run_cosim_fst(Module *topmod, int numcycles) @@ -1394,11 +1394,6 @@ struct SimWorker : SimShared } write_output_files(); - - if (writeback) { - pool wbmods; - top->writeback(wbmods); - } delete fst; }