Skip to content
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

Tracking Signal Change Triggers in Verilator #4973

Open
ThePerfectComputer opened this issue Mar 13, 2024 · 3 comments
Open

Tracking Signal Change Triggers in Verilator #4973

ThePerfectComputer opened this issue Mar 13, 2024 · 3 comments
Labels
area: tracing Issue involves tracing status: discussion Issue is waiting for discussions to resolve

Comments

@ThePerfectComputer
Copy link

Some visualization tools like the one in Model Sim allow you to get a trace on what conditions triggered the signal's change. How hard would it be to modify Verilator so that I could ask it what line(s) of Verilog caused my signal to change during a particular cycle?

@ThePerfectComputer ThePerfectComputer added the new New issue not seen by maintainers label Mar 13, 2024
@wsnyder
Copy link
Member

wsnyder commented Mar 16, 2024

This is a significant change that affects a lot of areas.

Also I don't believe it can be represented in any of the open source trace formats, so that would be the first upstream problem to solve before looking at Verilator.

Perhaps as a first step get a format to support it, and feed in a static list of all possible drivers for each signal? Then dynamic next?

@wsnyder wsnyder added status: discussion Issue is waiting for discussions to resolve area: tracing Issue involves tracing and removed new New issue not seen by maintainers labels Mar 16, 2024
@ThePerfectComputer
Copy link
Author

I think it would make more sense to start from Verilator's end - that is, as progress is made implementing the feature in Verilator, a sensible format and or query API would naturally emerge.

I think the approach of "I hand Verilator a simulation trace such as a VCD and the original Verilog and ask it what caused this signal to change at time X" is probably the most portable approach. It's OK if it takes a bit for Verilator to solve this - maybe a second or two. In reality when debugging simulations, the engineer can only think so fast and I doubt the engineer would need to make more than one query every few seconds.

@wsnyder
Copy link
Member

wsnyder commented Mar 18, 2024

I personally would be reluctant to use a viewer which had more than a typical user-interface delay in any operation, around 100 msec. Also I don't see how to technically query Verilator for this information, it would need to store the information in memory, which would be memory prohibitive - much better to just store on disk with the trace.

Verilator doesn't "own" the trace formats. Perhaps see if GTKwave would accept an API pull to add this?

As to Verilator dumping, if we get the GTKwave agreement, and we're willing to just dump all active drivers on the given signal/member (versus bit-by-bit) this might be doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tracing Issue involves tracing status: discussion Issue is waiting for discussions to resolve
Projects
None yet
Development

No branches or pull requests

2 participants