grt: fix CUGR min routing layer index#10421
Merged
eder-matheus merged 4 commits intoMay 13, 2026
Merged
Conversation
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Contributor
There was a problem hiding this comment.
Code Review
This pull request adjusts layer indexing within the CUGR routing engine by subtracting 1 from routing layer constants and ranges in CUGR.cpp and Design.cpp. These changes significantly impact routing results across various test cases, generally leading to reduced via counts and altered layer demand. Feedback was provided regarding a potential bug in Design.cpp::updateNet, where the absence of clock layer constraints could result in an invalid negative layer index; it is recommended to implement a check consistent with the logic in readNetlist to ensure indices remain valid.
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
jfgava
approved these changes
May 13, 2026
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
52e5336
into
The-OpenROAD-Project:master
15 of 16 checks passed
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.
Summary
Fix two layer-indexing off-by-one bugs in CUGR that caused the lowest routing layer to be silently excluded.
src/grt/src/cugr/src/Design.cpp(lines 88-93 and 166-167) —Design::min/max_routing_layer_hold 1-based ODB routing levels, butGRNet::layer_range_is compared against 0-based grid-graph indices inisInsideLayerRange. The clock-net branch already did the conversion; the signal-net branch did not. Subtract 1 to match.src/grt/src/cugr/src/CUGR.cpp(line 85) —Constants::min_routing_layer(0-based) was never synced with the user's min routing layer, so pin patches, wire patches, and PatternRoute floors fell back to M2 regardless of input.Type of Change
Impact
For the default OpenROAD flow (
min_routing_layer = metal2), CUGR previously excluded metal2 from signal routing. Restoring it on the defaultcugr_adjustment3test:For tests that explicitly set
-signal met1-..., met1 is now actually used.pin_access2_cugroverflow drops 2 → 0;critical_nets_percentage_cugroverflow drops 400 → 120. Every affected CUGR test improves or stays flat on QoR; no regressions.Verification
./etc/Build.sh).Related Issues
None.