-
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 --warn:reflective-naming #2561
Conversation
case _ => false | ||
} | ||
case b: BaseModule => true | ||
case m: Mem[_] => true |
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.
can Instances be named?
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.
does this need a _ default case? What about Verification statements?
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.
Yes and yes, will fix and add tests
* @param seed The seed for computing the name (if available) | ||
* @param defaultPrefix Optional default prefix which is only used if the seed is not defined | ||
* @param defaultSeed Optional default (or "fallback") seed | ||
* @return the name, if it can be computed |
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.
is it None
if it cannot be computed? Under what scenarios can it not be computed?
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.
It can't be computed if seed and default seed are both None
.
2e3dcbe
to
82e5ebb
Compare
The new function is chisel3.internal.buildName.
82e5ebb
to
c74f564
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!
Forgot to run scalafmt and forgot to add a test for |
This new argument (and associated annotation) will turn on a warning whenever reflective naming changes the name of a signal. This is provided to help migrate from Chisel 3.5 to 3.6 since reflective naming is removed in Chisel 3.6.
c74f564
to
97afd9b
Compare
* Factor buildName into reusable function The new function is chisel3.internal.buildName. (cherry picked from commit 370ca8a) * Add --warn:reflective-naming This new argument (and associated annotation) will turn on a warning whenever reflective naming changes the name of a signal. This is provided to help migrate from Chisel 3.5 to 3.6 since reflective naming is removed in Chisel 3.6. (cherry picked from commit 97afd9b) Co-authored-by: Jack Koenig <koenig@sifive.com>
This new argument (and associated annotation) will turn on a warning
whenever reflective naming changes the name of a signal. This is
provided to help migrate from Chisel 3.5 to 3.6 since reflective naming
is removed in Chisel 3.6.
I also factored
_computeName
out into a resuable function so that you can ask for the name of something given aseed
andprefix
without having to have aHasId
with those fields set.This mega-conflicts with @mwachs5's #2556
Contributor Checklist
docs/src
?Type of Improvement
API Impact
This adds a new CLI/annotation API to warn when some names will change between Chisel 3.5 and 3.6.
Backend Code Generation Impact
No impact
Desired Merge Strategy
Release Notes
Add
--warn:reflective-naming
to enable a warning that indicates when the name of some value in the hardware will change in the migration from Chisel 3.5 to 3.6.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
.