code and regression#10241
Conversation
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request optimizes hierarchical instance matching in dbSdcNetwork::findInstancesMatching1 by implementing prefix pruning. The search now identifies the deepest literal prefix in a pattern to anchor the depth-first search at a specific sub-instance rather than the design root, which improves performance for non-regex patterns. A new test case, sdc_hier_wildcard, has been added to verify this logic against various wildcard scenarios. I have no feedback to provide as there were no review comments.
|
clang-tidy review says "All clean, LGTM! 👍" |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request optimizes hierarchical instance matching in dbSdcNetwork::findInstancesMatching1 by anchoring the depth-first search at the deepest literal prefix of the pattern. This optimization avoids traversing the entire design hierarchy when a specific prefix is provided. Additionally, a new test case sdc_hier_wildcard was added to verify the logic. I have no feedback to provide.
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
Summary
dbSdcNetwork::findInstancesMatching1traverses the entire designhierarchy for every wildcard pattern, matching each instance's full
path against the pattern. On hierarchical loads with millions of
instances, a single
read_sdccontaining ~100k constraints likeset_false_path -from [get_cells cpu/core0/icache/*_reg]performsO(patterns x insts) work -- tens of minutes to hours to read an SDC
that other tools load in seconds.
Anchor the DFS at the deepest literal path prefix before any
wildcard. For
cpu/core0/icache/*_regwe resolvecpu/core0/icachevia the existing
findInstance()hash (which already covers dividerand bracket escape variants) and only DFS under that subtree.
Patterns with a leading wildcard (
*/clk) are unchanged.Correctness
path_bufferis seeded with theliteral prefix, so
pattern->match()still sees the fullhierarchical name.
/is a literal segment boundary under regex).
pathEscape()so escaped dividers in a prefixdon't misanchor.
read_def) can have leaf names likeb1/r1with embedded dividers where no instance
b1exists -- theoptimization only anchors when the resolved prefix is non-leaf,
otherwise falls through to the legacy unanchored DFS. Caught by
the existing
sdc_names1test during development.Type of Change
Impact
read_sdcon customer design with ~6M instances and~100k constraints: hours -> seconds.
dbStaregressions continue to pass.Verification
./etc/Build.sh).Related Issues
Reported slowdown on hierarchical SDC load for 6M-instance design.