Skip to content

grt/drt: Add support for routing secondary power nets#10661

Open
KMohnishM wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
KMohnishM:route-secondary-power-8770
Open

grt/drt: Add support for routing secondary power nets#10661
KMohnishM wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
KMohnishM:route-secondary-power-8770

Conversation

@KMohnishM

Copy link
Copy Markdown
Contributor

grt/drt: Add support for routing secondary power nets

Implement routing support for secondary power nets (non-special supply nets in the NETS section 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:

  1. Global Router (grt):
    • Implemented isSecondaryPowerNet to identify nets that are supply nets, not special, and have pre-routed SWires.
    • Bypasses FastRoute/CUGR for these nets.
    • Implemented GlobalRouter::routeSecondaryPowerNets which 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).
  2. Detailed Router (drt):
    • Bypasses the DRT-0305 error check for these nets.
    • Imports SWire shapes on secondary power nets as pre-routed/fixed wire segments so TritonRoute knows where the straps are located.
    • Sets the internal net type to SIGNAL so 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

  • New feature

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

  • 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

Fixes #8770
Fixes #8771

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>
@KMohnishM KMohnishM requested review from a team as code owners June 15, 2026 16:01

@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 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.

Comment on lines +775 to +782
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);
}

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.

medium

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);

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.

medium

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
  1. Define tunable parameters as named constants instead of using hardcoded magic numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

1 participant