0% found this document useful (0 votes)
94 views

Lecture8 Floorplan2

This document summarizes a lecture on using linear programming approaches for floorplan design and optimization. Specifically, it discusses representing a floorplan using a sequence pair, which encodes the geometric relationships between blocks. It then formulates the floorplan optimization problem as a mixed integer linear program that can be solved to minimize the packing area while ensuring blocks do not overlap. However, solving the full problem is computationally intractable, so typical approaches use greedy heuristics like successive augmentation.

Uploaded by

api-3834272
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

Lecture8 Floorplan2

This document summarizes a lecture on using linear programming approaches for floorplan design and optimization. Specifically, it discusses representing a floorplan using a sequence pair, which encodes the geometric relationships between blocks. It then formulates the floorplan optimization problem as a mixed integer linear program that can be solved to minimize the packing area while ensuring blocks do not overlap. However, solving the full problem is computationally intractable, so typical approaches use greedy heuristics like successive augmentation.

Uploaded by

api-3834272
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 34

EE382V Fall 2006

VLSI Physical Design Automation

Lecture 8. Floorplanning (2)

Prof. David Pan


[email protected]
Office: ACES 5.434

10/22/08 1
Linear Programming Approach
“An Analytical Approach to Floorplan Design and
Optimization”, Sutanthavibul, Shragowitz and Rosen,
IEEE Transaction on CAD, 10:761-769, June 1991.

2
Mixed Integer Linear Program
• A mathematical program such that:
– The objective is a linear function.
– All constraints are linear functions.
– Some variables are real numbers and some are integers, i.e.,
“mixed integer”.
• It is almost like a linear program, except that some
variables are integers.
• Can you think of which variables may be integer?

3
Problem Formulation
• Minimize the packing area:
– Assume that one dimension W is fixed.
– Minimize the other dimension Y.
• Need to have constraints W
so that blocks do not overlap.
• Associate each block Bi with 4
Y
variables:
– xi and yi: coordinates of its lower left
corner.
– wi and hi: width and height.

4
Non-overlapping Constraints

For two non-overlapping blocks Bi and Bj, at least one


of the following four linear constraints must be
satisfied:

(1) x i + wi ≤ x j if B i is to the left of B j


or (2) xi − w j ≥ x j if B i is to the right of B j
or (3) y i + hi ≤ y j if B i is below B j
or (4) yi − h j ≥ y j if B i is above B j

