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.
This commit is contained in:
Krystine Sherwin 2023-05-08 13:13:09 +12:00
parent 4251d37f4f
commit 5a4e72f57a
No known key found for this signature in database
1 changed files with 5 additions and 10 deletions

View File

@ -1162,6 +1162,11 @@ struct SimWorker : SimShared
}
for(auto& writer : outputfiles)
writer->write(use_signal);
if (writeback) {
pool<Module*> 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<Module*> 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<Module*> wbmods;
top->writeback(wbmods);
}
delete fst;
}