Problemcore
Placement legalization
Also called legalization.
Move the cells of a global placement into legal sites in rows, without overlap and with little total movement.
Placement legalization is the step of chip design that takes a global placement, in which the standard cells may overlap and sit between sites, and moves every cell onto a site of a row so that no two cells overlap, with as little movement as possible. It comes after global placement and before detailed placement in the flow of the placement problem. The global placement already has a good wirelength, so the legalizer should change it little; the total movement stands in for the wirelength that the movement destroys. The problem is NP-hard in the strong sense, even to decide whether any legal placement exists. It is easy in special cases: one row with a fixed order of cells, or cells all one site wide. This page states the problem; the methods are on the pages of the legalizers.
In plain words
A global placer puts the parts of a circuit roughly where they should be, but some lie on top of each other and many are not on the grid of allowed places. Legalization slides each part to an allowed place in a row, so that no two parts touch the same place, and moves the parts as little as it can.
If there is plenty of room, this is easy. If the rows are nearly full, it is like packing boxes into shelves of a fixed length, which is hard. Even when the order of the parts in a row is wrong, moving them a little in a better order can be cheaper.
Definition
Input.
- Rows at the heights , each with the sites up to its width , and fixed blockages that no cell may overlap. Below, .
- For each cell a width , a multiple of the site width, the row height , a weight , and a global position of its lower left corner, from global placement.
Output. A legal placement : each is a row height, each is a site with and , the cell does not overlap a blockage, and the intervals of the cells of a row are pairwise disjoint.
Objective. Minimize the total weighted movement
where is the Manhattan distance , or the squared Euclidean distance . The page or tool must say which one it uses.
Feasibility. The decision version asks whether a legal placement exists at all. A legal placement always fixes a row for each cell and an order of the cells in each row. The rest of the problem, given these two choices, is a small convex program per row.
Variants
- Maximum movement. Minimize , or bound it by a constant as a constraint, so that no single cell moves far. This protects timing better than the total.
- Fixed rows and order. Give the row of each cell and the order in each row. Then the rows are independent, and each is the convex problem: minimize subject to , and , with real . With the squared cost it is isotonic regression with bounds after the shift . With the linear cost it is one-machine scheduling with earliness and tardiness penalties for a fixed job order.
- One row, free order. The order is part of the answer. With the cell as a job of length and due date , the movement is the earliness or tardiness of the job, so this is one-machine scheduling with earliness and tardiness costs, with the row ends as limits.
- Unit cells. All cells are one site wide, as in a gate array. Each cell takes one site, so a legal placement is an injective map from cells to sites.
- Mixed heights and macros. Cells of two or more row heights must take the same in several adjacent rows, and large macros must be placed or fixed first.
- Incremental legalization. After an engineering change, a few cells are new or larger, and the legalizer must move few others. This is the same problem with most cells already legal.
Examples
The order matters. One row of 7 sites and three cells of weight 1: of width 3 at , of width 1 at , and of width 2 at . For each of the 6 orders, the least Manhattan movement on integer sites, by enumeration of all positions:
| order | best positions | least movement |
|---|---|---|
The order of the global is , with the least movement . The orders and give : the narrow cell is cheaper to move to the left of the wide cell than to push past it. A legalizer that keeps the order of , as Tetris and Abacus do, cannot find them.
Room is not enough. Two rows of 5 sites, so the free width is 10. Cells of widths 3, 3, 2, 2 have the total 10 and fit, with in each row. Cells of widths 4, 4, 1, 1 also fit, with in each row. Cells of widths 3, 3, 3, 1 also have the total 10, but no row holds two cells of width 3, so three cells of width 3 need three rows, and no legal placement exists.
Known algorithms
- Tetris legalization (Hill 2002). Sorts the cells by and puts each at the cheapest place after the frontier of a row. ; legal when it succeeds; can fail when room exists; no bound on the movement.
- Abacus legalization (Spindler, Schlichtmann and Johannes 2008). The same order, but each row is placed exactly for its fixed order by merging clusters. Legal when it succeeds; exact only for the fixed rows and orders; measured to move cells much less than Tetris.
- Fixed order, linear cost. Garey, Tarjan and Wilfong (1988) solve the one-row problem with a fixed order in time.
- Flow-based legalization. Brenner and Vygen (2004) first move cell area from overfull regions to free ones by a minimum cost flow, then place the rows. Later legalizers use flows or linear programs in the same way.
- Unit cells. The assignment problem between cells and sites, solved by the Hungarian algorithm, gives the exact least movement.
The legalizers are compared by their total and maximum movement and by the HPWL after legalization on the ISPD 2005 and 2006 placement contest benchmarks. Those are measurements; only the special cases have proofs.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Abacus legalization | O(n log n + K n k) worst | O(n + K) extra | deterministicnot exactiterative | 1 language |
| Tetris legalization | O(n log n + n K) worst · average · best | O(n + K) extra | deterministicnot exactiterative | 1 language |
Bounds
- Strongly NP-complete feasibility. Deciding whether a legal placement exists is NP-complete in the strong sense, already with no blockages, by the reduction from 3-partition below. So no algorithm runs in time polynomial in , and unless P = NP, and the least movement is strongly NP-hard, because any algorithm for it would decide feasibility.
- In NP. A placement on sites is a certificate of polynomial size, checked in polynomial time.
- One row. A legal placement exists if and only if (put the cells side by side from 0), with no blockage in the row.
- Fixed rows and order. Polynomial: per row of cells for the squared cost with real positions (Abacus PlaceRow, the pool adjacent violators idea), and for the linear cost (Garey, Tarjan and Wilfong).
- Unit cells. Polynomial for any cost per cell and site: the Hungarian algorithm on cells and free sites runs in time.
Reductions
- From 3-partition. Given positive integers with sum and (the 3-partition problem), make rows of sites and a cell of width for each number, at any global position. A legal placement puts cells of total width at most in each row, and the total is , so each row holds width exactly ; the bounds on force exactly three cells per row. So a legal placement exists if and only if the numbers split into triples of sum . The rows have sites, so the instance has a size polynomial in . That is allowed because 3-partition is NP-complete in the strong sense: it stays NP-complete when is at most a polynomial in . This is also the reduction from bin packing.
- Unit cells to assignment. With , a legal placement is an injective map from cells to free sites, and is a sum of costs . So legalization is a rectangular assignment problem.
- Fixed order to isotonic regression. With fixed rows and orders and the squared cost, the substitution turns the constraints into , isotonic regression with bounds on the targets .
- To detailed placement. Legalization keeps the wirelength of the global placement only as far as movement predicts it. Detailed placement then improves the wirelength of the legal result directly.
Applications
- Every standard cell flow. Global placers (analytical, electrostatics-based, SimPL) produce overlap by design, and legalization turns their output into a placement that routing can use.
- Inside global placement. Some placers legalize many times during global placement to measure the wirelength of a legal placement and to steer the next step.
- Engineering changes and timing fixes. After gate sizing or buffer insertion, larger or new cells overlap their neighbors, and an incremental legalizer fixes the overlap with small movement.
References
- Andrew B. Kahng, Jens Lienig, Igor L. Markov and Jin Hu, VLSI Physical Design, From Graph Partitioning to Timing Closure, second edition, Springer, 2022, Chapter 4, Global and Detailed Placement (legalization after global placement; general locator)
- Peter Spindler, Ulf Schlichtmann and Frank M. Johannes, Abacus, fast legalization of standard cell circuits with minimal movement, Proceedings of the International Symposium on Physical Design (ISPD), 47 to 53, 2008, the movement objective, the one-row problem with a fixed order as a quadratic program, and the comparison with Tetris
- Ulrich Brenner and Jens Vygen, Legalizing a placement with minimum total movement, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 23(12), 1597 to 1613, 2004, the problem of least total movement, and a legalizer that balances the cell area between regions by a minimum cost flow (general locator)
- Michael R. Garey, Robert E. Tarjan and Gordon T. Wilfong, One-processor scheduling with symmetric earliness and tardiness penalties, Mathematics of Operations Research 13(2), 330 to 348, 1988, the algorithm in O(n log n) time for a fixed order of the jobs, which is the one-row problem with linear movement
- Michael R. Garey and David S. Johnson, Computers and Intractability, W. H. Freeman, 1979, Appendix, problem SP15 (3-partition, NP-complete in the strong sense)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag A010Z6 Edit this page History Report an error Markdown