dbSta: make get_nets glob patterns find hierarchical nets#10939
Conversation
In a hierarchical netlist, get_nets with a wildcard returned nothing for nets inside hierarchical instances while the exact same name without a wildcard resolved, and get_pins/get_cells globs worked. dbSdcNetwork::findNetsMatching1 matched patterns against top-scope net names only. Hierarchical net names are module-local, so a pattern containing a divider can never match. Split the pattern at the last divider and search the scope of matching instances, mirroring findPinsMatching; keep the top-scope scan for flat names that contain dividers. dbNetwork::findInstNetsMatching ignored non-top instances, which also broke get_nets -hierarchical. Enumerate through netIterator; exact lookups stay on findNet. The get_nets1_hier test checks glob/exact agreement per scope, the -hierarchical variants, and a get_pins control on the hier1.v fixture. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
There was a problem hiding this comment.
Code Review
This pull request adds support for finding nets inside hierarchical instances using glob and exact matching. Specifically, dbNetwork::findInstNetsMatching was refactored to support any instance rather than being restricted to the top instance, and dbSdcNetwork::findNetsMatching1 was updated to handle hierarchical paths in net patterns. A new integration test get_nets1_hier was also added to verify these changes. There are no review comments, so no feedback is provided.
|
@dsengupta0628 @maliberty Heads up! I don't know what I'm doing here, but the use-case is to reduce Claude token usage... This is a yak-shave by Claude because it spent a lot of time finding a signal and it thinks the root cause is this issue it fixed here. The change was so small, that I think someone who knows what is going on here will be able to see if Claude is right here. |
In a hierarchical netlist, get_nets with a wildcard returned nothing
for nets inside hierarchical instances while the exact same name
without a wildcard resolved, and get_pins/get_cells globs worked.
dbSdcNetwork::findNetsMatching1 matched patterns against top-scope net
names only. Hierarchical net names are module-local, so a pattern
containing a divider can never match. Split the pattern at the last
divider and search the scope of matching instances, mirroring
findPinsMatching; keep the top-scope scan for flat names that contain
dividers.
dbNetwork::findInstNetsMatching ignored non-top instances, which also
broke get_nets -hierarchical. Enumerate through netIterator; exact
lookups stay on findNet.
The get_nets1_hier test checks glob/exact agreement per scope, the
-hierarchical variants, and a get_pins control on the hier1.v fixture.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Signed-off-by: Øyvind Harboe oyvind.harboe@zylin.com