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] Prefix for Seq Mem Group Extract #4596

Closed
wants to merge 0 commits into from

Conversation

seldridge
Copy link
Member

Fix a bug in the composition of the PrefixModules and ExtractInstances passes. Because the latter can generate modules with new names when using the grouping feature, this module needs a prefix and does not currently get one. Change the PrefixModules pass to add a wildcat attribute "prefix" to the DUT annotation. This prefix is then used by ExtractInstances to properly generate the module name.

This is a variant of the solution used for the GrandCentral pass where the companion module annotation is given a wildcat attribute that stores the prefix which is then used by the pass.

A better solution would be to reorder PrefixModules after ExtractInstances. However, this has complications with verbatim metadata emission and the possibility of PrefixModules manipulating the hierarchy (duplicating modules to resolve non-local prefixes). There is more discussion about this on the #4593.

Fixes #4593.

Signed-off-by: Schuyler Eldridge schuyler.eldridge@sifive.com

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.

LGTM! I think this is a good fix given the current pass ordering.

It makes me sad that we have can have verbatim placeholders for module/instance names, but we have to prescribed the exact number of placeholders for the different levels of hierarchy. It feels like we want something like a #hw.hierpath.sv<@foo::@bar> or #hw.hierpath.sdc<@foo::@bar> attribute that would expand to an SV-style or SDC-style (or any others we cook up) hierarchical path in the output. That way we could do hierarchy transformations and have the output of the verbatims reflect them.

@seldridge
Copy link
Member Author

The XMRRefOp has some of those features. You just give it a symbol which references a #hw.hierpath op and it will resolve it to the path encoded by that. Maybe that should be extended to work for verbatims? (In the future...)

@seldridge
Copy link
Member Author

Landed in 092cb81.

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] PrefixModules and ExtractInstances Interactions
2 participants