grt: add incremental routing support to CUGR#9679
grt: add incremental routing support to CUGR#9679sparsh-karna wants to merge 7 commits intoThe-OpenROAD-Project:masterfrom
Conversation
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>
There was a problem hiding this comment.
Code Review
This pull request adds incremental global routing support to the CUGR backend, mirroring the existing FastRoute API. The changes are well-structured, introducing new logic for CUGR within GlobalRouter and implementing the core incremental functionality in the cugr component. The addition of a test case for net topology updates is also a good validation of the new feature. The suggestions to improve performance and code clarity remain valid.
Note: Security Review did not run due to the size of the PR.
| for (const int idx : dirty_net_indices_) { | ||
| updateNet(gr_nets_[idx]->getDbNet()); | ||
| } |
There was a problem hiding this comment.
This loop iterates over dirty_net_indices_ to refresh net data before rerouting. While this is safe for std::set as iterators are not invalidated on insertion, it can be confusing. Iterating over the nets_to_route vector, which is a copy of the dirty nets at the beginning of the function, would be clearer and more robust against future changes. This ensures you are iterating over a fixed set of nets.
for (const int idx : nets_to_route) {
updateNet(gr_nets_[idx]->getDbNet());
}| for (CUGRNet& net : nets_) { | ||
| if (net.getDbNet() == db_net) { | ||
| net.setPins(std::move(pins)); | ||
| net.setLayerRange(layer_range); | ||
| return; | ||
| } | ||
| } |
There was a problem hiding this comment.
This loop performs a linear scan over all nets to find the one to update. This can be inefficient if there is a large number of nets, leading to O(N) complexity for each update. To improve performance, consider using a map (e.g., std::unordered_map<odb::dbNet*, int>) to store the mapping from dbNet* to its index in the nets_ vector. This map could be populated in readNetlist and maintained in updateNet, allowing for an average O(1) lookup.
Adds incremental global routing support to the CUGR backend, mirroring the
existing FastRoute incremental API.
Changes
addDirtyNet()to mark nets needing reroutestartIncremental()/endIncremental()to CUGR state machineReopens #9645 (accidentally closed during branch cleanup).