Skip to content

dpl: fix power-rail detection in getMasterPwrs#10616

Open
gudeh wants to merge 4 commits into
The-OpenROAD-Project:masterfrom
gudeh:dpl-fix-getMasterPwrs
Open

dpl: fix power-rail detection in getMasterPwrs#10616
gudeh wants to merge 4 commits into
The-OpenROAD-Project:masterfrom
gudeh:dpl-fix-getMasterPwrs

Conversation

@gudeh

@gudeh gudeh commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Check rails with cell borders instead of using bbox centers. Previous code would incorrectly collapsed multi-box pins to the cell middle, instead of borders, mislabeling double-height cells.

Type of Change

  • Bug fix

Impact

Private designs do not fail anymore.

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

Check rails with cell borders instead of using bbox centers.
Previous code would incorrectly collapsed multi-box pins to the cell middle,
instead of borders, mislabeling double-height cells.

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@gudeh gudeh requested a review from a team as a code owner June 8, 2026 19:59
@gudeh gudeh requested a review from osamahammad21 June 8, 2026 19:59
@github-actions github-actions Bot added the size/S label Jun 8, 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 refactors the getMasterPwrs function in src/dpl/src/infrastructure/network.cxx to improve power and ground rail detection. Instead of using the bounding box center of the MPins, it now evaluates individual routing-layer geometries to determine if they touch the cell's top or bottom boundaries. Feedback on this PR includes cleaning up a leftover comment fragment and improving the robustness of the boundary checks by ensuring the pin geometry actually intersects the cell boundaries rather than just checking one-sided inequalities.

Comment on lines +265 to +267
// rail. Only ROUTING-layer geometry counts, to ignore NWELL/PWELL implants
// encoded as POWER/GROUND pins on MASTERSLICE layers.
// layers) from polluting the rail detection.

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

There is a leftover comment fragment at the end of the block: // layers) from polluting the rail detection.. This appears to be a remnant from a previous edit. We should clean this up to make the comment grammatically correct and clear.

Suggested change
// rail. Only ROUTING-layer geometry counts, to ignore NWELL/PWELL implants
// encoded as POWER/GROUND pins on MASTERSLICE layers.
// layers) from polluting the rail detection.
// rail. Only ROUTING-layer geometry counts, to ignore NWELL/PWELL implants
// (encoded as POWER/GROUND pins on MASTERSLICE layers) from polluting the
// rail detection.

Comment thread src/dpl/src/infrastructure/network.cxx Outdated
Comment on lines +295 to +300
if (rect.yMin() <= y_cell_bot) {
(is_pwr ? bot_has_pwr : bot_has_gnd) = true;
}
if (rect.yMax() >= y_cell_top) {
(is_pwr ? top_has_pwr : top_has_gnd) = true;
}

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

To prevent potential false positives from out-of-bounds geometries (e.g., geometries completely below y_cell_bot or completely above y_cell_top), it is safer and more robust to verify that the pin geometry actually intersects or touches the respective boundary. This can be achieved by checking that the boundary coordinate lies within the [yMin, yMax] interval of the geometry.

Suggested change
if (rect.yMin() <= y_cell_bot) {
(is_pwr ? bot_has_pwr : bot_has_gnd) = true;
}
if (rect.yMax() >= y_cell_top) {
(is_pwr ? top_has_pwr : top_has_gnd) = true;
}
if (rect.yMin() <= y_cell_bot && rect.yMax() >= y_cell_bot) {
(is_pwr ? bot_has_pwr : bot_has_gnd) = true;
}
if (rect.yMin() <= y_cell_top && rect.yMax() >= y_cell_top) {
(is_pwr ? top_has_pwr : top_has_gnd) = true;
}

gudeh added 3 commits June 10, 2026 13:39
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
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.

1 participant