Allow visualizing delta cycles in VCD dumps #1232
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds an option
fs_per_delta=
toSimulator.write_vcd()
. Specifying a positive integer value for it causes the simulator to offset value change times by that many femtoseconds for each delta cycle after the last timeline advancement.This option is only suitable for debugging. If the timeline is advanced by less than the combined duration of expanded delta cycles, an error will be raised like:
Typically
fs_per_delta=1
is best, since it allows thousands of delta cycles to be expanded without risking a VCD phase error, but bigger values can be used for an exaggerated visual effect.Also, the VCD writer is changed to use 1 fs as the timebase instead of 1 ps. This change is largely invisible to designers, resulting only in slightly larger VCD files due to longer timestamps.
Since the
fs_per_delta=
option is per VCD writer, it is possible to simultaneously dump two VCDs, one with and one without delta cycle expansion:In GTKWave, it is possible to observe every intermediate value recorded by the VCD writer by selecting all signals and using left and right arrow keys to navigate. This works regardless of the value of
fs_per_delta
.