[FIRRTL] Use hw.hierpath in CreateSiFiveMetadata#9829
Merged
Conversation
uenoku
reviewed
Mar 5, 2026
uenoku
reviewed
Mar 5, 2026
ace8bd5 to
e39a473
Compare
uenoku
reviewed
Mar 5, 2026
uenoku
reviewed
Mar 5, 2026
a25d593 to
95f2c78
Compare
Add a utility function isInstanceUnderLayer to check if an instance should be excluded from metadata emission and other analyses. An instance is considered "under a layer" if it: - is under a LayerBlockOp, - is under an sv::IfDefOp, - has getLowerToBind() set, - or Has getDoNotPrint() set. AI-assisted-by: Augment (Claude Sonnet 4.5) Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
…archy
Replace explicit {{0}}.{{1}}.{{2}}... paths with hierpath-based triplet
format {{<root>}}.{{<path>}}.{{<leaf>}} where:
- <root> is the DUT module symbol
- <path> is an optional hw.hierpath from root to the final instance
- <leaf> is the final instance name
This makes the hierarchy paths resilient to hierarchy manipulations
applied after this pass, as hierpaths are resolved during lowering.
AI-assisted-by: Augment (Claude Sonnet 4.5)
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
95f2c78 to
cd30463
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change the
CreateSiFiveMetadatapass to usehw.hierpathoperations toencode memory paths making this robust to hierarchical transformations
like
ModuleInliner.Previously, these used paths encoded in verbatims, like so:
This changes this to encode the interior part of the path with an
hw.hierpathoperation, like so:This is not perfect as it still has the root module and leaf memory
encoded using this strategy. However, it fixes an observed failure when
trying to use the
--inline-input-only-modulesoption.