Skip to content

grt: add updateNet for topology refresh in CUGR incremental routing#9671

Merged
eder-matheus merged 17 commits intoThe-OpenROAD-Project:masterfrom
sparsh-karna:grt/incremental-update-net
Mar 12, 2026
Merged

grt: add updateNet for topology refresh in CUGR incremental routing#9671
eder-matheus merged 17 commits intoThe-OpenROAD-Project:masterfrom
sparsh-karna:grt/incremental-update-net

Conversation

@sparsh-karna
Copy link
Contributor

Summary

Extends the incremental CUGR routing API (introduced in #9645) with
topology refresh support. When buffer insertion changes a net's pin
list or adds new nets, the existing GRNet objects are stale. This PR
re-reads net topology from ODB before rerouting so the incremental
path operates on correct data.

Depends On

#9645 — must be reviewed/merged first.

Changes

  • Design::updateNet(dbNet*) — re-reads pins, BTerms, ITerms, and
    layer range from ODB in-place; handles brand-new nets created by
    buffer insertion (net splits)
  • CUGR::updateNet(dbNet*) — rips up old routing tree, rebuilds
    CUGRNet/GRNet from scratch, registers new nets in gr_nets_,
    net_indices_, and db_net_map_
  • Null guard in GridGraph::commitTree() to prevent crash on freshly
    allocated nets with no existing routing tree
  • Wired into endIncremental() so topology refresh happens before
    rerouteNets() runs
  • grt::update_net Tcl command exposed via GlobalRouter.i SWIG binding
  • Regression test: src/grt/test/incremental_update_net.tcl

Testing

  • Regression test splits a net, calls update_net, runs end_incremental,
    asserts guides exist for the new net
  • All existing grt regression tests unaffected

sparsh-karna and others added 7 commits March 5, 2026 23:03
Add addDirtyNet(), startIncremental(), and endIncremental() methods
to support incremental global routing in the CUGR engine, along with
dirty_net_indices_ and incremental_mode_ state tracking.

Signed-off-by: TheUnnamedOne-design <aditya07.11.04.12@gmail.com>
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Signed-off-by: TheUnnamedOne-design <aditya07.11.04.12@gmail.com>
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
…rtion

When repair_timing inserts a buffer, a net is split into two. The previous
incremental flow rerouted the stale GRNet objects from init() — pin list,
access points, and bounding box all predated the insertion.

Implement Design::updateNet() and CUGR::updateNet() to refresh per-net
CUGRNet/GRNet state from the database before rerouting. Wire into
endIncremental() and expose as grt::update_net Tcl command.

Also add null guard in GridGraph::commitTree() for freshly rebuilt nets
and a regression test exercising the full incremental update path.

Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 support for topology refresh in the incremental CUGR router, which is crucial for handling netlist changes from buffer insertion. The changes include new APIs to update net information from the database, integration into the incremental routing flow, and a new regression test. My review focuses on potential performance improvements and code maintainability. I've identified a few areas with redundant operations and code duplication that could be refactored for better efficiency and clarity.

Note: Security Review did not run due to the size of the PR.

Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

… detours

Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus eder-matheus self-requested a review March 8, 2026 15:16
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@sparsh-karna
Copy link
Contributor Author

hey @eder-matheus i will look in the jenkins issues but could you help me out in why build on macos is failing

Remove redundant routing tree existence checks before commitTree() calls
in patternRoute, patternRouteWithDetours, and mazeRoute, since nets
processed in these functions are always routed in a prior stage and
guaranteed to have a valid routing tree. Retain the null check only in
updateCUGRNet and rerouteNets where nets may not yet have been routed
in the incremental routing context.

Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
@sparsh-karna sparsh-karna force-pushed the grt/incremental-update-net branch from f98be21 to f68d05a Compare March 11, 2026 14:04
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Member

@eder-matheus eder-matheus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor requests before approving.

@eder-matheus
Copy link
Member

@sparsh-karna About the jenkins and macOS build failures, they are probably related to the changes in the GlobalRouter.i file.

Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
@sparsh-karna
Copy link
Contributor Author

hey @eder-matheus i have fixed the swig formatting issues in GlobalRouter.i file, could you approve the workflow

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

…_idx_ to db_net_to_id_ in Design.cpp

Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus eder-matheus marked this pull request as ready for review March 11, 2026 18:45
@sparsh-karna sparsh-karna force-pushed the grt/incremental-update-net branch from e5df3f2 to 62a3303 Compare March 11, 2026 20:30
Update incremental_update_net.tcl to call grt::update_cugr_net
instead of the old grt::update_net after the function rename.

Signed-off-by: Sparsh Karna <sparsh2005karna@gmail.com>
@sparsh-karna sparsh-karna force-pushed the grt/incremental-update-net branch from 62a3303 to 1d70cca Compare March 11, 2026 20:31
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus eder-matheus enabled auto-merge March 12, 2026 17:08
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus eder-matheus merged commit acdbfa6 into The-OpenROAD-Project:master Mar 12, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants