The idea: first choose where each cell goes, then draw the wires
After synthesis a chip is a netlist: a list of library cells (gates and flip-flops) and the nets that join their pins. The back end turns it into geometry in two big steps. Placement decides where every cell sits. Routing draws the metal wires of every net. Both are hard search problems with millions of cells, so the tools use fast estimates and simple, repeated moves. The page shows the classic methods on a small design: 8 cells, 10 nets, 2 rows.
Where this fits in the whole flow (floorplan, placement, clock tree, routing, signoff on the SKY130 library) is on ASIC Design Flow. This page opens up two of its boxes.
Rows, sites and rails
Every cell of a standard-cell library has the same height. Its power and ground wires run along its top and bottom edge, so cells placed side by side join their rails into one long VDD rail and one GND rail. Every second row is flipped upside down; then two rows share one rail. A row is cut into sites, and every cell is a whole number of sites wide (in SKY130 a site is 0.46 × 2.72 µm). Here: INV 2 sites, NAND2 and NOR2 3, the D flip-flop 6. The 8 cells fill 28 of the 40 sites, 70 % utilization; the free sites leave room for wires and later fixes.
The page uses one routing grid for everything: 22 columns × 9 tracks, one unit of length per track. The rails are metal1, so metal1 cannot run along tracks 0, 4 and 8. The I/O pins a, b, y, z sit in the columns at both ends.
Scoring a placement: half-perimeter wirelength
A placer tries thousands of placements and cannot route each one. It uses an estimate instead: for each net, draw the smallest box around its pins and take half its perimeter, HPWL = (max x − min x) + (max y − min y). For a 2-pin net that is exactly the shortest wire; for 3 pins it is exactly the shortest tree. For more pins it is a little short, but it is fast and smooth, and the real wirelength follows it. The score of a placement is the sum over all nets.
The random starting placement has total HPWL 98. Net n2 (U3.Y → U4.A) alone costs 18, because U3 is at the far left of row 2 and U4 at the far right of row 1. (Demo: HPWL of the random placement.)
Placement by simulated annealing
Simulated annealing (the TimberWolf placer of the 1980s worked this way) starts from any placement and repeats one move: pick two cells and swap them. Let Δ be the change in total HPWL.
- Δ ≤ 0 (no worse): keep the swap.
- Δ > 0 (worse): draw a random r between 0 and 1 and keep the swap only if r < e^(−Δ/T).
T is the temperature. While it is high, even bad swaps often pass, so the search can leave a dead end. T falls a little after each batch of swaps, and at the end only improvements are kept. The page starts at T = 8, does 8 swaps per temperature and multiplies T by 0.85 until it is below 0.5: 18 temperatures, 144 swaps. The cells sit on 4 slots per row; the random numbers come from a fixed seed, so every run (and Undo) is the same.
| Swap at T = 8 | HPWL | Δ | e^(−Δ/8) | r | Result |
|---|---|---|---|---|---|
| U1 ↔ FF2 | 98 → 107 | +9 | 0.325 | 0.660 | rejected |
| U5 ↔ FF1 | 98 → 103 | +5 | 0.535 | 0.069 | kept (uphill) |
| U6 ↔ U1 | 103 → 118 | +15 | 0.153 | 0.935 | rejected |
| FF1 ↔ U1 | 103 → 95 | −8 | kept | ||
| U5 ↔ FF1 | 95 → 94 | −1 | kept | ||
| U3 ↔ U1 | 94 → 86 | −8 | kept | ||
| FF2 ↔ U1 | 86 → 110 | +24 | 0.050 | 0.592 | rejected |
| U3 ↔ FF1 | 86 → 96 | +10 | 0.287 | 0.208 | kept (uphill) |
The first temperature ends at 96: worse than the 86 it passed through, which is what annealing allows. (Demo: one temperature, swap by swap.) Over all 144 swaps, 23 are kept (7 of them uphill) and 121 rejected. HPWL goes 98 → 61; on the way it sits at 69 for six temperatures and only reaches 61 at T = 0.59. A search of all 8! = 40 320 ways to put the cells on the slots finds no placement below 61. (Demo: anneal to the end.) How annealing works in general, and how it compares with plain hill climbing, is on Simulated Annealing.
Real placers today mostly use analytic (quadratic or electrostatic) global placement, which treats wirelength as a smooth function of real-valued positions and moves all cells at once. Annealing is still the clearest way to see what a placer optimizes.
Legalization
The slots are 5 sites wide, but a flip-flop is 6. After annealing, FF1 in row 2 runs one site into U2's slot, and FF2 in row 1 runs one site past the end of the row. Global placement allows such overlaps; legalization then moves each cell to the nearest legal spot: inside its row, on whole sites, with no overlap. The page does it row by row in two sweeps: left to right, push each cell right of the one before it; right to left, pull each cell back inside the row end. U2 moves from site 16 to 17 and FF2 from 16 to 15. HPWL goes 61 → 60. (Demo: legalize.) A detailed placement step would then try small local swaps again on the legal rows.
Lee's maze router on two layers
Lee's algorithm (1961) is a breadth-first search on the routing grid. Number the source 0. Every free neighbour gets 1, their free neighbours 2, and so on: a wavefront that spreads out like a ripple. The first time the wave touches the target, its number is the length of the shortest path. The backtrace walks from the target to a neighbour numbered one less, again and again, until it is back at 0. Where there is a choice, keep going straight: fewer turns.
A chip has several metal layers, each with a preferred direction. Here metal1 runs horizontally and metal2 vertically, and a via joins them at one point. So the search state is (x, y, layer): a step along metal1 goes left or right, a step along metal2 up or down, and a via changes layer in place. The page counts a via as free in the wave and lists the vias separately; real routers give vias a cost because they add resistance and can fail. Because the layers differ, two nets can cross: one on metal1, the other above it on metal2.
Net n1 (U1.Y → U5.B), routed first on the empty grid, takes a wave of 6 levels that numbers 52 points. The backtrace climbs from U1.Y on metal2, runs 5 steps along metal1 on track 1 and ends at U5.B: 6 units of wire and 2 vias. (Demo: Lee routing of net n1.) A 3-pin net is routed one pin at a time: after the first connection, the next wave starts from every point the net already owns. The grid searches on Grid Pathfinding (BFS, Dijkstra, A*) are the same search; maze routers use A* and cost functions in the same way to go faster.
Congestion: detours, and rip-up and reroute
Once a net is routed, its points are taken on their layers, so later nets must go around. The order matters; routers often take short nets first, because they have few ways to go. On the annealed and legalized placement, in that order (n5, n4, n2, n3, n6, b, n1, a, q1, q2), every net routes at its HPWL except net a, which is one unit longer because it is built pin by pin. Total: 61 units of wire and 17 vias, against an HPWL of 60. (Demo: route all nets.)
Route the random placement instead (legalized first: HPWL 103) and the nets get in each other's way:
- n4 (U4.Y → FF1.D) has HPWL 14 but needs 26 units: a detour of 12 around wires already there. q2 needs 17 for an HPWL of 14.
- n2, routed last, is blocked: the wave dies out without reaching U4.A. The router rips up n4 (the first routed net whose removal opens a path), routes n2 at its HPWL of 20, and routes n4 again (26 units).
- Total: 118 units of wire and 34 vias. The placement that looked twice as bad by HPWL needs twice the wire, and a router fix-up on top.
(Demo: route the random placement.) Real routers do this on a much larger scale. A global router first plans each net through coarse tiles and spreads the demand (the congestion map); the detailed router then draws the tracks, and negotiated rip-up and reroute (PathFinder) raises the cost of crowded spots on every pass until no two nets share a track. In OpenROAD these are FastRoute and TritonRoute.
The clock net is routed differently
The page leaves out the flip-flops' clock pins on purpose. The clock net reaches every flip-flop, and what matters there is not total length but that the edge arrives everywhere at the same time (low skew). Clock tree synthesis builds it before signal routing, for example as an H-tree: each H splits the wire into four equal branches, so every path from the root to a sink has the same length. Real tools insert buffers along the tree and balance the delays, not just the lengths; ASIC Design Flow shows a 10 ps skew after TritonCTS.
After routing
The routed wires are extracted into resistances and capacitances, and static timing analysis checks every path with them. A long detour like n4's adds delay; a failing path is fixed by upsizing cells (logical effort), moving them, or rerouting. Then DRC and LVS check the final geometry, which CMOS Layout, DRC and LVS shows on a single gate. Which cells are in the netlist to begin with is decided by technology mapping.
See also CMOS Layout, DRC and LVS, which draws one cell with its VDD and GND rails and checks it with DRC and LVS.
What the page leaves out
- Cells snap to 4 fixed slots per row during annealing; real placers move cells to any site, change rows freely, and add timing and congestion to the cost.
- Analytic global placement, detailed placement, filler and tap cells, and the power grid above the rails.
- Pins are single grid points, the clock pins are left out, and the router uses only two layers with one fixed direction each; real chips have 5 to 15 layers and design rules for spacing and via enclosure.
- Vias are free in the wave; global routing, congestion maps and negotiated rip-up and reroute are described, not drawn.
- Lengths are counted in tracks; the numbers are a teaching model, not SKY130 measurements.
On the mind map
References
Andrew B. Kahng, Jens Lienig, Igor L. Markov and Jin Hu, VLSI Physical Design: From Graph Partitioning to Timing Closure, Springer, 2011, chapters 4 (placement), 5–6 (global and detailed routing)
C. Y. Lee, "An Algorithm for Path Connections and Its Applications", IRE Transactions on Electronic Computers EC-10(3), 1961
Carl Sechen and Alberto Sangiovanni-Vincentelli, "The TimberWolf Placement and Routing Package", IEEE Journal of Solid-State Circuits 20(2), 1985
OpenROAD documentation: global placement, detailed placement, FastRoute and TritonRoute