Skip to content
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

Merged
merged 4 commits into from
Oct 2, 2023

Conversation

darthscsi
Copy link
Contributor

No description provided.

@darthscsi darthscsi marked this pull request as ready for review September 29, 2023 21:36
Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool 😎

Copy link
Contributor

@dtzSiFive dtzSiFive left a 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),
Copy link
Contributor

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
; 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
; 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));
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@darthscsi darthscsi merged commit 933d248 into main Oct 2, 2023
5 checks passed
mikeurbach pushed a commit that referenced this pull request Oct 2, 2023
Move lower to hw to preserve port order instead of doing inputs then outputs.
@darthscsi darthscsi deleted the dev/darthscsi/firportorder branch April 11, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants