Skip to content

GRT: improved NDR resources management during Fast Route incremental routing#10455

Open
openroad-ci wants to merge 16 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-incr-congestion-fix
Open

GRT: improved NDR resources management during Fast Route incremental routing#10455
openroad-ci wants to merge 16 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-incr-congestion-fix

Conversation

@openroad-ci
Copy link
Copy Markdown
Collaborator

Summary

Nets with NDR can have different edge costs depending on the metal layer (3D). In this example for the sky130hd/hs PDK, the 2D edge cost is always 2 but the 3D edge cost varies from 1 to 2 for NDR nets.

Net: clk NDR cost in met1: 2  Edge cost: 2
Net: clk NDR cost in met2: 1  Edge cost: 2
Net: clk NDR cost in met3: 2  Edge cost: 2
Net: clk NDR cost in met4: 1  Edge cost: 2
Net: clk NDR cost in met5: 2  Edge cost: 2

The MazeRoute3D can create routes that are only possible during the 3D stage.
During incremental routing, the initial 2D state is already congested due to the NDR higher edge cost.
If FastRoute can't solve congestion, it triggers a 2D congestion error (even if 3D finds a solution).

Main Features

1. Soft NDR on 2D-3D congestion mismatch

  • Instead of checking 2D overflow, checks 3D congestion for a more accurate signal during updateDirtyRoutes
  • Disables NDR (demotes to soft-NDR, edge_cost = 1) for nets where the 2D vs 3D usage is mismatched at the end of FastRoute run
  • Skips clock nets when rerouting nets involved in congestion to protect timing

2. NDR soft-disable when repair_antennas starts uninitialized

When repair_antennas starts from a state where GRT was never run (guides loaded directly from ODB):

  • Fixes a uint16_t underflow bug caused by mismatched 3D add/release paths (areSegmentsRestored not set)
  • Applies soft-NDR to nets occupying congested 2D edges using routes_ segments (real coords) instead of sttrees_ (which are empty in this flow), via the new disableCongestedNDRNetsFromRoutes / disableNDRNetsFromGridRoutes functions

3. Regression test loading guides from ODB for repair_antennas

  • This is the first test to evaluate the execution of incremental routing starting from an uninitialized state.
  • It would be interesting to include more tests like this in the future.

Type of Change

  • Bug fix
  • Improvements

Impact

Don't throw errors on false routing congestion (check for 3D route congestion).
Apply soft NDR to solve congestion during incremental routing.

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 signed my commits (DCO).

Related Issues

Underflow error after antenna repair

jfgava added 8 commits May 14, 2026 23:41
…match between 2D vs 3D at the end of the FastRoute run. Skip clock nets when rerouting nets involved in congestion

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
…ted to NDR nets

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
@openroad-ci openroad-ci requested review from a team as code owners May 18, 2026 22:55
@openroad-ci openroad-ci requested review from jfgava and maliberty May 18, 2026 22:55
Copy link
Copy Markdown
Contributor

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

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 enhances the global router's ability to handle Non-Default Rule (NDR) nets during antenna repair, specifically when starting from ODB guides where Steiner trees are not yet initialized. It introduces logic to demote NDR nets to soft NDR (unit edge cost) if they pass through congested 2D edges, ensuring resource usage is correctly tracked in both 2D and 3D stages. Feedback focuses on improving the robustness of grid index calculations and segment traversal to prevent potential out-of-bounds accesses and to correctly ignore via transitions during congestion checks.

Comment thread src/grt/src/GlobalRouter.cpp Outdated
Comment thread src/grt/src/fastroute/src/FastRoute.cpp Outdated
Comment thread src/grt/src/fastroute/src/FastRoute.cpp
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus eder-matheus requested review from eder-matheus and removed request for jfgava May 18, 2026 23:36
@maliberty
Copy link
Copy Markdown
Member

Please explain how "Nets with NDR can have different edge costs depending on the metal layer (3D)."

@eder-matheus
Copy link
Copy Markdown
Member

Please explain how "Nets with NDR can have different edge costs depending on the metal layer (3D)."

I'm not sure how common it is, but the create_ndr allows the user to set per-layer width and spacing values. So we can have an NDR that changes only a subset of the routing layers (e.g., changing the spacing of metal2, metal3 and metal4) while preserving the rules for the other layers.

We can also define different width/spacing ratios per layer. So we can have some metal layers with 2x the cost, while other layers with 3x, for example.

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
@jfgava
Copy link
Copy Markdown
Contributor

jfgava commented May 19, 2026

@maliberty @eder-matheus I just found a bug in CTS when processing the spacing value to calculate NDR spacing. We are picking the wrong value for some layers on sky130... Other public and private PDKs were not affected.
I'll run a CI to evaluate the impact on sky130 designs... The edge cost will be 2 for 2D and 3D edges (more congestion).
But note that this issue with different edge cost can still occur with different NDRs (more spacing and width). I'll make a new unit test for this

Comment thread src/grt/src/fastroute/src/FastRoute.cpp Outdated
@maliberty
Copy link
Copy Markdown
Member

I think such NDRs are uncommon but at least I understand the issue. Usually people just say something like double-spacing for all layers. This is a case where doing it in 3d would win as you could cost each 3d edge differently.

jfgava added 3 commits May 26, 2026 16:23
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
@openroad-ci openroad-ci requested a review from a team as a code owner May 26, 2026 18:58
@openroad-ci openroad-ci requested a review from arthurjolo May 26, 2026 18:58
@jfgava jfgava requested a review from a team May 26, 2026 18:58
@jfgava jfgava requested review from a team and jfgava and removed request for a team May 26, 2026 18:58
@github-actions github-actions Bot added size/XL and removed size/L labels May 26, 2026
jfgava added 3 commits May 27, 2026 21:13
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
@github-actions github-actions Bot added size/L and removed size/XL labels May 30, 2026
@jfgava jfgava requested a review from eder-matheus June 1, 2026 20:07
@maliberty
Copy link
Copy Markdown
Member

Merge?

@eder-matheus
Copy link
Copy Markdown
Member

Merge?

Not yet. Jonas is checking CI one last time before merging it.

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.

4 participants