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] Update NLA during prefix module pass #2030

Merged
merged 2 commits into from
Oct 24, 2021

Conversation

prithayan
Copy link
Contributor

This change updates the NonLocalAnchor symbol reference to modules that are renamed in prefix module pass.
The nla op contains reference to module symbols, which might be left invalid after module renaming.
firrtl.nla @nla_2 [@Top, @Aardvark, @Zebra] ["test", "test", "Zebra"]

There can be multiple copies of any module created after the prefix module pass.
The firrtl.nla renaming is context sensitive and depends on the instance op, which is anchored to the nla.

This renaming is also based on the assumption, that the modules in the firrtl.nla begin with the top level module.
Otherwise, the firrtl.nla might be ambiguous if multiple clones of the first module is created.

This change is required for OMIR emission, since prefix module pass leaves the tracker firrtl.nla in invalid state.

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

Awesome. Thanks for taking care of this, Prithayan!

lib/Dialect/FIRRTL/Transforms/PrefixModules.cpp Outdated Show resolved Hide resolved
@prithayan
Copy link
Contributor Author

Thanks @seldridge , Fixed the loop to iterate once over the annotations.

@prithayan prithayan merged commit 04fb49d into llvm:main Oct 24, 2021
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.

2 participants