[FIRRTL] Simplify path handling in ResolvePaths and LowerClasses. #7129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This turns the multiple-instantiation error into a warning in ResolvePaths and LowerClasses. In real designs coming from Chisel today, we are not yet able to enforce single instantiation. This was never a requirement of the original way that we handled hierarchical paths in EmitOMIR, so this removes the requirement for now. Adding it back is tracked in #7128.
With this change, the ResolvePaths logic was simplified to stop trying to disambiguate paths in some cases, and instead allow the annotations to simply convey the user's requested local or hierarchical path. In LowerClasses, if there are multiple instances, this means we have ambiguity. In practice, this logic will produce the same outputs as EmitOMIR, once we fix #7125.