Skip to content

grt: reroute CUGR nets in slack-last, largest-first order - #12090

Merged
maliberty merged 4 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:cugr-reroute-order
Nov 3, 2026
Merged

maliberty merged 4 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:cugr-reroute-order

Conversation

@maliberty

Copy link
Copy Markdown
Member

Summary

The CUGR detour and maze stages reroute one net at a time against every other routed net. They sorted nets by slack and then by ascending bounding box. As a result, critical nets and two-pin local nets moved off congested edges first, while the larger nets that caused the congestion kept their routes. The small nets took long detours (up to 20× their bounding box) that detailed routing did not follow. This widened the gap between global and detailed routing parasitics.

The ascending order comes from the original CUGR, which rips up every selected net before rerouting any of them. In that scheme, routing order only decides who claims freed capacity first. #11829 switched to a remove/route/add transaction per net but kept the ascending order. The slack-first order came later.

These stages now reroute non-critical nets first, largest bounding box first, and critical nets last, worst slack last. A net routed later sees the capacity that earlier nets vacated, and the critical nets get the final choice. Stage-1 pattern routing and the resistance-aware order are unchanged.

Results

ORFS, starting from global routing with CUGR, clock period scaled by 0.990–1.010 (9 runs per design). Achieved period as % of the target clock period, mean / spread:

design FastRoute CUGR before CUGR after
sky130hd/aes 104.6 / 2.5 117.2 / 32.2 106.9 / 7.9
sky130hd/ibex 104.8 / 1.3 108.0 / 4.1 106.2 / 5.8
nangate45/aes 101.9 / 0.0 108.9 / 5.7 103.9 / 0.7
asap7/aes 101.7 / 2.7 102.7 / 2.2 unchanged (resistance-aware)

In global routing alone on sky130hd/aes, nets routed longer than 2× their FastRoute length drop from 552 to 95. Global routing time drops from 8 s to 6 s. The 12 updated CUGR goldens show lower congestion and fewer vias. Wirelength is lower in all of them except pin_access2_cugr (+0.7%).

@maliberty maliberty self-assigned this Nov 1, 2026
@github-actions github-actions Bot added the size/S label Nov 1, 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 a new net sorting strategy, sortRerouteIndices, for rerouting passes in the CUGR global router. This strategy prioritizes non-critical nets with larger bounding boxes to improve routing capacity and congestion. The sortForReroute method was added to provide a unified interface for selecting the appropriate sorting strategy. Test outputs have been updated to reflect the resulting improvements in routing quality. A critical issue regarding strict weak ordering in the sorting comparator was identified and requires correction.

Comment thread src/grt/src/cugr/src/CUGR.cpp Resolved
The detour and maze stages reroute one net at a time against every
other routed net. They sorted by slack and then by ascending bounding
box, so critical nets and two-pin local nets moved off congested edges
first, and the larger nets that caused the congestion kept their
routes. Small nets then took long detours that detailed routing did
not follow.

These stages now order non-critical nets first, largest bounding box
first, and critical nets last, worst slack last. A net routed later
sees the capacity that earlier nets vacated. The resistance-aware
order is unchanged when it is enabled.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Drop "sorts last" from the demoted-slack comment and debug message;
the reroute stages now put demoted nets first.

repair_antennas_only_diodes_cugr needs three diode passes to reach zero
violations: the incremental reroute after each insertion leaves new
violations on a high-fanout net. Run three iterations so the golden
records a complete repair.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Incremental reroutes follow netlist edits, such as inserted diodes or
buffers, rather than congestion, and skip non-critical demotion, so the
largest-first order has no basis there. Rerouting high-fanout nets
first also made each diode pass rebuild a large net's tree and create
new violations: repair_antennas_only_diodes_cugr needed three passes
to converge.

Incremental reroutes now keep the previous order. The diode test is
back to its original two iterations and reaches zero violations.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
The net-index comparators returned false whenever either net was null,
so a removed net compared equivalent to every live net. That is not a
strict weak ordering, which stable_sort requires. A shared helper now
sorts null nets last and compares the rest with each sort's key.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty
maliberty marked this pull request as ready for review November 3, 2026 16:32
@maliberty
maliberty requested a review from a team as a code owner November 3, 2026 16:32
@maliberty
maliberty requested a review from jfgava November 3, 2026 16:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T16:32:25.793313Z
We couldn’t complete this review. Comment @codex review to try again.
55fc85f Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@maliberty
maliberty merged commit 00efd02 into The-OpenROAD-Project:master Nov 3, 2026
18 of 20 checks passed
@maliberty
maliberty deleted the cugr-reroute-order branch November 3, 2026 16:32
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