Closed christian-krieg closed 4 years ago
Thanks for this Christian! I should stop being lazy and add tests. But hey, lazy! XD
One small thing, at f.readline().strip().rstrip()
I think strip()
already does an rstrip()
so rstrip
is not needed?
Hey There,
I was in need to extract the timescale from a VCD file, but didn't find that feature implemented in VCDVCD. So I put in some effort and implemented this feature. I hope you find it useful as well, and it would be cool to see this propagating upstream.
Looking forward to our discussion!
In the following, I listed the changes I made to the VCDVCD class:
The timescale is parsed into a dictionary
VCDVCD::_timescale
that holds key/value pairs describing the time scaleList of keys:
"timescale": The timescale in seconds (SI unit) "number" : The time number as specified in the VCD file "unit" : The time unit as specified in the VCD file "factor" : The numerical factor derived from the unit
The function
VCDVCD::get_timescale()
returns the dictionaryCheers!