chisel
chisel copied to clipboard
Add :<>=, which is a chisel3 API for FIRRTL.<= (to aid in migration from Chisel.:= and Chisel.<>)
To migrate code from Chisel._ to chisel3._, the bulk connect operators are very different, which requires a significant rewrite of every bulk connection.
However, the old connect operator was actually well defined, and a good operator. Hence, we want to let import chisel3._ users have the old connect operator back, but with a new syntax.
NOTE: this new operator does not have the exact same semantics as Chisel.:= or Chisel.<> because the chiselTypes must be the same on both sides.
Contributor Checklist
- [ ] Did you add Scaladoc to every public function/method?
- [x] Did you add at least one test demonstrating the PR?
- [x] Did you delete any extraneous printlns/debugging code?
- [x] Did you specify the type of improvement?
- [N/A] Did you add appropriate documentation in
docs/src? Will update this when other connect ops:<=and:>=are added. - [x] Did you state the API impact?
- [x] Did you specify the code generation impact?
- [x] Did you request a desired merge strategy?
- [x] Did you add text to be included in the Release Notes for this change?
Type of Improvement
- new feature/API
API Impact
Backend Code Generation Impact
No change - it is a new API.
Desired Merge Strategy
- Squash: The PR will be squashed and merged (choose this if you have no preference.
Release Notes
Added the :<>= operator, semantically equivalent to Chisel.:= but available in import chisel3._.
Reviewer Checklist (only modified by reviewer)
- [ ] Did you add the appropriate labels?
- [ ] Did you mark the proper milestone (Bug fix:
3.4.x, [small] API extension:3.5.x, API modification or big change:3.6.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
Is this FIRRTL.<- ? I didn't this firrtl has a :=?
Implements a piece of #2643
chisel3.:<>= is FIRRTL.<=, which is also Chisel.:=.
chisel3.:<>=isFIRRTL.<=, which is alsoChisel.:=.
Chisel.:= is actually FIRRTL.<- when used on an aggregate. In fact, := and <> in import Chisel._ are exactly the same 😬 (Scastie)
This PR title is misleading because the chisel3.:<>= operator doesn't have the same semantics as Chisel.:=. I show this by copying over a test from CompatibilitySpec which uses Chisel.:= to connect missing bundles fields which fails using chisel3.:<>= : https://github.com/chipsalliance/chisel3/pull/2641/commits/f6e3d217c1e7d07f38ff4f985dc1729c6dfcaba9
I'm not saying this new operator is not useful, it's just misleading to characterize it as the same semantics as Chisel.:=
Subsumed by #2713