Skip to content

grt: add each via once to FastRoute partial routes - #12003

Merged
eder-matheus merged 4 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-dedup-reversed-vias
Oct 26, 2026
Merged

eder-matheus merged 4 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-dedup-reversed-vias

Conversation

@eder-matheus

Copy link
Copy Markdown
Member

Summary

GSegment keeps a via's layer order, so FastRoute's partial-route builders (getPlanarRoute, get3DRoute and the bridging vias) added the same via twice when it was reached from both sides. For example, a sink pin's via stack is walked down to the pin and back up. getRoutes already skipped the reversed via; these paths did not. This PR adds addSegment, which finds a duplicate via in either layer order, and uses it for every segment the partial-route builders add.

Each duplicate became a parallel resistor in the mid-route parasitics that resistance-aware routing uses. OpenSTA's PRIMA maxParasiticPathResistance enumerates every simple path, so its runtime doubles with each duplicate on a path. This caused the asap7/swerv_wrapper GRT timeout in the ORFS nightly.

Type of Change

  • Bug fix

Impact

  • Partial-route parasitics are trees again. On asap7/swerv_wrapper (nightly 7675 4_cts.odb), parasitics estimated during the 3D maze pass went from 437,394 duplicate resistors on 86,549 of 87,431 nets (up to 203 per net) to none.
  • The initial resistance-aware global_route on that design did not finish in 2.5 h without this fix and takes 72 s with it.
  • Final routes are built by getRoutes, which this PR doesn't change.

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 included tests to prevent regressions.
  • I have signed my commits (DCO).

Related Issues

ORFS nightly 7675: asap7/swerv_wrapper timed out in global route.

Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
@eder-matheus eder-matheus self-assigned this Oct 26, 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 helper function addSegment in FastRoute.cpp to deduplicate routing segments and refactors several insertion blocks to use it. It also adds unit tests in TestMaze3D.cpp to verify that vias are added only once. The review feedback suggests optimizing addSegment to avoid unconditional copying of segments on the hot path, and replacing std::minmax with std::min and std::max in the test helper to prevent potential dangling references.

Comment thread src/grt/src/fastroute/src/FastRoute.cpp
Comment thread src/grt/test/cpp/TestMaze3D.cpp Outdated
… pin vias

Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
@eder-matheus
eder-matheus marked this pull request as ready for review October 26, 2026 19:14
@eder-matheus
eder-matheus requested a review from a team as a code owner October 26, 2026 19:14
@eder-matheus
eder-matheus requested a review from jfgava October 26, 2026 19:14
@github-actions github-actions Bot added size/M and removed size/S labels Oct 26, 2026
…er to getVias

Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
@eder-matheus
eder-matheus disabled auto-merge October 26, 2026 20:12
@eder-matheus
eder-matheus merged commit 3e3e483 into The-OpenROAD-Project:master Oct 26, 2026
20 checks passed
@eder-matheus
eder-matheus deleted the grt-dedup-reversed-vias branch October 26, 2026 20:12
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.

2 participants