Skip to content

dpl: debug deep iterative and new paintings#9441

Merged
maliberty merged 20 commits intoThe-OpenROAD-Project:masterfrom
gudeh:dpl-debug-deep-iterative
Feb 19, 2026
Merged

dpl: debug deep iterative and new paintings#9441
maliberty merged 20 commits intoThe-OpenROAD-Project:masterfrom
gudeh:dpl-debug-deep-iterative

Conversation

@gudeh
Copy link
Copy Markdown
Contributor

@gudeh gudeh commented Feb 8, 2026

This PR is no-op.

It includes the following changes to debug mode:

  • New option to paint occupied pixels during dpl debug mode: -paint_pixels
  • New option to debug mode: -deep_iterative
    • The shiftMove() function is called when the main mapMove() function fails to find a suitable position for a target cell. The shiftMove() itself internally calls mapMove() multiple times to place cells surrounding the target cell. The deep_iterative option will stop every time an internal cell is positioned with the internal mapMove() call.
  • Always paint unplaced cells in magenta.
  • A few summarizing final messages for successful/failed mapMove() and shiftMove() calls

This PR also includes a new mode for DPL: -incremental, which initiates all cells in a legal position and without collisions as placed, instead of the current default which initiates all cells as unplaced (this option has functional implications, but is not used by default currently).

gudeh added 7 commits February 5, 2026 20:18
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>
…ion changes

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
the incremental mode initiate legalized instances as placed instead of everything unplaced

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces new debug options for the DPL tool, including -paint_pixels for visualizing occupied pixels, and -deep_iterative for more granular pausing during iterative placement. It also adds an -incremental mode to initialize cells as placed if they are already legal and collision-free. The changes involve modifications to the Opendp.h, Opendp.cpp, Opendp.i, Opendp.tcl, and Graphics.cpp files to support these new functionalities. The searchNearestSite function has been renamed to diamondSearch across the codebase. Overall, the changes enhance the debugging capabilities and provide a new placement initialization mode.

Comment on lines +433 to +452
if (iterative_placement_) {
logger_->report(
"Total counters:\n"
"\t#cells: {}\n"
"\t#Failed mapMove(): {}, #Success mapMove(): {}\n"
"\t% Success mapMove(): {:.2f}\n"
"\t#Failed shiftMove(): {}\n"
"\t% Success shiftMove(): {:.2f}",
sorted_cells.size(),
failed_map_move,
success_map_move,
success_map_move > 0
? 100.0 * success_map_move / (failed_map_move + success_map_move)
: 0,
failed_shift_move,
failed_map_move > 0
? 100.0 * (failed_map_move - failed_shift_move) / (failed_map_move)
: 0);

logger_->report("Placement failures: {}", placement_failures_.size());
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

The logging block for total counters is quite large and contains complex calculations for percentages. This could be encapsulated in a separate helper function, e.g., reportPlacementSummary(size_t total_cells, int failed_map, int success_map, int failed_shift) to improve readability and reduce the size of the place function. This would make the main placement logic easier to follow.

Comment on lines 711 to +713
const GridY boundary_margin{3};
const GridX margin_width{grid_->gridPaddedWidth(cell).v * boundary_margin.v};
const GridX margin_width{grid_->gridPaddedWidth(target_cell).v
* (1 + boundary_margin.v)};
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

The margin_width calculation uses a "magic number" (1 + boundary_margin.v). It's generally good practice to define such numbers as named constants to improve readability and maintainability. This makes the code easier to understand and modify in the future.

References
  1. Define tunable parameters as named constants instead of using hardcoded magic numbers.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

gudeh added 5 commits February 9, 2026 15:05
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
…on another PR

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

10 similar comments
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

clang-tidy review says "All clean, LGTM! 👍"

@gudeh gudeh requested a review from maliberty February 9, 2026 17:25
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty maliberty changed the title dpl: debug deep iterative and new paintaings dpl: debug deep iterative and new paintings Feb 12, 2026

for (auto& node : network_->getNodes()) {
if (node->getType() == Node::CELL && !node->isFixed() && node->isPlaced()) {
if ((node->getLeft() % site_width != 0) || !checkInRows(*node)) {
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.

The row might not start on a multiple of site_width so this may be incorrect.

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.

what if we do the following, the snapping to the grid pixels has to be same as the cell position.

      const GridX x = grid_->gridX(node.get());
      const GridY y = grid_->gridSnapDownY(node.get());
      if (node->getLeft() != gridToDbu(x, site_width)
          || node->getBottom() != grid_->gridYToDbu(y)

Comment on lines +318 to +319
if (!pixel->cell->isFixed()) {
conflicted.insert(pixel->cell);
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.

Is it not a conflict to be on a fixed object?

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 ensures we do not attempt to unplace fixed cells. In other words, when !pixel->cell->isFixed() is true (the cell is movable), we mark both cells as conflicted. But if the cell already in the pixel is fixed, the condition is false, and only the current node is marked for unplacement.

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

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@gudeh gudeh requested a review from maliberty February 19, 2026 14:54
@maliberty maliberty merged commit a46bcb2 into The-OpenROAD-Project:master Feb 19, 2026
13 checks passed
@gudeh gudeh deleted the dpl-debug-deep-iterative branch February 24, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants