Skip to content

dpl: error on rows with overlapping sites (STEP < site width) - #11211

Open
qwertxzy wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
qwertxzy:fix-dpl-row-site-mismatch
Open

dpl: error on rows with overlapping sites (STEP < site width)#11211
qwertxzy wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
qwertxzy:fix-dpl-row-site-mismatch

Conversation

@qwertxzy

Copy link
Copy Markdown

Summary

A DEF row whose STEP (site spacing) is smaller than the site width declares overlapping sites, so the row's site count exceeds the grid DPL derives from the core area. dpl::Grid::markHopeless() then wrote past the pixel grid and crashed with Signal 11.

Grid::examineRows() now reports DPL-0052 in this case instead of allowing the overflow, and a minimal row_site_mismatch regression test covers the degenerate floorplan (STEP 140 vs site width 380).

Type of Change

  • Bug fix

Impact

Previously, reading a DEF containing such a row crashed OpenROAD with a segfault during detailed placement. Now detailed_placement aborts cleanly with the DPL-0052 error, and the new row_site_mismatch` test pins this behavior.

Verification

  • I have verified that the local build succeeds.
  • 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

None.

Disclaimer

This was fixed by Deepseek v4.

A DEF row whose STEP (site spacing) is smaller than the site width
declares overlapping sites, so the row's site count exceeds the grid DPL
derives from the core area.  dpl::Grid::markHopeless() then wrote past the
pixel grid and crashed with Signal 11.

examineRows() now reports DPL-0052 in this case instead of allowing the
overflow, and a minimal row_site_mismatch regression test covers the
degenerate floorplan (STEP 140 vs site width 380).

Signed-off-by: qwertxzy <leo@qwertxzy.me>
@qwertxzy
qwertxzy requested a review from a team as a code owner August 23, 2026 15:48
@qwertxzy
qwertxzy requested a review from gudeh August 23, 2026 15:48

@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 a check in Grid::examineRows to detect rows with site spacing smaller than the site width, preventing a potential pixel grid overflow and segmentation fault during detailed placement. It also adds a corresponding regression test. The review feedback suggests refining this check by ensuring the row has more than one site before flagging an error, which prevents false positives on valid designs with single-site rows where spacing might default to zero.

Comment thread src/dpl/src/infrastructure/Grid.cpp Outdated

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

Welcome to OpenROAD! Thanks for opening your first PR.
Before we review:

Please ensure:

  • CI passes
  • Code is properly formatted
  • Tests are included where applicable
    A maintainer will review shortly!

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Leo <qwertxzy@users.noreply.github.com>
@qwertxzy

Copy link
Copy Markdown
Author

https://openroad.readthedocs.io/en/latest/contrib/contributing.html doesn't exist anymore, I guess this link should be updated to https://openroad.readthedocs.io/en/latest/contrib/GettingInvolved.html?

@maliberty

Copy link
Copy Markdown
Member

I don't understand your description. STEP is about row height and has nothing to do with site width. Did you mean site height? Rows for a single site should not overlap and that should just be an error.

@qwertxzy

Copy link
Copy Markdown
Author

Agreed, it should just be an error, that's what I'm aiming to fix.

On a malformed DEF input, the row's horizontal STEP is smaller than the site width, so the declared sites overlap and the row ends up with more sites than the core area can hold at full site width. DPL sizes the placement grid from core-width / site-width but trusts the row's site count, so markHopeless() segfaults.

@gudeh

gudeh commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

I guess this is unrelated: 05:46:50 //src/grt/test:repair_antennas_post_drt_cugr-tcl_test TIMEOUT in 303.3s

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.

3 participants