Repository navigation
grt: enhance FastRoute NDR handling - #11963
osamahammad21 merged 24 commits into
Conversation
When no layer of an edge could host an NDR net, getCostNDRAware added 100 times the net's edge cost to the shared 2D usage, and every later NDR net on that edge was charged the same, even when it fit. All nets then saw the edge as overflowed although it still had room for regular nets, the overflow iterations chased overflow that did not exist, and the inflated usage could exceed the usage limit (GRT-0228 on nangate45/mempool_group). The shared usage now gets the true edge cost. The tracks an NDR net misses on its best layer are recorded as its NDR deficit on the edge, and only the NDR nets see it: - NDR nets price an edge with a deficit, in the maze and pattern routing costs, as overflowed by kNdrDeficitCost (100) tracks per missing track. The NDR nets on an edge share its deficit, so the one that fits can also move away. - NDR nets are ripped up from edges with a deficit. - The 2D overflow counts the deficits, and the NDR fallback after layer assignment also triggers when one is left. - StNetOrder counts the deficit of an NDR net in its overflow, and saturates the int16 key instead of wrapping. initNDRnets now clears the NDR records of the previous run: resize keeps them on a same-sized grid, and a new net allocated at the address of a deleted one was taken for a net already using the edge. The unused net name copy is removed from getCostNDRAware. Golden updates: - ndr_1w_3s: wirelength 1684 -> 1663 um, vias 206 -> 211 - soft_ndr_4w_6s: wirelength 1850 -> 1756 um, vias 198 -> 195 - soft_ndr_escalation: wirelength 1814 -> 1872 um, vias 202 -> 199. The NDR nets are demoted at the iteration limit instead of on stagnation, since the overflow keeps improving. Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Replacing the NDR overflow multiplier with NDR deficits changes the global routes of jpeg_sky130hd and jpeg_sky130hs, and the antenna repair after detailed routing leaves one more violation in each: 0 -> 1 and 1 -> 2. The violations are on regular signal nets (met1 side area ratio), not on NDR nets. Timing otherwise holds (DRT WNS -0.481 -> -0.423 ns and -0.371 -> -0.363 ns), and every other limit is still met, so only the DRT::ANT::errors limits are raised. Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
…ROAD into grt-update-fr-ndr-handling
…ROAD into grt-update-fr-ndr-handling
…ROAD into grt-update-fr-ndr-handling
Limits from the flow_metrics.tcl formulas on this branch's results: clock skew 0.392 -> limit 0.470, antenna errors 1. Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
…ROAD into grt-update-fr-ndr-handling
There was a problem hiding this comment.
Code Review
This pull request introduces the concept of NDR deficits to track and price Non-Default Routing (NDR) nets that cannot fit on any single layer of an edge, separating deficits from edge usage and integrating them into routing costs, rip-up checks, and net ordering. Feedback on these changes highlights two key improvements: first, in Graph2D::initNDRnets(), the multi-arrays should be resized before calling clearNDRnets() to prevent potential out-of-bounds accesses when grid dimensions change; second, in getUsageNDRAware(), using edge-specific capacities via getEdgeCapacity() instead of nominal global capacities would more accurately represent congestion on edges with reduced capacity.
…ROAD into grt-update-fr-ndr-handling
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Regenerate the soft_ndr_4w_6s and soft_ndr_escalation goldens for the per-edge capacity in getUsageNDRAware, and add a unit test that pins the price of a reduced edge. Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
…ROAD into grt-update-fr-ndr-handling
…ROAD into grt-update-fr-ndr-handling
When a net leaves an edge, re-reserve the layers of the NDR nets that miss tracks there, in net id order, so their deficit does not outlive the net that caused it. Gate the 3D maze routing on the 2D usage overflow only: the NDR deficit comes from first-fit 2D layer reservations, which layer assignment can improve on. Sum the edge deficits in the full-scan overflow references, so that the overflow checks catch a drifting running total. ndr_1w_3s now converges after one extra iteration instead of three, with the same routes. Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
…ROAD into grt-update-fr-ndr-handling Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Regenerate the metrics and limits of ibex_sky130hd, ibex_sky130hs and jpeg_sky130hd from the Bazel run after merging master. This branch's global routing demotes fewer NDR clock nets, which changes post-route slew, capacitance and antenna results on these designs. Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
…ROAD into grt-update-fr-ndr-handling
|
The last commits addressed these comments from Eder: == Priority 1 (correctness) == src/grt/src/fastroute/src/graph2d.cpp:1171 bug (minor): an NDR deficit can gostale. A net's deficit is set once, in reserveNDRCapLayer, and only removedwith that net. When another net's layer is released, the remaining nets arenot re-checked. Example with tracks {2,2,3} and two NDR nets of width 3:A takes L2, B gets deficit 1. Rip up A: L2 has 3 free tracks again, butedge.ndr_deficit and the total stay at 1, so the 2D overflow counts 1.getNDRDeficitIfRouted(A) also returns 1, so A is priced off an edge it fitson. It heals when B is ripped on the next maze pass, or when copyBR rebuildsall usage. The old charged_overflow flag had the same staleness, but the 2Doverflow total now depends on the deficit. Suggest re-checking the remainingdeficit nets on the edge at release (the map is tiny). Test:graph.updateUsageH(1, 0, ndr_net_, -kNdrWidth); // the net that fits leavesEXPECT_EQ(graph.getTotalNDRDeficit(), 0); == Priority 2 (QoR) == src/grt/test/soft_ndr_escalation.ok question: wirelength goes 1814 -> 2052 um(+13%), and NDR demotion now happens at the iteration limit (15) instead ofon stagnation (12). The PR body doesn't mention it, and the commit messagestill says 1872. Expected? == Priority 3 (testing) == Missing tests: the stale-deficit case above, and newRipupCheck /newRipupCongestedL ripping up an NDR net on a deficit edge that is undercapacity. No test calls either function. == Priority 6 (process) == Some commit messages don't match the final diff: jpeg_sky130hs and theaes_sky130hs antenna limit are mentioned but neither changed, and the goldenwirelength numbers are out of date. Worth fixing, since merge commits keep them. == Overall == |
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
|
@osamahammad21 QoR metrics degraded for some flow tests due to more detours caused by fewer soft-NDR demotion. The next PR should fix this by restoring the routing state. No issues for public and private CI |
…ROAD into grt-update-fr-ndr-handling
…ROAD into grt-update-fr-ndr-handling
Regenerate the metrics and limits of ibex_sky130hd from the Bazel run after merging master. Results change from placement onward, which moves the post-route slew and capacitance slacks past their limits. Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
…ROAD into grt-update-fr-ndr-handling Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Regenerate the metrics and limits of aes_nangate45, gcd_nangate45, jpeg_sky130hd and jpeg_sky130hs from the Bazel run after merging master. Post-route slew, capacitance, clock skew and antenna results moved past their limits on these designs. Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Problem
During the 2D stages, FastRoute checks that each NDR net fits in a single layer of every edge it uses. When no layer could host the net,
Graph2D::getCostNDRAwareadded 100 × the net's edge cost to the shared edge usage. Every later NDR net on that edge was charged the same, even when it fit.For example, an edge with three layers of 2 tracks each cannot host an NDR net of cost 3. That edge looked about 300 tracks over capacity, although it still had room for three regular nets. As a result:
Implementation
NDRUsage::deficit,Edge::ndr_deficit, plus a running total).FastRouteCore::getUsageNDRAwaremakes an edge with a deficit look overflowed bykNdrDeficitCost(100) tracks per missing track, but only to NDR nets. Regular nets see the true usage. It feeds the maze cost and the L, Z, spiral and monotonic pattern routes. The NDR nets on an edge share its deficit (getNDRDeficitIfRouted), so a net that fits also sees the nets it leaves without room.StNetOrderadds 100 × an NDR net's own deficit to the net's congestion key. The key is now capped at theint16_tmaximum instead of wrapping.initNDRnetsclears the per-edge NDR records of the previous run. Without this, a new net allocated at the address of a deleted one was taken for a net already using the edge.hasNDRCapacity, and the unused net name copy ingetCostNDRAwareare removed.Tests
NDRDeficitTestfixture ofTestOverflow:TestGraph2Dtest checks that a same-size re-init drops the previous run's NDR records. It fails without the fix.AccountsForNDRDeficitsAndCancellation(previouslyAccountsForNDRPenaltiesAndCancellation), and few goldens.Type of Change
Impact
Better handling of routing resources when dealing with NDR nets during FastRoute 2D phases.
Verification
./etc/Build.sh).