-
Notifications
You must be signed in to change notification settings - Fork 602
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 .toRelativeTargetToHierarchy #4067
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 taking this up. I think this is what we wanted here, because I started trying to detect if I was "inside a Definition" from the existing .toRelativeTarget API and that wasn't even really a well formed question. I'll take a deeper look at this but in general +1 from me.
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!
*/ | ||
def toRelativeTarget(root: Option[BaseModule]): IsModule = d.proto.toRelativeTarget(root) | ||
|
||
/** If this is an instance of a Module, returns the toAbsoluteTarget of this instance |
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.
by the way @mikeurbach @azidar are these scaladoc comments intentionally wrong? I guess a toRelativeTarget for a definition is always going to be an absoluteTarget, but is this just a copy-paste weirdness that I am perpetuating
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.
I think these comments have been here since before I started contributing to Chisel, but maybe we can at least update the new ones?
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.
i will clean these up more comprehenstively in a follow-up
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.
oh wait I added these comments 😂 sorry for the noise.
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.
I think this makes sense, definitely seems better than the hacky thing I was trying as evidenced by the various positive/negative test scenarios.
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Add .toRelativeTargetToHierarchy for getting .toRelativeTarget functionality when the root is a Definition or Instance.
Reviewer Checklist (only modified by reviewer)
3.6.x
,5.x
, or6.x
depending on impact, API modification or big change:7.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.