[DoNotMerge] Add signal trace capability to arcilator #8986
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.
Sorry for the code dump. I will split this up into more manageable PRs when I have the time. I just want to get this out of the door in case it is already useful for somebody and to get some feedback.
This PR allows arcilator to "natively" produce signal traces. When doing a JIT run, just add
--trace-taps --jit-vcd
to the command line and it should produce a VCD file in your working directory containing the observed signals.It breaks down to four major components:
CombineTaps
pass, which resolves signal aliases, so we don't trace the clock for each module individually.TraceTap
attributes duringAllocState
when the--trace-taps
option is provided, to maintain the association between theStateWrite
ops and the traced signals.StateWriteOp
writes a value that is different from the one currently stored.arcilator-runtime.h
.It involves a lot of ugly pointer wrangling. I've only run some basic tests so far, so I'm sure there are still plenty of bugs to find. It will also most likely (and to some extent inevitably) tank the performance. Unfortunately, I haven't been able to run the arc tests on it so far. For some reason, when enabling the
TRACE
option on my machine, it crashes with this funky LLVM Error, even when using a main branch build, and I've now run out of time to investigate: