grt: enhance CUGR's congestion handling#10425
Conversation
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
…le in the routing layers 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>
There was a problem hiding this comment.
Code Review
This pull request introduces an iterative Rip-up and Re-route (RRR) mechanism to the CUGR global router, aimed at resolving persistent congestion by sharpening cost gradients and widening the rip-up set across multiple iterations. Key additions include a 2D congestion diagnosis tool, a configurable iteration limit, and a 'floor-to-1' capacity adjustment rule to ensure at least one usable track remains on adjusted layers. Feedback identifies a critical bug in the congestion reporting logic where the removal of a guard clause causes all edges to report overflow regardless of actual demand. Additionally, it is recommended to refine the early-exit condition in the RRR loop to consistently ignore fractional overflows below 1.0.
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
Summary
Adds CUGR's missing stage-4 iterative rip-up and re-route (RRR) loop, plus the supporting infrastructure to fight per-layer overflow concentration on heavily-adjusted designs.
Changes on
src/grt/src/cugr/:CUGR::iterativeRRR) wraps the maze stage in a loop that sharpens the logistic cost slope per iteration (via the newGridGraph::setCostMultiplier) and widens the rip-up set to nets touching near-overflow edges (via the newGridGraph::checkCongestion(tree, threshold)+CUGR::updateCongestedNets). EmitsGRT-0117per iteration andGRT-0118if overflow remains, mirroring FastRoute'sGRT-0102style.-congestion_iterationsflag; when-use_cugris set with no explicit value the default is 5 (FastRoute keeps its default of 50).GridGraphadjustment loop now mirrors FastRoute's floor-to-1 rule (GlobalRouter.cpp:1812): edges with any pre-adjustment capacity keep at least 1 usable track unless the user explicitly asked for 100% reduction.CUGR::saveCongestionrounds per-edge overflow withceil(demand - cap)so the marker tree still gets entries when overflow is fractional.CUGR::debugCongestion2D(gated onset_debug_level GRT rrr_2d 1) reports the gap between 3D overflow and 2D-aggregate overflow — the spreadable portion of the residual.PatternRoute::calculateRoutingCostsreads the per-net layer range (GRNet::getLayerRange) and branchesfixed_layers.isValid()so non-pin Steiner nodes don't get clamped to an inverted interval.Type of Change
Impact
For the canonical stress test (
cugr_adjustment3, gcd_nangate45 + 90% layer adjustment): total overflow drops from 445 → 18 units (-96%); wirelength is essentially unchanged (+0.3%); via count rises 36% (4225 vs 3095) as the router accepts longer paths and more vias to absorb redistributed traffic. Other CUGR designs that were already clean remain so. RRR is a no-op whentotalOverflow() == 0, so default-flow designs incur only the gate check.-congestion_iterations Nnow also drives CUGR (it was FastRoute-only before).12
.ok/.guideokbaselines on the CUGR test suite refreshed to capture the new routings.Verification
./etc/Build.sh).cugr_adjustment1-3,critical_nets_percentage_cugr,clock_route_cugr*, etc.) now exercise the RRR loop and the adjustment-floor path; their baselines are updated to lock the new behaviour.Related Issues
None.