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] Disambiguate paths when possible in ResolvePaths. #6937

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

mikeurbach
Copy link
Contributor

We would previously error if paths are contained in multiply instantiated modules, because there is no unique path in this case. However, we could expand out the path into multiple unique paths in this case, but this is only safe to do if the path is already used in a list where multiple paths are acceptable.

This relaxes the requirement and implements the path expansion in this scenario. When we hit a multiply instantiated module, we expand out all the instance paths to that module from the owning module, and create multiple annotations and resolved paths.

We would previously error if paths are contained in multiply
instantiated modules, because there is no unique path in this
case. However, we could expand out the path into multiple unique paths
in this case, but this is only safe to do if the path is already used
in a list where multiple paths are acceptable.

This relaxes the requirement and implements the path expansion in this
scenario. When we hit a multiply instantiated module, we expand out
all the instance paths to that module from the owning module, and
create multiple annotations and resolved paths.
@mikeurbach
Copy link
Contributor Author

It helps slightly to review this with whitespace-only diffs removed.

Copy link
Contributor

@prithayan prithayan left a comment

Choose a reason for hiding this comment

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

Looks good.

@mikeurbach mikeurbach merged commit b12695a into main Apr 19, 2024
4 checks passed
@mikeurbach mikeurbach deleted the mikeurbach/resolve-paths-disambiguate branch April 19, 2024 22:39
@mikeurbach
Copy link
Contributor Author

Thanks @prithayan!

cepheus69 pushed a commit to cepheus69/circt that referenced this pull request Apr 22, 2024
We would previously error if paths are contained in multiply
instantiated modules, because there is no unique path in this
case. However, we could expand out the path into multiple unique paths
in this case, but this is only safe to do if the path is already used
in a list where multiple paths are acceptable.

This relaxes the requirement and implements the path expansion in this
scenario. When we hit a multiply instantiated module, we expand out
all the instance paths to that module from the owning module, and
create multiple annotations and resolved paths.
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