Algorithm Search⌘K

Problemcore

Floorplanning

Also called floorplan design.

Place rectangular blocks of fixed or flexible shapes without overlap so the chip area and the wire length between blocks are small.

Floorplanning is the first step of the physical design of a chip. The design is split into large blocks, such as processor cores, memories and analog parts, and each block has a size, or a fixed area with a choice of shapes. Floorplanning places these blocks as rectangles in the plane, with no two of them overlapping, so that the chip is small and the wires between the blocks are short. It comes before the placement of the standard cells, which then fill the space between and inside the blocks. The problem contains bin packing and strip packing, so it is strongly NP-hard, and in practice it is solved by a search over a combinatorial representation, such as a slicing tree or a sequence pair, with an exact computation of the coordinates for each candidate.

In plain words

Think of a house plan. You have a list of rooms, each with a size, and some rooms must be close to each other because people walk between them often. You want a plan in which no two rooms overlap, the house is small, and the walks are short. A chip is the same: the rooms are large circuit blocks, and the walks are the wires between them. Some blocks have a fixed size, and some can be made long and thin or short and wide. Very often the outline of the chip is given in advance, and then all blocks must fit inside it. Even small versions of this task are hard to solve exactly, so programs try many plans in a clever order and keep the best one.

Definition

Input.

  • Blocks 1,…,n1, \ldots, n. A hard block ii has a width wiw_i and a height hih_i, and may be allowed to turn by a quarter turn. A soft block ii has an area AiA_i and limits ri−≤hi/wi≤ri+r_i^- \le h_i / w_i \le r_i^+ on its aspect ratio, so its shape is free on the curve wihi=Aiw_i h_i = A_i between these limits.
  • A netlist: a hypergraph whose vertices are the blocks and the fixed pins of the chip, and whose edges, the nets, have weights ce≥0c_e \ge 0.
  • Weights α,β≥0\alpha, \beta \ge 0 of area and wire length, or a fixed outline of width W∗W^* and height H∗H^*.

Output. For each block a shape (wi,hi)(w_i, h_i) that it allows and a position (xi,yi)(x_i, y_i) of its lower-left corner, with xi,yi≥0x_i, y_i \ge 0, such that the rectangles [xi,xi+wi]×[yi,yi+hi][x_i, x_i + w_i] \times [y_i, y_i + h_i] have disjoint interiors.

Objective. Let W=max⁡i(xi+wi)W = \max_i (x_i + w_i) and H=max⁡i(yi+hi)H = \max_i (y_i + h_i). The classical form minimizes

α WH+β∑ece HPWL(e),\alpha \, W H + \beta \sum_{e} c_e \, \mathrm{HPWL}(e),

where HPWL(e)\mathrm{HPWL}(e) is the half-perimeter wire length of the net ee, with each block taken at its center. The fixed-outline form requires W≤W∗W \le W^* and H≤H∗H \le H^* and minimizes the wire length alone.

Decision version. Given hard blocks with integer sizes and fixed orientations and an outline W∗×H∗W^* \times H^*, is there a packing of all blocks inside the outline?

Variants

  • Hard or soft blocks. Hard blocks give a choice of at most two shapes each, soft blocks a continuum. Mixed sets of both are common.
  • Rotation. Hard blocks with a free orientation have two shapes, and mirror images are allowed as well when the pins of the blocks permit it.
  • Fixed outline. The outline is given by the chip size or by the parent block in a hierarchical flow. This is the usual modern form, and it is harder for local search, since many candidates do not fit at all (Adya and Markov 2003).
  • Slicing only. The floorplan must be a slicing floorplan. The best sizes of the blocks are then found exactly by shape functions, at the cost of some area.
  • Extra constraints. Preplaced blocks, blocks on the boundary, alignment of blocks, a maximum distance between two blocks, and keep-out regions. Many of them are difference constraints on the coordinates and fit into the constraint graphs.
  • Other costs. Timing on critical nets, routing congestion, power supply and heat, and the number of layers in 3D chips.

Examples

