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] Print port names attributes if a port has an empty name #7688

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

rwy7
Copy link
Contributor

@rwy7 rwy7 commented Oct 9, 2024

If a port name is empty, then the SSA-name cannot match, and we must print the port names as an attribute instead. This PR removes a bogus check in the module printer, which prevents us from printing the port names attribute, if the port name is empty.

With this PR, modules with empty port names should round trip correctly.

When lower-layers converts layerblocks into modules, a lot of the time there is no good name for the port, so it generates an empty port name. With this patch, these modules will now correctly print the port names attribute, so the tests had to be updated to match against the attribute dictionary.

Fixes: #7224

Copy link
Member

@youngar youngar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

Nice!

@dtzSiFive
Copy link
Contributor

Awesome, thanks!

@rwy7 rwy7 merged commit 5f62873 into llvm:main Oct 9, 2024
4 checks passed
@rwy7 rwy7 deleted the fix-empty-module-port-name branch October 9, 2024 23:15
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.

[FIRRTL] LowerLayers creates empty port names, preventing round-trip
4 participants