-
Notifications
You must be signed in to change notification settings - Fork 603
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
Add OpaqueType support to Records #2662
Add OpaqueType support to Records #2662
Conversation
54f49f7
to
f3951aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good! Some suggested improvements.
Add new slot type and handle slot type in convert. add opaqueType override to Record
update converter for OpaqueSlot
Run scalafmt
update docstring
Co-authored-by: Jack Koenig <jack.koenig3@gmail.com>
443334b
to
3c47e64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except one minor tweak
OpaqueTypes are essentially type aliases that hide the underlying type. They are implemented in Chisel as Records of a single, unnamed element where the wrapping Record does not exist in the emitted FIRRTL. Co-authored-by: Jack Koenig <koenig@sifive.com> (cherry picked from commit df5afee)
Github automerged this even though CI failed.... that's weird. I'll push a fix |
* Add OpaqueType support to Records (#2662) OpaqueTypes are essentially type aliases that hide the underlying type. They are implemented in Chisel as Records of a single, unnamed element where the wrapping Record does not exist in the emitted FIRRTL. Co-authored-by: Jack Koenig <koenig@sifive.com> (cherry picked from commit df5afee) * Fix test compilation * Fix OpaqueType tests in RecordSpec Need to implement cloneType correctly and to warn instead of error when accessing .toTarget of non-hardware types because that is a warning (not error) in 3.5. * Waive MiMa false positives Co-authored-by: Aditya Naik <91489422+adkian-sifive@users.noreply.github.com> Co-authored-by: Jack Koenig <koenig@sifive.com>
OpaqueType
allows simplifyingRecord
references when theRecord
subtypes have single map elementsContributor Checklist
docs/src
?Type of Improvement
API Impact
New override for Records for single element types
Backend Code Generation Impact
If
Record.opaqueType
is overridden totrue
, the generated CHIRRTL will substitute name of theRecord
for that of the subfield, and substitute type of the subfield for type of theRecord
Desired Merge Strategy
Release Notes
Add new override in Record to support opaque types
Reviewer Checklist (only modified by reviewer)
3.4.x
, [small] API extension:3.5.x
, API modification or big change:3.6.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.