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][HW] Replace ModuleNamespace with InnerSymbol one. #5819

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

dtzSiFive
Copy link
Contributor

Combine identical "ModuleNamespaces" into a new common one
for anything with inner symbols.

First step towards dropping use of a "Namespace" for generating
inner symbols entirely, once other pieces are in place.

Also sets the stage for moving the utility functions that help
create inner symbols and inner refs out of FIRRTL.

NFCI.

@dtzSiFive
Copy link
Contributor Author

dtzSiFive commented Aug 9, 2023

Draft until #5812 lands, since includes that PR to fixup/drop use of FIRRTL's ModuleNamespace to remember the inlining context's root FModuleOp.

@dtzSiFive
Copy link
Contributor Author

FWIW: A Namespace or so that walks FNameable's/port names ("name" attribute) seems reasonable and would be useful for #5721 #5727 . Annotation lowering code basically does this presently to resolve targets.

Combine identical "ModuleNamespaces" into a new common one
for anything with inner symbols.

First step towards dropping use of a "Namespace" for generating
inner symbols entirely, once other pieces are in place.

Also sets the stage for moving the utility functions that help
create inner symbols and inner refs out of FIRRTL.

NFCI.
@dtzSiFive dtzSiFive marked this pull request as ready for review August 10, 2023 13:45
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.

Nice cleanup!

With the removal of the original ModuleNamespace this is clearly moving in a direction of inner symbols are unique, but names within a module are not unique in FIRRTL dialect. This is fine and reasonable. This will have some consequences as you've seen before with port uniqueness.

Comment on lines +116 to +117
using GetNamespaceCallback =
llvm::function_ref<hw::InnerSymbolNamespace &(FModuleLike mod)>;
Copy link
Member

Choose a reason for hiding this comment

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

Good use of an alias here to keep the function signatures tighter. 👍

lib/Dialect/FIRRTL/FIRRTLReductions.cpp Show resolved Hide resolved
lib/Dialect/FIRRTL/Transforms/LowerGroups.cpp Show resolved Hide resolved
@dtzSiFive dtzSiFive merged commit 5bb2f20 into llvm:main Aug 10, 2023
5 checks passed
@dtzSiFive dtzSiFive deleted the feature/innersym-namespace branch August 10, 2023 20:40
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.

None yet

2 participants