grt/drt: Add support for routing secondary power nets#10661
Conversation
Implement routing support for secondary power nets (non-special supply nets in the NETS section with pre-routed straps/SWires). - In GRT, identify secondary power nets and route their pins directly to the closest coordinates on their pre-routed straps. - In DRT, bypass the DRT-0305 error check for these nets, import pre-routed straps as fixed wires, and treat their type internally as SIGNAL so TritonRoute routes cell pins directly to the straps. - Add regression test case registered in both CMake and Bazel. Fixes The-OpenROAD-Project#8770 Fixes The-OpenROAD-Project#8771 Signed-off-by: KMohnishM <kmohnishm@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces support for routing secondary power nets (non-special supply nets) to their nearest straps. It adds helper functions to identify these nets, skips them during standard routing, and implements a dedicated routing routine that connects pins to the closest strap using planar routing and via stacks. The review feedback suggests removing a redundant loop that adds degenerate segments to avoid duplicate guides, and replacing a hardcoded magic number for the layer penalty with a named constant.
| for (int l = min_l; l <= max_l; ++l) { | ||
| route.emplace_back(closest_grid_pt.x(), | ||
| closest_grid_pt.y(), | ||
| l, | ||
| closest_grid_pt.x(), | ||
| closest_grid_pt.y(), | ||
| l); | ||
| } |
There was a problem hiding this comment.
The loop that adds degenerate segments (from (x, y, l) to (x, y, l)) is redundant. The subsequent loop already adds vertical segments (vias) connecting each layer from min_l to max_l, which naturally generates guides on all intermediate layers. Adding these degenerate segments results in duplicate guides being written to the guide file (as seen in secondary_power.guideok where metal1 and metal2 guides are duplicated multiple times). Removing this loop cleans up the route representation and prevents redundant guide generation.
| int64_t dist = std::abs(pin_pt.x() - closest_x) | ||
| + std::abs(pin_pt.y() - closest_y); | ||
| // Prefer straps closer in routing layers | ||
| dist += 1000LL * std::abs(pin_level - swire_level); |
There was a problem hiding this comment.
Define the layer penalty multiplier as a named constant instead of using a hardcoded magic number, in accordance with the general rules of the repository.
constexpr int64_t kLayerPenalty = 1000;
dist += kLayerPenalty * std::abs(pin_level - swire_level);References
- Define tunable parameters as named constants instead of using hardcoded magic numbers.
grt/drt: Add support for routing secondary power nets
Implement routing support for secondary power nets (non-special supply nets in the
NETSsection with pre-routed straps/SWires).Summary
This PR adds support in both the Global Router (GRT) and Detailed Router (DRT / TritonRoute) to route secondary power nets from cell pins to their nearby pre-routed straps. This resolves both level-shifter secondary power grid routing (#8770) and designs using standard cell libraries without tie cells (#8771).
Proposed Changes:
grt):isSecondaryPowerNetto identify nets that are supply nets, not special, and have pre-routed SWires.GlobalRouter::routeSecondaryPowerNetswhich maps each pin to the absolute closest grid coordinate on its pre-routed strap (clamping boundary coordinates and applying a layer difference penalty). It generates direct planar segments and vertical via stacks to connect them, avoiding daisy-chaining (using star topology).drt):DRT-0305error check for these nets.SIGNALso TritonRoute routes, rips up, and optimizes the pin connections natively. This also naturally ensures any user-configured Non-Default Rules (NDRs) for wire widths and spacing are respected and applied.Type of Change
Impact
Enables the router to automatically route secondary power nets and constant tie-offs to nearby power rails/straps natively, acting as a general fallback for automated flows (e.g. OpenLane) without requiring custom floorplanning/PG scripts.
Verification
./etc/Build.sh).Related Issues
Fixes #8770
Fixes #8771