Three blocks. Take AA of size 2×22 \times 2, BB of size 1×21 \times 2 and CC of size 1×31 \times 3 (width times height), with no nets, so that only the area counts. The blocks have a total area of 99.

  • Without rotation the least area is 1010. Put BB at (0,0)(0, 0), CC at (1,0)(1, 0) and AA at (0,3)(0, 3): the chip is 2×52 \times 5, with one empty unit square at [0,1]×[2,3][0, 1] \times [2, 3]. No packing has a smaller area. Every packing can be pushed down and to the left until each block touches the floor, the left wall or another block, without making the chip larger, and then WW and HH are sums of block sides, so they are integers. Since W≥2W \ge 2 for AA and H≥3H \ge 3 for CC, an area at most 99 leaves only the 3×33 \times 3 square, with no empty space. There CC fills a whole column. If CC is not at a side, the two parts next to it are narrower than 22, and AA fits in neither. So CC is at a side and AA and BB share a 2×32 \times 3 part. The block AA fills the width of this part, so BB is above or below it, and the heights add up to 4>34 > 3.
  • With rotation the least area is 99. Turn BB to 2×12 \times 1 and put it at (0,0)(0, 0), AA at (0,1)(0, 1) and CC at (2,0)(2, 0): the 3×33 \times 3 square is full.

Area against wire length. Add a net {A,C}\{A, C\} of weight cc to the rotated example. In the 3×33 \times 3 packing the centers of AA and CC are at (1,2)(1, 2) and (2.5,1.5)(2.5, 1.5), so the net has length 1.5+0.5=21.5 + 0.5 = 2 and the cost is 9α+2βc9 \alpha + 2 \beta c. Now put CC at (2,0)(2, 0), AA at (0,0.5)(0, 0.5) and the turned BB at (0,2.5)(0, 2.5). The centers of AA and CC are at the same height, the net has length 1.51.5, and the chip is 3×3.53 \times 3.5, with the cost 10.5α+1.5βc10.5 \alpha + 1.5 \beta c. The second packing is better exactly when βc>3α\beta c > 3 \alpha, so the weights decide whether area or wire length wins.

A pinwheel. Two 1×21 \times 2 blocks, two 2×12 \times 1 blocks and a 1×11 \times 1 block fill a 3×33 \times 3 square in a pinwheel pattern, but every slicing floorplan of them with fixed orientations has area at least 1010, as the slicing floorplan page shows. So the slicing restriction can cost area.

Known algorithms

  • Simulated annealing over slicing trees. Wong and Liu (1986) search over normalized Polish expressions with simulated annealing, and size each candidate with shape functions (Wong-Liu floorplanning, Stockmeyer floorplan sizing).
  • Non-slicing representations. The sequence pair (Murata and others, 1995), the O-tree (Guo and others, 1999), the B*-tree (Chang and others, 2000) and the corner block list (Hong and others, 2000) each map a code to a packing in O(nlog⁡n)O(n \log n) or O(n)O(n) time, and annealing or other local search moves between codes.
  • Exact search. Every packing has a sequence pair whose packing is no wider and no higher (Murata and others). So a search over all (n!)2(n!)^2 sequence pairs, with all orientations, finds the least area exactly, but only for small nn.
  • Integer programming. For each pair of blocks, four binary choices say which of left, right, below and above holds, and big-M constraints turn the chosen relation into a linear inequality. This gives a mixed integer program whose size is O(n2)O(n^2), solved exactly for small nn or used to refine a part of a floorplan.
  • Fixed-outline floorplanners. Parquet (Adya and Markov 2003) and later tools change the cost so that the search is pushed into the outline first, and then reduce the wire length.
  • Analytical and hierarchical methods. Blocks are first spread by a smooth model of wire length and density, as in analytical placement, or split by min-cut partitioning, and then made legal by a packing step.
AlgorithmTimeSpacePropertiesCode
Stockmeyer's floorplan sizingO(n d) worst · averageO(n d) extradeterministicexactiterative1 language
Symmetric-feasible sequence pairO(n) check · repairO(n^2) extradeterministiciterative1 language
Thermal-driven 3D floorplanningO(M (n^2 + p + g^2 L + n g^2)) annealingO(n^2 + p + g^2 L) totalrandomizednot exactiterative1 language
Wong-Liu floorplanningO(s k n^2 d) worst · averageO(n d) extrarandomizednot exactiterative1 language

