mpl: check_macro_placement, a fail-early macro placement check at floorplan (no outputs, no annealing): roadmap

Aperta
#11,495 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend, tooling

Direzione di ricerca

The issue describes adding a new command check_macro_placement to the mpl (macro placer) module. Start by examining the existing feasibility checks in ClusteringEngine::init() and setFloorplanShape() in the OpenROAD source. The roadmap lists specific PRs to implement; the first step is understanding the current macro placement flow in floorplan.tcl and macro_place.tcl scripts. 'Done' means the new command runs the checks without clustering or annealing and leaves the ODB unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Why

This is to stop AI squirrel chasing. When a floorplan or macro-placement problem surfaces hours later, as an error from placement, CTS or routing, an AI agent (or a human) chases it in the tool that reported it. Each squirrel below came from taking XiangShan through the flow; every one was decidable at floorplan, in seconds, from geometry that was already known.

Situation today

ORFS's floorplan stage is four steps:

Step Script Does Checks
2_1 floorplan.tcl load, initialize_floorplan, tracks, repair_tie_fanout, remove_buffers or repair_timing -setup, IO constraints, write ODB init method exclusivity, check_setup
2_2 macro_place.tcl MACRO_PLACEMENT_TCL and/or rtl_macro_placer only what rtl_macro_placer checks for itself
2_3 tapcell.tcl tap and endcap cells
2_4 pdn.tcl power grid PDN errors, found here
  • The expensive netlist work in 2_1 runs before any macro is placed, so a macro-placement problem costs the whole of 2_1 first.
  • Nothing checks the macro placement itself. check_placement allows macro-on-macro overlap by design (Opendp::overlap: "BLOCK/BLOCK overlaps allowed"). It can only run after global placement today; check_placement -fixed_only (OpenROAD #11431, in review) is the first piece that lets it run at floorplan.
  • pdngen -check_only checks the PDN configuration, not the geometry; strap-fit errors such as PDN-0185 appear only when the grid is built, in 2_4.
  • rtl_macro_placer's own checks (MPL-0016, MPL-0050, MPL-0065) run only when it runs, and until #11491 MPL-0050 fired even when every macro was fixed.

The problem: late, misattributed failures

Squirrel (where it surfaced, what it cost) Cause, decidable at floorplan Early check
MPL-0050 in 2_2, after 2_1's netlist work fixed standard cells, every macro fixed fixed upstream (#11491)
MPL-0034: place_macro rejects rtl_macro_placer's own -write_macro_placement output (#11278) snap residue past the core edge macro inside core, after snapping
PDN-0185 in 2_4 core too small for the strap pitch and offset build the grid right after macro placement
DRT-0073 "No access point" in global route's pin_access, hours in, one pin per block a macro pin with no access point pin access on macro masters at floorplan
GRT-0228 edge overflow in route-0 inside an 11 um channel carrying 1 198 macro-to-macro pins channel narrower than the pins facing it need channel capacity: pins facing a gap vs tracks in it
82 minutes of diamond search in detailed placement; hours of post-CTS legalisation channels between macros too narrow for the cells placed there free sites vs demand per window (Hall's condition)
macros that overlap each other or each other's halos placement script or plan error macro and halo overlap

Proposal

Add a macro placement check to floorplan.tcl that has no outputs and runs no annealing, right after initialize_floorplan and the tracks, before the stage's expensive netlist work. Macro placement itself stays where it is, in 2_2, unchanged, so QoR does not move.

The check, an OpenROAD command (check_macro_placement, in mpl):

  • runs the feasibility checks rtl_macro_placer runs before it clusters (movable cells fit in the macro placement area, MPL-0065; macro plus halo area within the floorplan, MPL-0016; fence inside the core, MPL-0068; fixed standard cells in the macro placement area when there are macros to place, MPL-0050), and nothing after them: no clustering, no annealing, no report directory;
  • with -macro_placement_tcl file, sources that placement inside an odb ECO journal (dbDatabase::beginEco / undoEco, as rsz already does), so place_macro's own validation runs on every macro, adds the checks place_macro does not make (halo overlap, legal orientation for the site), and rolls back;
  • fails hard with a message ID, the first offenders by name and coordinate, and what to change; FLOORPLAN_CHECKS=warn in ORFS downgrades to warnings for exploration;
  • leaves the ODB exactly as it found it, so 2_1's output does not change.
One source of truth: no check is written twice

A check that can disagree with the placer is a new squirrel. So check_macro_placement adds no second copy of any rule; every rule lives in one function that the placer, place_macro and the check all call:

  • The feasibility checks move out of ClusteringEngine::init() and setFloorplanShape() (MPL-0016, 0050, 0065, 0068) into one function. rtl_macro_placer calls it where it does today; check_macro_placement calls it and stops.
  • The placement rules stay in MacroPlacer::placeMacro() (MPL-0034 inside the core, MPL-0041 no macro overlap, the Snapper). The check reaches them by sourcing the placement script, not by re-implementing them. Today placeMacro() tests core containment before snapping and commits the snapped position, which is how rtl_macro_placer -write_macro_placement can write a placement place_macro then rejects (#11278). Testing the snapped position, in that one function, makes the check, the placer, the writer and the reader agree.
  • New rules (halo overlap, orientation) go into that same function, so place_macro enforces them as well, not only the check.
  • In ORFS, FLOORPLAN_CHECKS is declared once in variables.yaml, and floorplan.tcl and macro_place.tcl call one command; neither re-implements a check in Tcl.
  • Tests assert the message IDs, so a check and its message cannot drift apart.

2_2 then places macros as today, and runs the same command without the ECO step after rtl_macro_placer, as a post-check, before tap cells and the power grid.

More checks join the same fail-early point as they land:

Check Catches Where it belongs When it can run
macro feasibility (MPL-0016/0050/0065/0068 without annealing) infeasible macro sets, fixed cells in the way mpl: check_macro_placement 2_1, before the expensive work
a MACRO_PLACEMENT_TCL plan: place_macro's own checks (inside core after snapping, macro overlap) plus halo overlap and orientation MPL-0034, MPL-0041, overlaps mpl: check_macro_placement -macro_placement_tcl, ECO journal 2_1
fixed-instance placement legality overlaps, off-row, off-site fixed cells check_placement -fixed_only (#11431) 2_1 for fixed cells; after 2_2 for placed macros
area budget after macros standard cells that cannot fit at PLACE_DENSITY mpl, part of the feasibility checks 2_1
IO pin budget more pins than slots on the allowed edges and layers ppl: check before placing 2_1
power grid fits PDN-0185 and friends build the grid in an ECO journal and roll back, or leave it in 2_4 2_1 with a plan, else 2_4
macro pin access DRT-0073 drt: pin_access limited to macro masters 2_1
channel capacity between macros GRT-0228 research first after macros are placed
window capacity legaliser-hours in narrow channels dpl: the up-front Hall check after macros are placed

Roadmap: one pull request per concern

OpenROAD:

  1. check_placement -fixed_only: #11431, in review; a dependency, not ours.
  2. mpl: extract the pre-clustering feasibility checks from ClusteringEngine into one function and add check_macro_placement, which calls it: no clustering, no annealing, no outputs. rtl_macro_placer's behaviour and messages are unchanged. Pass/fail tests: each check fires with its message ID; a feasible design passes; the ODB is unchanged afterwards.
  3. mpl: placeMacro() tests core containment on the snapped position (fixes #11278).
  4. mpl: check_macro_placement -macro_placement_tcl: source a placement script in an ECO journal so place_macro's own checks run, then roll back. Tests: MPL-0034 and MPL-0041 fire through the check; the ODB is unchanged afterwards.
  5. mpl: halo overlap and orientation rules in placeMacro(), enforced by place_macro and therefore by the check.
  6. ppl: pin budget check before placing pins, the same rule place_pins applies.
  7. drt: pin_access limited to macro masters.
  8. dpl: the window-capacity (Hall) check as a command, the same function the legaliser would call.
  9. Channel capacity between macros: research, then a proposal.

ORFS:

  1. floorplan.tcl runs check_macro_placement (with -macro_placement_tcl when MACRO_PLACEMENT_TCL is set) right after the floorplan and tracks exist; FLOORPLAN_CHECKS=warn downgrades. 2_2 runs it again after rtl_macro_placer.
  2. Each later OpenROAD check joins the same point as it lands.

Open questions for maintainers

  • The ECO journal was built for the resizer's moves; is it the right tool for rolling back a sourced placement script (place_macro, blockages, halos), or should the check parse the script's placements instead?
  • Should the halo checks use MACRO_PLACE_HALO as the flow sets it, or the halos stored on the instances?
  • Should a failing check be an error by default in ORFS, with FLOORPLAN_CHECKS=warn to opt out, or the other way around for a release?

Future PRs for this roadmap refer to this issue.

🤖 Generated with Claude Code

Lingua principale
Verilog
Stelle
3.4k
Fork
1.1k
Merge medio
3g 11h
PR unite (30g)
245

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di The-OpenROAD-Project/OpenROAD

Tutte le issue di The-OpenROAD-Project/OpenROAD

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.