Professional Documents
Culture Documents
Copyright Notice
Page 1
Where Are We?
^ Physical design--placement via direct methods
M T W Th F
Aug 27 28 29 30 31 1 Introduction
Sep 3 4 5 6 7 2 Advanced Boolean algebra
10 11 12 13 14 3 JAVA Review
17 18 19 20 21 4 Formal verification
24 25 26 27 28 5 2-Level logic synthesis
Oct 1 2 3 4 5 6 Multi-level logic synthesis
8 9 10 11 12 7 Technology mapping
15 16 17 18 19 8
Placement
22 23 24 25 26 9
Routing
29 30 31 1 2 10
Nov 5 Static timing analysis
6 7 8 9 11
12 13 14 15 16 12 Electrical timing analysis
Thnxgive 19 20 21 22 23 13 Geometric data structs & apps
26 27 28 29 30 14
Dec 3 4 5 6 7 15
10 11 12 13 14 16
© R. Rutenbar 2001 CMU 18-760, Fall01 3
Page 2
Model Assumptions
^ Geometric simplifications
X Gates: model as dimensionless points
X Grid slots: none, ie, no placement grid, no “1 gate in 1 slot” constraints
X Pins: must be fixed somewhere around boundary of the chip
2 2
pin 4 4
pin pin
quadratic wirelength:
^ Idea
X Decompose each multipoint net into a set of 2 point nets
X Necessary to be able use the quadratic wirelength model: square of the
length of the wire only really makes sense for 2 point net
X How to decompose...?
Page 3
Decomposing Multipoint Nets
^ Multi-point net
X Suppose we have a 5 point net here
Page 4
Weighting the Wires
^ Question
X When we decompose, what happens to the weights?
X Solution: for k-point net, multiply each 2 pt connection by
X Example: 4 point net, look at typical partition of it objects
k=4 pts
w =2
Overall Model
^ Ideas
X Objects are dimensionless points: (xi, yi) placed arbitrarily; pins fixed
X Nets are all 2 point connections (maybe weighted) among these points
X Wirelength is measured as sum of quadratic net lengths
Page 5
About the Model
^ Why quadratic wirelength?
X One reason: can get an analytical solution to min[ Σ quadratic wirelen]
X We can write equations, solve numerically for an exact, best minimum
^ Tradeoffs
X Quadratic wirelen NOT a particularly good model of the length of real
wires after routing -- but we can get an analytical min length
X Objects as dimensionless points NOT a particularly good model of a
real placement -- must fix problems caused by ignoring shapes, and slots
X But--there are “fixes” that deal with these problems, and it turns out
you can do HUGE things--millions of gates--with these methods
Direct Formulation
^ All quadratic wirelength min. problems look like this eqn:
^ How to solve?
X Transform this into a standard optimization problem
X Requires some linear algebra, some calculus
Page 6
Basic Matrix Stuff
^ Linear equations
X By now (I hope!) you should know that N linear equations in N unknows
can be written compactly as a single matrix equation
Quadratic Forms
^ Turns out that xT A x is the right form for quadratic wirelens
X x is a column vector, xT is a row vector, A a square matrix
x = x1 xT = A= a b AT =
x2 c d
xT A x =
Page 7
Start with Point-to-Point Connectivity Info
^ Placeable objects
X Set of n connected points {1, 2, ..., n}
^ Nets
X 2 point connections only, as discussed before
X A weighted connectivity matrix represents these connections
1 2 3 ......j .... n
1
i j
2
3
C= . cij = 3 here
i cij Can think of this as either:
.
n
i connects to j with 1 net of weight 3
i connects to j with 3 nets of weight 1
Matrix Formulation
^ Start with a simpler problem, 1-dimensional placement
X We want to place the objects {1, 2, ..., n} on a line
X Means we want to solve for x1, x2, ..., xn to minimize weighted
quadratic wirelength
Page 8
Matrix Formulation
^ When in doubt, try a little example: 3 objects placed on a line
1 C matrix is:
1 2
4 1 3 2
3
Matrix Formulation
^ Turns out this is the right matrix A for the job:
Quadratic
wirelen = 1*x12 + 5*x22 + 4*x32 - 2*x1*x2 - 8*x2*x3 - 0*x1*x3
T
=x Ax= x1 x2 x3 1 -1 0 x1
-1 5 -4 x2
0 -4 4 x3
Try it:
Page 9
Matrix Formulation
^ Look closely: compare C and A; can you see pattern?
1
1 2 C= 0 1 0 A= 1 -1 0
4
1 0 4 -1 5 -4
3 0 4 0 0 -4 4
A= Cij
Di
ag
on
al
^ New problem
X I don’t just want to write this wirelength down...
X ...I want to solve for the vector of x locations that minimizes it
X How?
Page 10
Minimizing xTT A x
^ This minimization is just a higher dimensional version of
something you already should know...
^ 1-variable version
To minimize...
Minimizing xTT A x
^ Higher dimensional version: 2-variable case
2 variables, x1 x2
To minimize...
∂f = 2x1 - x2 = 0
∂x =
∂f = -x1 + 2x2 = 0
∂x
Page 11
Oops: Problem
^ The only direct solution here is xi=0 for all i
X This is the solution to the unconstrained form of the problem
X We have to add some additional constraints to avoid this trivial soln
For placement
Add so-called
T “pad” constraint
min x A x to force the solution
to “spread out”,
pads represent fixed
objects connected to
wires; they can’t move
pad
fixed 1
1 1
3 x,y
3
3
2
2
2 4 4
4
fixed
pad x,y
Page 12
Pad Constraints
^ Back to the 1-var case to see how to optimize
=
^ Functional form
X 1/2 • a x2 + b•x + constant
To minimize
Pad Constraints
^ 2-var example
X 2 variables (objects); arbitrary number of pads and nets
^ Functional form
x1 x2 • • x1 + 2 • b1 b2 x1 + constant
A (2x2)
x2
• x2
Page 13
Pad Constraints
^ Concrete 2-variable example
∂f = 0 =
∂x1
x1
=
x2
∂f = 0 =
∂x2
Pad Constraints
^ Reformulate all this with matrices
Page 14
Be Careful...
^ Gotta be careful about the 2s and 1/2s floating around here
X Often see this formulated as 1/2 xT A x + bT x + const
X It’s the same thing, just divide by the “2” in front of b, get a new const
X Here is another simple example
(1,1) quadratic wirelen for just x part is:
2 4
1 3 x12 + 6 x22 -4 x1x2 - 8 x2 + 1
2
1
(0,0)
x1 x2 3 -2 x1 + 2 0 -4 x1 + 1
-2 6 x2 x2
= xT A x + 2bT x + const
0
solution still: Ax = -b =
4
© R. Rutenbar 2001 CMU 18-760, Fall01 29
^ General case
X min 1/2 • xT A x + bT x + const has a solution if A is positive definite
Useful result
Page 15
Placing in (x,y) Plane
^ How to handle the 2 dimensional wirelen minimization task?
X Formulate the x variables and the y variables as 2 separate minimization
problems; minimize them separately
X Why? There are never any x • y terms in the quadratic wirelength
formula; OK to separate out the problem like this
Formulation:
Min x quadratic wirelength
fixed 1
x,y
wirelen => Ax = -b
3
2 Min y quadratic wirelength
wirelen => A y = -b’
4
x1 y1
fixed
x2 y2
x,y
… …
xn yn
Example
^ 4 pads, a new 5 object netlist
(0, 1) (1,1)
01100 3 -1 -1 0 0
1 3 C = A =
4 10111 -1 4 -1 -1 -1
11010 -1 -1 4 -1 0
2 5 01101 0 -1 -1 4 -1
01010 0 -1 0 -1 3
Page 16
Some Subtleties Here
^ Note: not precisely the same A as before
X Start with the same C connectivity matrix among placeable objects
X A is still (special diagonal) - [cij]
X But you now have to account for the extra connections to the fixed pad
objects for these elements on the diagonal; you sum weights on these
wires as well as wires to movable objects
(0, 1) (1,1)
1 3 1 2 3 4 5
4
1
5
2
2 A= 3
4
5
(1,0)
(1/2,0)
(0, 1) 1
(1,1)
1 3 4
0.9
2 5
0.8
0.7
(1,0)
(1/2,0)
1
0.6
2 4
0.5
0.4 3
0.3 5
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Page 17
Another Placement Result
^ Change weights: remember to change A and b vectors!
(0, 1) (1,1) 1
1 10 3 1
4
10 0.9
2 5 3
0.8 4
2
0.7
(1,0)
(1/2,0) 0.6
A = 21 -1 -10 0 0 0.5 5
-1 4 -1 -1 -1 0.4
-10 -1 13 -1 0
0 -1 -1 4 -1 0.3
0 -1 0 -1 3
0.2
bx = 0 by = 10 0.1
0 0
0
1 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1 1
0.5 0 © R. Rutenbar 2001 CMU 18-760, Fall01 35
Summary So Far…
^ Direct placement
X Dimensionless points, 2-point weighted wires
X Minimize sum of squares of wire lengths
X Has a direct-form representation of aggregate wirelength with
functional form
1/2 • xT A x + bT x + const or equivalently
xT A x + 2 bT x + const
X ...this is minimized at Ax = -b
X Do x and y placements separately
^ Open issues
X These objects are really not dimensionless points, and we don’t
yet have a legal placement when this is finished
X There are ways around these problems
© R. Rutenbar 2001 CMU 18-760, Fall01 36
Page 18
Dealing with Shape
^ The “points” really have shape, and need to be in rows
1
3
2
4
^ Problems
X Legalization: the objects almost certainly overlap after quadratic place.
X How do we fix this…?
X Several strategies; we will look informally at one
Strategy: PROUD
^ Who
X Ren Song Tsay, Ernest Kuh, Chi Ping Hsu, “PROUD: A Sea-Of-gates
Placement Algorithm,” IEEE Design & Test of Computers, Dec 1988.
^ What
X Recursive legalization by partitioning & refining
X Use quadratic placement as starting point for a recursive strategy
Page 19
PROUD: Mechanics
^ Mechanics
Balancing Physical
cut cut1
PROUD: Mechanics
^ Mechanics
Physical Physical
cut1 cut1
Page 20
PROUD: Mechanics
^ Idea
X We model physical effect of wires that go “outside” our left-side region
via wires to psuedo-pins which represent “approximately” where these
wires need to go
X Now, we can solve the left-side alone, again, to get the next cut
Page 21
PROUD: Iteration
^ Why do we repeat this operation?
X Ping-pong back and forth thru subregions?
X Gives objects in region a chance to “influence” other regions
PROUD: Iteration
^ Easier to see when there are many regions at the level of the
cut hierarchy
1 2
1
5
...
4
Page 22
PROUD: Finalizing Placement
^ Does this create a legal placement buy itself? No
X It does a pretty good job of global placement, and guaranteeing that you
do not put more modules in any region than the area allows
X But, it cannot really force individual gates into cell rows
^ Solution
X Don’t partition all the way down to individual objects
X Go down to regions with many (10s) of objects, snap onto row grid, and
then do iterative improvement based on swaps of modules
X People do annealing down here, among other things…
PROUD: Summary
^ Quadratic place
X To get the initial placement
X Again, on each region of the cut hierarchy, to help legalize the region,
to move objects to good place after they are forced to go in a region
^ Recursive cutting
X To force ~ right number of placeable objects in each region
X Uses quadratic placement and psuedo-pins to do each region
^ Final legalization
X Run above till each region has few tens of cells
X Then do iterative improvement
Page 23
Summary
^ Iterative improvement placement by annealing
X “The” approach in the 1980s; runs out of gas at a few 100,000 gates
^ Today
X Mix of quadratic and mincut techniques to do “gross” placement;
iterative improvement “local refinement” to get legal final placement
X This is really how people really do millions of gates today…
© R. Rutenbar 2001 CMU 18-760, Fall01 47
Page 24