Repository navigation
Conversation
There was a problem hiding this comment.
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.
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>
14d76d7 to
55fc85f
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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:
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%).