Legalising a Global Placement
Global placement produces a continuous, balanced cell distribution. However, the resulting layout is not physically manufacturable. Cells occupy fractional coordinates, straddle standard cell rows, and exhibit minor physical overlaps.
RePlAce operates in a continuous coordinate domain to enable smooth gradient optimization. Snapping cells to discrete sites during global placement would cause discontinuous jumps and disrupt convergence. Therefore, global placement defers physical legality to a dedicated detailed placement stage. OpenROAD executes this step using the OpenDP legalization engine.
Functional Objectives of OpenDP
OpenDP performs two primary tasks:
- Snapping to rows and sites: Every standard cell is aligned to a valid row boundary and discrete site pitch.
- Overlap resolution: Cells are separated so that no two cells occupy overlapping layout sites.
Figure 1 illustrates standard cell positions before and after legalization.
OpenDP minimizes total cell displacement during legalization. Large cell movements increase total wire length and disturb optimized timing paths. OpenDP uses dynamic programming techniques, similar to the Abacus algorithm, to assign cells to nearest legal sites.
Coordinate Snapping Calculation
In the sky130_fd_sc_hd library, standard cell rows have a height of $2.72\ \mu\text{m}$.
The horizontal site pitch measures $0.46\ \mu\text{m}$.
Assume a cell emerges from global placement at continuous coordinates:
x = 41.18 um
y = 19.70 um
Snap coordinate $y$ to the nearest integer row multiple ($2.72\ \mu\text{m}$): $$19.70 / 2.72 = 7.24 \implies \text{Row } 7 \implies y_{\text{legal}} = 7 \times 2.72 = 19.04\ \mu\text{m}$$
Snap coordinate $x$ to the nearest integer site multiple ($0.46\ \mu\text{m}$): $$41.18 / 0.46 = 89.52 \implies \text{Site } 90 \implies x_{\text{legal}} = 90 \times 0.46 = 41.40\ \mu\text{m}$$
The cell shifts from $(41.18, 19.70)$ to $(41.40, 19.04)$, resulting in a total displacement of $0.68\ \mu\text{m}$. OpenDP calculates these assignments across all cells while resolving site conflicts. A converged global placement requires only small average displacements. Large displacements indicate that global placement failed to reach spatial equilibrium.
Practice Exercise
A cell emerges from global placement at $x = 8.05\ \mu\text{m}$ and $y = 13.10\ \mu\text{m}$. Calculate its legalized coordinates on a grid with a row height of $2.72\ \mu\text{m}$ and site pitch of $0.46\ \mu\text{m}$.
Solution
Row calculation: $$13.10 / 2.72 = 4.816 \implies \text{Row } 5 \implies y = 5 \times 2.72 = 13.60\ \mu\text{m}$$
Site calculation: $$8.05 / 0.46 = 17.5 \implies \text{Site } 18 \implies x = 18 \times 0.46 = 8.28\ \mu\text{m}$$
The legalized position is $(8.28, 13.60)\ \mu\text{m}$. The displacement is approximately $0.55\ \mu\text{m}$.
Legalization places every cell on a valid site. The next article explains cell orientation and row flipping for power rail sharing.