Fixes: Fix no close trace file when the sim is finished

This commit is contained in:
Li.XiongHui 2024-11-07 14:21:14 +08:00
parent 8b4949edcd
commit 5fa144ec3a
1 changed files with 4 additions and 0 deletions

View File

@ -78,7 +78,11 @@ extern "C" void litex_sim_tracer_dump()
extern "C" int litex_sim_got_finish() extern "C" int litex_sim_got_finish()
{ {
int finished;
tfp->flush(); tfp->flush();
if(finished = Verilated::gotFinish()) {
tfp->close();
}
return Verilated::gotFinish(); return Verilated::gotFinish();
} }