dpl: negotiation, rework rail check#10645
Conversation
… use existing checkRowPowerCompatible Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
There was a problem hiding this comment.
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.
| // 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. |
There was a problem hiding this comment.
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 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.
There was a problem hiding this comment.
I am considering just removing this. This is the post-optimization implemented during the Negotiation algorithm. We already have our own DPO (improve_placement).
|
@codex review |
There was a problem hiding this comment.
💡 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".
| if (node != nullptr | ||
| && !opendp_->checkRowPowerCompatible(node, GridY{rowIdx})) { |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
…s original diamond search Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
eder-matheus
left a comment
There was a problem hiding this comment.
LGTM. @osamahammad21 could you also take a look at this PR? We need your review as DPL maintainer.
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
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
./etc/Build.sh).Related Issues
This is one of multiple PRs splitting up PR #10226 to make Negotiation the default algorithm at DPL.