Skip to content

grt/cugr: implement resistance-aware stage and resistance costs during congestion handling#10759

Open
eder-matheus wants to merge 23 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt_cugr_res_aware_stage
Open

grt/cugr: implement resistance-aware stage and resistance costs during congestion handling#10759
eder-matheus wants to merge 23 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt_cugr_res_aware_stage

Conversation

@eder-matheus

Copy link
Copy Markdown
Member

Summary

Adds resistance-aware global routing to the CUGR engine. With -resistance_aware
and a non-zero -critical_nets_percentage, timing-critical nets are biased onto
lower-resistance upper-metal layers to improve post-route timing.

Mechanism:

  • Layer sheet/via resistance plumbed from the tech DB into the CUGR cost model.
  • Critical-net selection mirroring FastRoute's updateSlacks (clock/NDR always;
    short/single-pin/positive-slack excluded; rest ranked by a multi-factor
    slack/resistance/fanout/length score). The set accumulates across passes.
  • A new "Stage 2" resistance-aware re-route that, after the neutral first pattern
    route, re-routes the critical set on real per-net tree resistance.
  • A wire/via resistance cost term in PatternRoute, applied only to res-aware nets.
  • A congestion resource gate that biases full edges toward climbing vias.
  • Optional debug dumps via -debug_level GRT resAware <1|2>.

Type of Change

  • New feature

Impact

  • New opt-in routing behavior; inert unless -resistance_aware is set with a
    non-zero -critical_nets_percentage.
  • Default critical_nets_percentage for CUGR changed 0 -> 10.
  • CUGR guides are no longer flagged congested (DRT resolves them), removing
    spurious congestion warnings on the CUGR path.
  • New warning GRT-0309 when timing is unavailable and the critical-net
    percentage is forced to 0 (matches the FastRoute path).
  • Several existing CUGR test goldens shift due to the default change, stage
    renumbering, and the new logs.

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have included tests to prevent regressions.
  • I have signed my commits (DCO).

Related Issues

None.

Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
… strategy

Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
…e edges

Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
@eder-matheus eder-matheus self-assigned this Jun 26, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces resistance-aware global routing to the CUGR engine, enabling the biasing of critical nets onto lower-resistance upper metal layers to improve timing. It adds support for calculating net resistance, scoring nets based on slack, resistance, fanout, and length, and re-routing critical nets in a new stage. Additionally, a congestion gate penalty is introduced to bias vias upward when edges are full. Feedback on these changes highlights three critical issues: a logic bug in markResAwareNets that incorrectly skips short or positive-slack clock and NDR nets, a missing null check in the res_aware_order sorting comparator that could lead to segmentation faults, and a missing null check on sta_ in initCUGR that could cause crashes when STA is uninitialized.

Comment thread src/grt/src/cugr/src/CUGR.cpp
Comment thread src/grt/src/cugr/src/CUGR.cpp
Comment thread src/grt/src/GlobalRouter.cpp
@eder-matheus

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27cd0dc034

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/grt/src/cugr/include/CUGR.h Outdated
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
@eder-matheus eder-matheus marked this pull request as ready for review June 26, 2026 13:46
@eder-matheus eder-matheus requested a review from a team as a code owner June 26, 2026 13:46
@eder-matheus eder-matheus requested a review from jfgava June 26, 2026 13:46
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
@eder-matheus

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: da1dbdca96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant