Skip to content

Add support for loading event variables in VCD/FST #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ripopov
Copy link
Contributor

@ripopov ripopov commented Jul 21, 2025

Verilog events are a special type of signal that represents discrete occurrences at specific time points,
unlike regular signals that maintain state between transitions.
All simulators I've tried to seem to dump each event as '1' value

#10
1'
#11
1'
#20
1'
..

Added Icarus Verilog output to example inputs.

Code generated by Claude, with minor human interventions.

ripopov added 2 commits July 20, 2025 22:43
Verilog events are a special type of signal that represents discrete occurrences at specific time points,
 unlike regular signals that maintain state between transitions.
 All simulators I've tried to seem to dump each event as '1' value

ekiwi#10
1'
ekiwi#11
1'
ekiwi#20
1'
..

Added Icarus Verilog output to example inputs.
Code generated by Claude, with minor human interventions.
@ripopov
Copy link
Contributor Author

ripopov commented Jul 21, 2025

Did some research, found this:
https://gtkwave.github.io/gtkwave/man/gtkwaverc.5.html

vcd_preserve_glitches_real <value>
indicates that any repeat equal values for a real net spanning different time values in the VCD/FST file 
are not to be compressed into a single value change but should remain for this case. 
Default for vcd_preserve_glitches is disabled. The intended use is for when viewing analog 
interpolated data such that removing duplicate values would incorrectly deform the interpolation.

So there are other scenarios where duplicate filtering may be not desirable

@ekiwi
Copy link
Owner

ekiwi commented Jul 22, 2025

That is fascinating. There was a reason why Surfer wanted duplicate values to be removed, but I forgot. I will review your PR next week. If you don't hear from me by next Friday, please tag me in a new comment on this issue and I will get to it.

@ripopov
Copy link
Contributor Author

ripopov commented Jul 22, 2025

I've also tested this change manually by generating event rendering in Surfer:
image

One thing that requires attention is Compression::compress_with_options , since its public crate API, probably think how to make it extensible, for example #[non_exhaustive] struct? https://doc.rust-lang.org/reference/attributes/type_system.html

@ripopov
Copy link
Contributor Author

ripopov commented Jul 22, 2025

There was a reason why Surfer wanted duplicate values to be removed, but I forgot.

Performance likely. Surfer already de-duplicates signals during its pre-render scan, I had to disable that mechanism for VcdEvent type in Surfer to render events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants