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] Ensure hierpath considers owning module in LowerClasses. #7272

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

mikeurbach
Copy link
Contributor

We already had logic to detect if the owning module was in the middle of a hierarchical path, and build up the prefix just to the owning module in this case. However, we still used the entire original hierarchical path in the new path, which caused the prefix to the owning module to be duplicated. This is fixed by not only setting the moduleName to the owning module, but also trimming the prefix to the owning module in the original path.

We already had logic to detect if the owning module was in the middle
of a hierarchical path, and build up the prefix just to the owning
module in this case. However, we still used the entire original
hierarchical path in the new path, which caused the prefix to the
owning module to be duplicated. This is fixed by not only setting the
moduleName to the owning module, but also trimming the prefix to the
owning module in the original path.
@mikeurbach
Copy link
Contributor Author

I'm gonna go ahead and merge this, but happy to incorporate any post-commit review. It's unfortunately not something you can catch until you actually run the evaluator and the basepaths are concatenated with the hierarchical paths. But I've tested this on several downstream designs and it seems to be behaving correctly now. I also think the risk of this accidentally regressing something and creating invalid hierpath ops is low--in the case that changed, we were already not prefixing anything to the path, the difference is we now also snip off the extra prefix.

@mikeurbach mikeurbach merged commit f6ee408 into main Jul 2, 2024
4 checks passed
@mikeurbach mikeurbach deleted the mikeurbach/lower-classes-owning-module-hierpath branch July 2, 2024 21: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

1 participant