Skip to content

dpl: negotiation, rework rail check#10645

Open
gudeh wants to merge 4 commits into
The-OpenROAD-Project:masterfrom
gudeh:dpl-negotiation-rework-rail-check
Open

dpl: negotiation, rework rail check#10645
gudeh wants to merge 4 commits into
The-OpenROAD-Project:masterfrom
gudeh:dpl-negotiation-rework-rail-check

Conversation

@gudeh

@gudeh gudeh commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

For Negotiation at DPL remove unnecessary independent rail checker, instead use existing checkRowPowerCompatible(), which was recently included.

I understand when Negotiation was first implemented with Claude, it didn't realize we could use existing rail checking at DPL. The rail checking is a part of the original algorithm itself. Also, the checkRowPowerCompatible() was introduced to DPL after Negotiation was merged.

This PR makes the rail checking as a single engine, and avoid duplicated code.

Type of Change

  • Bug fix
  • Refactoring

Impact

This is no-op for our secure-CI designs, as checked with runs 1 and 2. This also avoids incorrect row validity classification on a private design I do not have access to.

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 could not reproduce the observed issue on my end. We already have tests for rail alignment.
  • I have signed my commits (DCO).

Related Issues

This is one of multiple PRs splitting up PR #10226 to make Negotiation the default algorithm at DPL.

gudeh added 2 commits June 11, 2026 20:44
… use existing checkRowPowerCompatible

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@gudeh gudeh requested a review from a team as a code owner June 12, 2026 14:40
@gudeh gudeh requested a review from osamahammad21 June 12, 2026 14:40

@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 power-rail compatibility check in NegotiationLegalizer by removing the internal NLPowerRailType tracking and instead leveraging opendp_->checkRowPowerCompatible directly. As a result, the grouping of movable cells in cellSwap() was simplified to group only by height and width. The review feedback correctly notes that this simplification could lead to a performance bottleneck in cellSwap() by grouping cells with different power-rail requirements together, thereby significantly increasing the number of candidate pairs to evaluate.

Comment on lines +886 to +888
// Group movable cells by (height, width). Power-rail compatibility of any
// candidate swap is enforced below by isValidRow(), so it need not be part
// of the grouping key.

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

Grouping movable cells only by (height, width) instead of (height, width, rail_type) will group cells with different power-rail requirements together. While isValidRow() will correctly reject incompatible swaps, this significantly increases the number of candidate pairs to evaluate in the $O(N^2)$ nested loops of cellSwap(). If cellSwap() is ever enabled/uncommented in legalize(), this could lead to a severe performance bottleneck on designs with a large number of standard cells of the same dimensions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am considering just removing this. This is the post-optimization implemented during the Negotiation algorithm. We already have our own DPO (improve_placement).

@gudeh gudeh requested a review from eder-matheus June 12, 2026 14:48
@eder-matheus

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c603565a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/dpl/src/NegotiationLegalizer.cpp Outdated
Comment on lines +1032 to +1033
if (node != nullptr
&& !opendp_->checkRowPowerCompatible(node, GridY{rowIdx})) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject rail matches that require illegal flips

For multi-height masters that are not X-symmetric, this accepts rows where Architecture::powerCompatible would only succeed by setting its flip out-parameter. The normal DPL path guards this by checking master symmetry against the row orientation before the power check in Place.cpp::canBePlaced, but NegotiationLegalizer::isValidRow only verifies that the site exists and then ignores whether compatibility required a flip. In alternating-rail rows, a non-flippable multi-height cell can therefore be moved to a wrong-parity row and later get assigned an illegal row orientation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seems correct, we seem to be missing a checkMasterSym() call, like is done with original diamond search at Place.cpp. I also noticed we left a "flipabble" variable unused.

gudeh added 2 commits June 12, 2026 21:44
…s original diamond search

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@gudeh gudeh requested review from eder-matheus and removed request for eder-matheus June 17, 2026 14:57

@eder-matheus eder-matheus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. @osamahammad21 could you also take a look at this PR? We need your review as DPL maintainer.

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.

2 participants