chisel
chisel copied to clipboard
[DebugInfo] Emit source language scala type information and pass it to CIRCT
This is a first attempt for generating and propagating scala source language type information to CIRCT https://github.com/chipsalliance/chisel/issues/4015. This PR adds a new option to support the new backend of my project: a type-based waveform viewer. Chisel currently misses an open-source waveform viewer and tywaves is adding support for Chisel to Surfer.
I wrote more details about the internal changes here: https://github.com/rameloni/tywaves-chisel-demo/wiki/Changes-in-Chisel. While the full wiki contains also details about the integration of the different components involved.
Specific Chisel contributions
- Extract scala type name and constructor parameters (type, name, value)
- Encode that information into an annotation for each circuit element and pass to CIRCT through the FIRRTL annotations (probably the intrinsics are a better solution, but to get things started I think annotations system is more than enough)
- Integrate it in
ChiselStagethrough thePhaseManagerbetween theElaborateandConvertphases - Add an option to
ChiselStagefor generating or not that information
Contributor Checklist
- [ ] Did you add Scaladoc to every public function/method?
- [ ] Did you add at least one test demonstrating the PR?
- [ ] Did you delete any extraneous printlns/debugging code?
- [ ] Did you specify the type of improvement?
- [ ] Did you add appropriate documentation in
docs/src? - [ ] Did you request a desired merge strategy?
- [ ] Did you add text to be included in the Release Notes for this change?
Type of Improvement
- Feature (or new API)
- Backend code generation
Desired Merge Strategy
- Squash: The PR will be squashed and merged (choose this if you have no preference).
- Rebase: You will rebase the PR onto master and it will be merged with a merge commit.
Release Notes
Reviewer Checklist (only modified by reviewer)
- [ ] Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
- [ ] Did you mark the proper milestone (Bug fix:
3.6.x,5.x, or6.xdepending on impact, API modification or big change:7.0)? - [ ] Did you review?
- [ ] Did you check whether all relevant Contributor checkboxes have been checked?
- [ ] Did you do one of the following when ready to merge:
- [ ] Squash: You/ the contributor
Enable auto-merge (squash), clean up the commit message, and label withPlease Merge. - [ ] Merge: Ensure that contributor has cleaned up their commit history, then merge with
Create a merge commit.
- [ ] Squash: You/ the contributor