-
Notifications
You must be signed in to change notification settings - Fork 142
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
Improve parseability of type and constant string representations #649
Conversation
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.
Thanks for the diff. I have a few minor comments but happy to land this once you address them.
Also as you can probably tell from the failed tests, there are a bunch of eval tests that need to be updated for your ConstantValue toString change to use |
08d5eaf
to
04caea4
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #649 +/- ##
==========================================
- Coverage 91.23% 91.19% -0.04%
==========================================
Files 185 185
Lines 42042 42200 +158
==========================================
+ Hits 38357 38486 +129
- Misses 3685 3714 +29
Continue to review full report at Codecov.
|
I chose to make 3. optional now and keep the existing default behavior, maintaining full compatibility. |
Overview
Enable
TypePrinter
and varioustoString()
s to produce more parseable output by optionally emitting well-formed SystemVerilog expressions in more situations.All changes below except 3. keep existing stringifications unchanged by default. All existing code remains compatible through optional fields and parameters.
These changes do not guarantee type or constant parseability, but cover some simple-to-fix gaps in Slang's already quite parseable stringifications.
Changes
TypePrinter
skipScopedTypeNames
option toTypePrinter
to omit suffixed type names from container types.fullEnumType
option toTypePrinter
to include enum base types.ConstantValue
andSVInt
'{...}
) instead of simple brackets ([...]
) for container constants.abbreviateThresholdBits
to the end user ofConstantValue.toString()
and callees to control or suppress integer vector abbreviation as needed.exactUnknowns
parameter toConstantValue.toString()
and callees to ensure a reversible representation of integer vectors with unknown bits.