Closed dhedde closed 2 years ago
Thanks for your contribution, Damien!
For your contribution to be applicable for consideration by the Accellera working groups, you need to sign-off the Accellera Developer's Certificate of Origin as described in the CONTRIBUTING file.
Hi Philipp,
I rebased on top of master and added the signed-off line
Sorry for the delay. Damien
This looks fine.
Hi !
We found out recently that trace files are not flushed at the end of a time cycle. The consequence is that some traces can be held back in stdlib buffers. It is not a problem when using trace files in post-mortem analysis. But if we want to use these files during the simulation it is problematic.
The included file shows the case. Using
tail -f
on the output trace.vcd file while simulation is ongoing shows that traces are coming big chunk by big chunk every few seconds even though traces are generated every 100ms. case.cc.gzOne simple (the attached one) solution is to just add an fflush every time we've generated some traces. This patch just do that on both vcd and wif trace file. This guarantees that trace files are always up-to-date with current simulation time.
Of course the drawback is that it may slow down the simulation speed (especially if there is only a few changing traced signals). Other solutions exist such as adding API to created un-buffered trace files allowing to keep the previous-behavior. Here's an example commit for adding an optional argument to the
sc_create_{vcd,wif}_trace_file
.Damien