Bounds

  • NP-complete. The decision version is NP-complete in the strong sense. It is in NP: a certificate is the relation (left, right, below or above) of each pair of blocks, and the longest paths in the two constraint graphs check it in polynomial time, because any packing gives such relations and the longest path placement for them is no larger. The reduction from bin packing below gives the hardness.
  • Orientation. For a fixed slicing floorplan, the best orientation of all hard blocks is found in O(nd)O(n d) time for a tree of depth dd. For a general floorplan, given by its constraint graphs, the same question is NP-complete (Stockmeyer 1983).
  • Area lower bound. The area is at least ∑iwihi\sum_i w_i h_i, and at least max⁡iwi⋅max⁡ihi\max_i w_i \cdot \max_i h_i. The examples above show that neither bound is always attained.
  • Size of the search spaces. There are n! Sn−1n! \, S_{n-1} normalized Polish expressions, with the large Schröder numbers Sn−1S_{n-1}, n! B(n)n! \, B(n) labeled mosaic floorplans, with the Baxter numbers B(n)B(n), and (n!)2(n!)^2 sequence pairs. The growth rates of Sn−1S_{n-1} and B(n)B(n) are 3+223 + 2 \sqrt{2} and 88 (Baxter number theorem).

Reductions

  • From bin packing. Take a bin packing instance with integer item sizes s1,…,sns_1, \ldots, s_n, bin capacity CC and mm bins. Make hard blocks si×1s_i \times 1 with fixed orientation and the outline C×mC \times m. If the items fit into mm bins, put bin jj in the row [0,C]×[j−1,j][0, C] \times [j - 1, j]. Conversely, given a packing in the outline, push each block straight down, in the order of increasing yy, until it touches the floor or a block below it. By induction all yy values become integers, and the height does not grow. Then each row [j−1,j][j - 1, j] holds blocks with disjoint xx-intervals in [0,C][0, C], which is a bin. Bin packing is strongly NP-complete, through 3-partition, so the decision version of floorplanning is too (strong NP-hardness).
  • To and from strip packing. With a fixed width, no rotation, no nets and the height as the cost, floorplanning is exactly strip packing, whose approximation results then apply.
  • To longest paths. Once the relation of each pair of blocks is fixed, the coordinates are the longest paths in two directed acyclic graphs, which is how every representation above computes its packing.

Applications

  • Chip planning. Floorplanning fixes the places of large blocks and macros, the outline of the chip, and the regions for standard cells, before placement and routing.
  • Hierarchical design. Each level of a large design is floorplanned inside the outline given by the level above it, which is why the fixed-outline form is the usual one.
  • FPGA and 3D chips. The same problem appears with a grid of resources on an FPGA and with blocks spread over the layers of a 3D chip.
  • Layout of rooms and plants. Facility layout in buildings and plants asks the same question with departments in place of blocks and the flow of goods in place of wires.

References

  1. 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 3, Chip Planning (the floorplanning problem, its objectives, and slicing and non-slicing representations; general locator)
  2. D. F. Wong and C. L. Liu, A new algorithm for floorplan design, Proceedings of the 23rd ACM/IEEE Design Automation Conference, 101 to 107, 1986, the cost of area plus weighted wire length, and simulated annealing over normalized Polish expressions
  3. Hiroshi Murata, Kunihiro Fujiyoshi, Shigetoshi Nakatake and Yoji Kajitani, VLSI module placement based on rectangle-packing by the sequence-pair, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 15(12), 1518 to 1524, 1996, the sequence pair, and the fact that every packing has a sequence pair whose packing is no larger
  4. Saurabh N. Adya and Igor L. Markov, Fixed-outline floorplanning, enabling hierarchical design, IEEE Transactions on Very Large Scale Integration Systems 11(6), 1120 to 1135, 2003, the fixed-outline formulation and its difference from the minimum area formulation
  5. Larry Stockmeyer, Optimal orientations of cells in slicing floorplan designs, Information and Control 57(2-3), 91 to 101, 1983, the polynomial orientation algorithm for slicing floorplans, and NP-completeness for general floorplans
  6. Michael R. Garey and David S. Johnson, Computers and Intractability, A Guide to the Theory of NP-Completeness, W. H. Freeman, 1979, the appendix entry for bin packing and the strong NP-completeness of 3-partition

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml