-
Notifications
You must be signed in to change notification settings - Fork 298
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
[FIRRTL] Preserve port orders when lowering to HW. #6224
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.
Very cool 😎
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! Awesome that in the end this change is all that's needed to flip over!
- Looks like this is more of an HW change than FIRRTL, changes builder helper to no longer group inputs then outputs?
- This seems worth having an explicit test for (not just implicit testing via tests for other things). A small direct one would be great.
; NOREFS-NEXT: .R7_data (memTap_1), | ||
; NOREFS-NEXT: .R8_data (memTap_0) | ||
; NOREFS-NEXT: ) | ||
; NOREFS: .R2_data (memTap_6), |
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.
Please add whitespace (5 spaces) to restore the alignment.
Interesting, these are interleaved now! 🤔 .
@@ -246,11 +246,13 @@ circuit TestHarness : %[[ | |||
; CHECK: module Top( | |||
; CHECK-NOT: endmodule | |||
; CHECK: Companion Companion ( | |||
; CHECK: .io (io), |
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.
; CHECK: .io (io), | |
; CHECK-NEXT: .io (io), |
; CHECK-NEXT: .[[bore:[a-zA-Z0-9_]+]] (Top.test.signal_probe) | ||
; CHECK: endmodule | ||
|
||
; CHECK: module Companion( | ||
; CHECK-NOT: endmodule | ||
; CHECK: output io, |
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.
; CHECK: output io, | |
; CHECK-NEXT: output io, |
return updatedName.cast<StringAttr>().getValue(); | ||
// Get the original name of input port if no renaming. | ||
return cast<HWModuleLike>(module).getPortName(portArgNum); | ||
return getPortVerilogName(module, htmo.getPortList().atInput(portArgNum)); |
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 this just access both of them via PortList
interface? getPortVerilogName(module, cast<PortList>(module).getPortList().atInput(portArgNum))
or so?
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.
This function should be going away soon.
Move lower to hw to preserve port order instead of doing inputs then outputs.
No description provided.