hi Bi hj Bj
(xi, yi) wi (xj, yj) wj
5
Integer Variables
• Use integer (0 or 1) variables xij and yij:
xij=0 and yij =0 if (1) is true.
xij=0 and yij =1 if (2) is true.
xij=1 and yij =0 if (3) is true.
xij=1 and yij =1 if (4) is true.
• Let W and H be upper bounds on the total width and
height. Non-overlapping constraints:
(1' ) xi + wi ≤ x j + W ( xij + yij )
(2' ) xi − w j ≥ x j − W (1 + xij − yij )
(3' ) yi + hi ≤ y j + H (1 − xij + yij )
(4' ) yi − h j ≥ y j − H (2 − xij − yij )
6
Formulation

Min. Y
s.t. 0 ≤ xi , xi + wi ≤ W 1≤ i ≤ n
0 ≤ yi , yi + hi ≤ Y 1≤ i ≤ n
xi + wi ≤ x j + W ( xij + yij ) 1≤ i < j ≤ n
xi − w j ≥ x j − W (1 + xij − yij ) 1≤ i < j ≤ n
yi + hi ≤ y j + H (1 − xij + yij ) 1≤ i < j ≤ n
yi − h j ≥ y j − H (2 − xij − yij ) 1≤ i < j ≤ n
xij = 0 or 1 1≤ i < j ≤ n
yij = 0 or 1 1≤ i < j ≤ n

7
Formulation with Hard Blocks
If the blocks can be rotated, use a 0-1 integer variable zi for each
block Bi s.t. zi = 0 if Bi is in the original orientation and zi = 1 if Bi is
rotated 90o .
Min. Y
s.t. 0 ≤ x i , x i + z i hi + (1 − z i ) wi ≤ W 1≤ i ≤ n
0 ≤ y i , y i + z i wi + (1 − z i )hi ≤ Y 1≤ i ≤ n
x i + z i hi + (1 − z i ) wi ≤ x j + W ( x ij + y ij ) 1≤ i < j ≤ n
x i − z j h j − (1 − z j ) w j ≥ x j − W (1 + x ij − y ij ) 1≤ i < j ≤ n
y i + z i wi + (1 − z i )hi ≤ y j + H (1 − x ij + y ij ) 1≤ i < j ≤ n
y i − z j w j − (1 − z j )h j ≥ y j − H (2 − x ij − y ij ) 1 ≤ i < j ≤ n
x ij = 0 or 1 1≤ i < j ≤ n
y ij = 0 or 1 1≤ i < j ≤ n
8
Formulation with Soft Blocks

• If Bi is a soft block, wihi=Ai. But this constraint is


quadratic!
• Linearized by taking the first two terms of the Taylor
expression of hi=Ai/wi at wimax (max. width of block Bi).
hi =himin+λi(wimax-wi)
where himin =Ai/wimax and λi=Ai/wimax2

9
Formulation with Soft Blocks
• If Bi is soft and Bj is hard:

(1) xi + wi ≤ x j + W ( xij + yij )


(2) xi − w j ≥ x j − W (1 + xij − yij )
(3) yi + himin + λi ( wimax − wi ) ≤ y j + H (1 − xij + yij )
(4) yi − h j ≥ y j − H (2 − xij − yij )

• If both Bi and Bj are soft:


(1) xi + wi ≤ x j + W ( xij + yij )
(2) xi − w j ≥ x j − W (1 + xij − yij )
(3) yi + himin + λi ( wimax − wi ) ≤ y j + H (1 − xij + yij )
(4) yi − h jmin − λ j ( w jmax − w j ) ≥ y j − H (2 − xij − yij )
10
Another way to linearize

11
Solving Linear Program

• Linear Programming (LP) can be solved by classical


optimization techniques in polynomial time.
• Mixed Integer LP (MILP) is NP-Complete.
– The run time of the best known algorithm is exponential to the
number of variables and equations

12
Complexity

• For a problem with n blocks, and for the simplest case,


i.e., all blocks are hard:
– 2n continuous variables (xi, yi)
– 2n(n-1) +n integer variables (xij, yij, zi)
– 4n2-2n linear constraints
• Practically, this method can only solve small size
problems.

13
Successive Augmentation
A classical greedy approach to keep the problem size
small: repeatedly pick a small subset of blocks to
formulate a MILP, solve it together with the previously
picked blocks with fixed locations and shapes:

Next subset

Y Partial Solution

14
Floorplan Representations
• Slicing
– Normalized Polish Expression: Wong & Liu [DAC-86]
• Mosaic (and General)
– Corner Block List (CBL): Hong et al. [ICCAD-00]
– Q-Sequence: Sakanushi & Kajitani [APCCAS-00]
– Twin Binary Sequence (TBS): Young, Chu, Shen [ISPD-02]
• General
– Polar graphs: Ohtsuki et al. [ICCST-70]
– Sequence pair: Murata et al. [ ICCAD-95]
– Bounded Slicing Grid (BSG): Nakatake [ICCAD-96]
– Transitive Closure Graph (TCG): Lin & Chang [DAC-01]
• Compacted
– O-tree: Guo et al. [DAC-99]
– B*-tree: Chang et al. [DAC-00]

15
General Floorplanning
by Simulated Annealing:
Sequence-Pair Representation

Murata, Fujiyoshi, Nakatake, Kajitani,


“VLSI Module Placement based on
Rectangle-Packing by the Sequence-Pair”,
TCAD, 15:1518-1524, December 1996.

10/22/08 16
Sequence-Pair vs. Polish Expression
• Sequence-Pair is a succinct representation of non-
slicing floorplans of rectangles
– Just like Polish Expression for slicing floorplans
• Represent a non-slicing floorplan by a pair of sequences
of blocks.
• Using Simulated Annealing to find a good sequence-pair
• Can only handle hard blocks
– i.e., cannot do things like shape-curve computation
• Essentially macro placement
• Techniques for soft block shaping exist (e.g.,
Lagrangian Relaxation) but are very slow

17
Sequence Pair

• Positive step line • Negative step line


sequence: ecadfb sequence: fcbead

18
Positive Locus and Negative Locus
Positive Locus
of Block b

Negative Locus
of Block b

19
Sequence-Pair

Positive Loci Negative Loci

Sequence-Pair = (abdecf, cbfade)

20
Geometric Info of Sequence-Pair
Given a placement and the corresponding
sequence-pair (P, N):
• a is right to b iff a is after b in both P and N.
• a is left to b iff a is before b in both P and N.
• a is above b iff a is before b in P and after b in N.
• a is below b iff a is after b in P and before b in N.

21
From Sequence-Pair to a Placement
Labeled grid for
(abdecf, cbfade)
• Given a sequence-pair,
e the placement with
d smallest area can be
a found in O(n2) time.
f
b • Algorithms of time O(n
c log log n) or O(n log n)
exist. But faster than
a O(n2) algorithm only
b when n is quite large.
d
e
c
f
22
From Sequence-Pair to Placement
• Distance from left (bottom) edge can be found using
the longest path algorithm on the horizontal (vertical)
constraint graph.

Horizontal Constraint Graph Vertical Constraint Graph


23
Sequence Pair (SP)
A floorplan is represented by a pair of permutations of
the module names:
e.g. 13245
35412
A sequence pair (s1, s2) of n modules can represent all
possible floorplans formed by the n modules by
specifying the pair-wise relationship between the
modules.

24
Sequence Pair

Consider a pair of modules A and B. If the


arrangement of A and B in s1 and s2 are:
– (…A…B…, …A…B…), then the right boundary of A is on the
left hand side of the left boundary of B.
– (…A…B…, …B…A…), then the upper boundary of B is
below the lower boundary of A.

25
Example

Consider the sequence pair:


(13245,41352 )

2
1 3

5
4

Any other SP that is also valid for this packing?

26
Floorplan Realization
• Floorplan realization is the step to construct a floorplan
from its representation.
• How to construct a floorplan from a sequence pair?
• We can make use of the horizontal and vertical
constraint graphs (Gh and Gv).

27
Floorplan Realization

• Whenever we see (…A…B…, …A…B…), add an edge from A to


B in Gh with weight wA.
• Whenever we see (…A…B…, …B…A…), add an edge from B to
A in Gv with weight hA.
• Add a source vertex s to Gh and Gv pointing, with weight 0, to all
vertices without incoming edges.
• Finally, find the longest paths from s to every vertex in Gh and Gv
(how?), which are the coordinates of the lower left corner of the
module in the packing.

28
Example

Gh 3 1.1 2
1.2
1.1 1 1.2 1.1
1.2 1
0 1.2
2 1.2 5
2 1 3 s 0
4 2.4

5 2 Gv 3 2
1 4 1 2
2.4 1.2 1 1
1
5
(13245,41352 ) 4 0 0
s
29
Constraint Graphs

• How many edges are there in Gh and Gv in total?


• Is there any transitive edges in Gh and Gv?
• How to remove the transitive edges?
• Can we reduce the size of Gh and Gv to linear, i.e., no.
of edges is of order O(n), by removing all the transitive
edges?

30
Moves

• Three kinds of moves in the annealing


process:
M1: Rotate a module, or change the shape of a
module
M2: Interchange 2 modules in both sequences
M3: Interchange 2 modules in the first sequence
• Does this set of move operations ensure
reachability? Why?

31
Pros and Cons of SP

• Advantages:
– Simple representation
– All floorplans can be represented.
– The solution space is finite. (How big?)
• Disadvantages:
– Redundant representation. The representation is not 1-to-1.
– The size of the constraint graphs, and thus the runtime to
construct the floorplan is quadratic

32
Questions
• Can we improve the runtime to realize a floorplan from
its SP representation? (“FAST-SP: A Fast Algorithm for
Block Placement on Sequence Pair”, X. Tang and D.F. Wong,
ASP-DAC 2001, pp. 521-526.)

33
Summary of Floorplanning
• Stockmeyer
– Slicing with given set of modules
– Dynamic programming (only keep irredundant solutions)
• Wong-Liu
– Slicing floorplan
– Nice polish expression
• Sequence pair
– Nonslicing
– Nice compact representation
• Mixed Integer Linear Programming
– Nonslicing
– Not scalable

34

You might also like