The-OpenROAD-Project / The-OpenROAD-Project/OpenROAD

mpl: -write_macro_placement output rejected by place_macro (snap residue past core, MPL-0034)

Open
#11,278 1 comment 0 reactions 1 assignee View on GitHub

@joaomai is already working on this.

Since Aug 31, 2026.

mpl
Dominant language
Verilog
Stars
3.1k
Forks
1k
Avg merge
2d 23h
Merged PRs (30d)
136

Description

Describe the bug

The file written by rtl_macro_placer -write_macro_placement does not round-trip through place_macro: the Snapper picks the track/manufacturing-grid position closest to the pin center, rounding up when in doubt, so a macro at the top or right core edge is committed with its bounding box a snap residue past the core boundary. place_macro then rejects the placer's own output with MPL-0034, which breaks every re-injection workflow built on MACRO_PLACEMENT_TCL.

To reproduce

From src/mpl/test (uses only in-repo test files; the pin constraint is the same one orientation_improve1.tcl uses and drives the macro to the boundary):

read_lef Nangate45/Nangate45.lef
read_lef testcases/orientation_improve1.lef
read_def testcases/orientation_improve1.def
set_io_pin_constraint -direction INPUT -region right:10-30*
set_thread_count 0
rtl_macro_placer -report_directory rtlmp_rpt -write_macro_placement mp.tcl
set core [[ord::get_db_block] getCoreArea]
foreach inst [[ord::get_db_block] getInsts] {
  if { [[$inst getMaster] isBlock] } {
    set b [$inst getBBox]
    puts "[$inst getName] bbox ([$b xMin] [$b yMin]) ([$b xMax] [$b yMax]),\
      core ([$core xMin] [$core yMin]) ([$core xMax] [$core yMax])"
  }
}
source mp.tcl

Observed:

MACRO_1 bbox (21680 21330) (221680 221330), core (18000 19600) (221680 221200)
[ERROR MPL-0034] Cannot place MACRO_1 at (10.84, 10.665) (110.84, 110.665), outside of the core (9, 9.8) (110.84, 110.6).

The committed bbox is 130 dbu (65nm) past the core top. Expected: the snap search only considers positions that keep the macro inside the core (nudging inward by manufacturing-grid steps when no aligned position qualifies), so write_macro_placement -> place_macro round-trips exactly.

Several checked-in test goldens encode such out-of-core placements today (boundary_push1, fixed_macros2, halos5, orientation_improve1/3 — verify by comparing each macro bbox against dbBlock::getCoreArea() in the .defok).

A secondary observation while reducing this: when the placement file is re-applied to a design whose macros are still placed, place_macro reports the macro overlapping itself (MPL-0041 ... Found overlap with other macros: MACRO_1) — findOverlappedMacros() does not exclude the instance being placed.

Environment

OpenROAD master 3ca581e384324a1d09a53d29b00d4fad1c365e70, Linux x86_64, bazel build.

We currently carry a containment fix downstream as a patch in bazel-orfs and can upstream it once the ongoing mpl churn settles.

🤖 Generated with Claude Code

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.