Skip to content

dpl: remove universal cell height assumption#10684

Open
gudeh wants to merge 10 commits into
The-OpenROAD-Project:masterfrom
gudeh:dpl-cell-height
Open

dpl: remove universal cell height assumption#10684
gudeh wants to merge 10 commits into
The-OpenROAD-Project:masterfrom
gudeh:dpl-cell-height

Conversation

@gudeh

@gudeh gudeh commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the assumption that every instance shares a single universal row_height_ in the negotiation legalizer. Add cell-height distribution reporting.

Replace every row_height_ usage with the DPL grid's own helpers, which already account for per-row heights:

  • cell footprint height: dpl_grid->gridHeight(master)
  • row-rail / region / fence Y boundaries: gridSnapDownY()
  • grid to DBU Y for snapping and distances: gridYToDbu()

In the negotiation legalizer, log the distribution in grid row-counts (info message DPL-392/393). Easy to see at a glance whether a design is single- or multi-height.

Type of Change

  • Bug fix

Impact

Some private designs with hybrid rows or multi height rows would present issues because of this assumption.

On uniform-height designs this is no-op. The grid helpers reduce to the same arithmetic the old code did with row_height_.

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 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 5 commits June 17, 2026 21:44
… for all instances,

instead fetch instance height from db to define pixel grid height relative to instance

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
…pixels

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

@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 NegotiationLegalizer to support hybrid-row designs with non-uniform row heights. It removes the uniform row_height_ member variable and instead utilizes dpl_grid APIs (such as gridSnapDownY, gridYToDbu, and gridHeight) to handle coordinate conversions and height calculations. Additionally, it adds logging to report cell height distributions. There are no review comments, and I have no further feedback to provide.

gudeh added 2 commits June 18, 2026 00:13
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@gudeh gudeh requested a review from eder-matheus June 18, 2026 14:00
@gudeh

gudeh commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@osamahammad21 @eder-matheus I hope this one to be more straight forward.

@eder-matheus

Copy link
Copy Markdown
Member

@gudeh Does it require a secure-ci? We have some private designs with negotiation-based on, right?

@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: 673cb79826

ℹ️ 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
FenceRect r;
r.xlo = (box->xMin() - die_xlo_) / site_width_;
r.ylo = (box->yMin() - die_ylo_) / row_height_;
r.ylo = dpl_grid->gridSnapDownY(DbuY{box->yMin() - die_ylo_}).v;

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 Snap lower fence bounds inward

When a fence or group region's lower Y edge falls inside a variable-height grid interval, gridSnapDownY rounds the lower bound down to the previous row, so FenceRegion::contains() can accept a cell whose bottom is below the DEF region. The regular DPL region path snaps contained rectangles inward via gridWithin()/gridEndY() for the lower edge; negotiation should do the same here (and in the init-time region cache) or hybrid/fragmented-row designs with non-row-aligned fences can be legalized outside their assigned region.

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 relevant. At Grid.cpp we originally use .ylo = gridEndY(rect.yl), instead of gridSnapDownY() at:

GridRect Grid::gridWithin(const DbuRect& rect) const
{
return {.xlo = dbuToGridCeil(rect.xl, getSiteWidth()),
.ylo = gridEndY(rect.yl),
.xhi = dbuToGridFloor(rect.xh, getSiteWidth()),
.yhi = gridSnapDownY(rect.yh)};
}

@gudeh

gudeh commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@gudeh Does it require a secure-ci? We have some private designs with negotiation-based on, right?

its no-op: http://secure-ci:8080/blue/organizations/jenkins/SB/detail/secure-dpl-cell-height/1/pipeline

Maybe it is because we have a single-height row setup with multi-row instances.

make sure we do not include one grid row outside the region range

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.

2 participants