Documente Academic
Documente Profesional
Documente Cultură
10/22/08 1
Class Logistics
• Homework 1 due today
• Class project
– The implementation project will be on global routing
– Specifications to be given next week
– Schedule change: Proposal by Sept. 25 Oct. 11
• Form project team and propose what to work on
• After covering floorplanning (which is the first real
“layout” optimization step), I will cover Global Routing,
so that you can start poking around and working on
class project (the “implementation” option)
– Note that the conventional sequence of PD is Floorplanning->
Placement -> Routing
– But the techniques are mostly orthogonal
– Actually, you will have an “interleaved” view of P&R
2
Hierarchical Design
• Several blocks after partitioning:
• Need to:
– Put the blocks together.
– Design each block.
Which step to go first?
3
Hierarchical Design
• How to put the blocks together without knowing their
shapes and the positions of the I/O pins?
• If we design the blocks first, those blocks may not be
able to form a tight packing.
4
Floorplanning
5
Floorplanning v.s. Placement
• Both determines block positions to optimize the circuit
performance.
• Floorplanning:
– Details like shapes of blocks, I/O pin positions, etc. are not yet
fixed (blocks with flexible shape are called soft blocks).
• Placement:
– Details like module shapes and I/O pin positions are fixed
(blocks with no flexibility in shape are called hard blocks).
6
Floorplanning Problem
• Input:
– n Blocks with areas A1, ... , An
– Bounds ri and si on the aspect ratio of block Bi
• Output:
– Coordinates (xi, yi), width wi and height hi for each block such
that hi wi = Ai and ri ≤ hi/wi ≤ si
• Objective:
– To optimize the circuit performance.
7
Bounds on Aspect Ratios
If there is no bound on the aspect ratios, can we pack
everything tightly?
- Sure!
8
Bounds on Aspect Ratios
• We can also allow several shapes for each block:
9
Objective Function
A commonly used objective function is a weighted sum
of area and wirelength:
cost = αA + βL
where A is the total area of the packing, L is the total
wirelength, and α and β are constants.
10
Wirelength Estimation
• Exact wirelength of each net is not known until routing
is done.
• In floorplanning, even pin positions are not known yet.
• Some possible wirelength estimations:
– Center-to-center estimation
– Half-perimeter estimation
11
Dead space
• Dead space is the space that is wasted:
Dead space
12
Slicing and Non-Slicing Floorplan
• Slicing Floorplan:
One that can be obtained by
repetitively subdividing (slicing)
rectangles horizontally or
vertically.
• Non-Slicing Floorplan:
One that may not be obtained by
repetitively subdividing alone.
10/22/08 16
Representation of Slicing Floorplan
Slicing Floorplan Slicing Tree
V
1 3
H H
4 5
2 1 H 3
2 6 7
V V
6 7 4 5
Polish Expression
(postorder traversal
of slicing tree) 21H67V45VH3HV
17
Polish Expression
• Succinct representation of slicing floorplan
– roughly specifying relative positions of blocks
• Postorder traversal of slicing tree
1. Postorder traversal of left sub-tree
2. Postorder traversal of right sub-tree
3. The label of the current root
• For n blocks, a Polish Expression contains n operands
(blocks) and n-1 operators (H, V).
• However, for a given slicing floorplan, the
corresponding slicing tree (and hence polish
expression) is not unique. Therefore, there is some
redundancy in the representation.
18
Skewed ST and Normalized PE
• Skewed Slicing Tree:
– no node and its right son are the same.
• Normalized Polish Expression:
– no consecutive H’s or V’s.
Slicing Floorplan Slicing Tree (Skewed) Slicing Tree
V V
1 3
H H H H
4 5 2 1 H 3 2 1 V H
2 6 7 V V 6 7 V 3
6 7 4 5 4 5
20
Neighborhood Structure
• Chain: HVHVH.... or VHVHV....
16H35V2HV74HV
Chains
• The moves:
M1: Swap adjacent operands (ignoring chains)
M2: Complement some chain
M3: Swap 2 adjacent operand and operator
(Note that M3 can give you some invalid NPE.
So checking for validity after M3 is needed.)
21
Example of Moves
1 1
M1
2 4
5 5
3 4 3 2
34V2H5V1H 32V4H5V1H M3
1 1
4 5 5
M2 3 2
3 2 4
32V45VH1H 32V45HV1H
22
Shape Curve
• To represent the possible shapes of a block.
h h
Feasible
Feasible region
region
wh = A
(0,0) w (0,0) w
23
Combining Shape Curves
h 1
• 12V:
1 2 2
12V
w
• 12H:
12H
2 h
1 1
2
w 24
Find the Best Area for a NPE
• Recursively combining shape curves.
Pick the
best
2 V
1
3 1 H
3 2
25
Updating Shape Curves after Moves
26
Initial Solution
• 12V3V4V...nV
1 2 3 .... n
27
Annealing Schedule
28
Handling both Rectangular and L-
Shaped Blocks
30
Basic Idea
• Similar to the DAC-86 paper by Wong & Liu:
– Polish Expression representation.
– Simple moves to locally modify floorplan.
– Simulated Annealing.
• Differences from the DAC-86 paper:
– 5 operators and 4 moves defined to handle the more complex
shapes.
– Idea of shape curves no longer applicable.
– Depend on Simulated Annealing to pick different shapes for
blocks probabilistically.
31
Operators
• 5 operators: ~, V1, V2, H1, H2
• Completion of A (~A):
A
~ A = ~ A = ~ =
A
~ = ~ A =
32
Binary Operators V1, V2, H1 and H2
33
Example of Combining 2 Blocks
A V1 B = A B or A B or A B
A V2 B = A B or A B or A B
• Several possible outcomes. Represented as:
A V1 B = A B
A V2 B = A B
34
Another Example of Combining
B
A H1 B = A
H2 B = B or B or B
A A A A
Represented as:
B
A
35
Moves
• Write the Polish Expression in the form:
b1u1b2u2 ... b2n-1u2n-1
where bi’s are the n blocks, or the n-1 binary operators,
and each ui is either ~ or the empty string ε.
• The moves:
M1: Modify for some i (change to a different
shape or a different binary operator).
M2: Change ui to ~ or ε for some i.
M3: Swap 2 blocks bi and bj.
M4: Swap bi and bi+1 for some i.
(M4 can obtain invalid PE. Checking needed.)
36
Another Classic Work
“Optimal Orientation of Cells in Slicing floorplan Designs”
L. Stockmeyer, Information and Control 57(1983), 91-101
- This is an earlier paper than [Wong-Liu’86], dealing with simpler
problem
- Given slicing structure and a set of module shapes (or shape list)
- How to orient these modules such that the total area is smallest?
5 8 4 7
3 B 2 2 B 2
4 A 5
A
2 C 3
C
E 5
3 D E 6
3 D
8 5
6 5
7x13 8x11
37
Difficulty
16 v
4 v v 4
2 2 2 2
m1•m2 choices
m1 m2
38
Key Idea
• Dynamic programming
– Compute a set of irredundant solutions at each
sub-tree rooted from the list of irredundant
solutions for its two child subtrees
39
Example of Merging:
only keep irredundant solutions
40
Stockmeyer Algorithm
41
Stockmeyer Algorithm (Cont’d)
42
Complexity of the Algorithm
n= # of leaves = 2 * # of modules
d=depth of the tree depth
k
Running time= O(nd)
Storage = O(n)
because, at depth k,
❁ sum of the lengths of the lists =O(n)
❁ time to construct these lists =O(n)
❁ configurations stored at this node can be
release as soon as the node is processed
Extension
Each module has k possible shapes
Running time and storage O(nkd)
43
Summary: What’s BIG idea?
• Floorplan problem is definitely NP hard
• How to represent it compactly is a big deal.
• Slicing is easier to deal with, so let’s start with it
• Polish expression is very elegant and easy to make
new moves
– Need to be unique (NPE)
– Bounding curve for area computation when merging two
blocks, which can be computed incrementally
• For a given set of modules and the slicing tree,
Stockmeyer’s algorithm can give the optimal solution
– But it’s a very ideal situation that doesn’t happen often
– Nice algorithm using dynamic programming
44