pyvcd icon indicating copy to clipboard operation
pyvcd copied to clipboard

Long run of static signals only show time = 0

Open patekd opened this issue 10 months ago • 1 comments

When my input signals don't change the VCD file only shows time = 0 in GTKwaves. I attached 2 VCD files with 512 samples, one is incrementing from 100 to 611 the other is a static 100. You should be able to replicate this but if you need more information or my code let me know.

waves_512_samples_inc_vcd.txt waves_512_samples_static_vcd.txt

patekd avatar Apr 04 '24 14:04 patekd

PyVCD has optimizations to both avoid writing superfluous value changes when the value doesn't change as well as only writing timestamps in conjunction with value changes (to avoid superfluous timestamps). So in this kind of pathological case where none of the values ever change, the timestamp won't be updated via value changes.

However, VCDWriter.flush() and VCDWriter.close() both have an optional timestamp parameter that may be used to force a timestamp to be written without an accompanying value change. For your application, it seems like calling close() with the final timestamp would meet your need.

jpgrayson avatar Apr 05 '24 02:04 jpgrayson