Chapter 2
Chapter 2
Partitioning
Sadiq M. Sait & Habib Youssef
September 2003
IO = tGr
where:
IO: number of I/O pins,
t: number of terminals per gate,
G: the number of gates in the circuit, and
r is Rent’s exponent (0 < r < 1).
Chapter 2: Partitioning – p.3
Partitioning - contd
• A large pin count increases dramatically the cost of
packaging the circuit.
• The number of I/O pins must correspond to one of the
standard packaging technologies - 12, 40, 128, 256 etc.
• When it becomes necessary to split a circuit across
packages, care must be exercised to minimize
cross-package interconnections. because off-chip wires
are undesirable.
1. Electrical signals travel slower along wires external to the chip.
2. Off-chip wires take up area on a PCB and reduce reliability.
Printed wiring and plated-through holes are both likely sources of
trouble.
3. Finally, since off-chip wires must originate and terminate into I/O
pins, more off-chip wires essentially mean more I/O pins.
Chapter 2: Partitioning – p.4
Partitioning - examples
C1
1
C2
5
2
7 8
3
6
(a)
1 5
3 6
2
7
4
8
(b)
1 4
2 3
5 6
7 8
(c)
Output:
• A division of the set V into k subsets V1 , V2 , · · · , Vk , such
that
1. an objective function is optimized,
2. subject to certain constraints.
X 1X 1
S(Vi ) = s(v) ≤ d s(v)e = S(V )
k k
v∈Vi v∈V
• If all the circuit elements have the same size, then above
equation reduces to:
n
ni ≤
k
where ni and n are the number of elements in Vi and in V
respectively.
Chapter 2: Partitioning – p.8
Cost Functions
Minimize External Wiring.
X
Cost = w(e)
e∈ψ
X
Cost = w(e)
∀e=(u,v)&p(u)6=p(v) Chapter 2: Partitioning – p.9
Two-Way Partitioning
• Given a circuit with 2n elements, we wish to generate a
balanced two-way partition of the circuit into two
subcircuits of n elements each.
• The cost function is the size of the cutset.
• If we do not place the constraint that the partition be
balanced, the two-way partitioning problem (TWPP) is
easy. One simply applies the well known max-flow
mincut.
• However, the balance criterion is extremely important in
practice and cannot be overlooked. This constraint makes
TWPP NP-Complete.
Constructive heuristic
Iterative heuristic
Stopping No
criteria
met ?
Yes
Stop; Output
best solution
encountered so far
X Y Y X
A B A* B*
Initial Optimal
Definition 2:
The internal cost Ia of node a ∈ A is defined as follows.
X
Ia = cav
v∈A
Da = E a − I a
Lemma 1:
• If two elements a ∈ A and b ∈ B are interchanged, the
reduction in the cost is given by
gab = Da + Db − 2cab
• Therefore,
X
Da = Ea − Ia = cab + cav − Ia
v∈B,v6=b
• Similarly
X
Db = Eb − Ib = cab + cbu − Ib
u∈A,u6=a
• When both moves are carried out, the total cost reduction
is given by the sum of above two equations, that is
gab = Da + Db − 2cab
Lemma 2:
• If two elements a ∈ A and b ∈ B are interchanged, then
the new D−values are given by
0
Dx = Dx + 2cxa − 2cxb , ∀x ∈ A − {a}
0
Dy = Dy + 2cyb − 2cya , ∀y ∈ B − {b}
A B
b
a
Cxb
x
C xa
If G > 0 then
Move X = {a1 , · · · , ak } to B;
move Y = {b1 , · · · , bk } to A;
Goto Step 2
Else STOP
EndIf End. Chapter 2: Partitioning – p.29
Example
5 5
4 4 2 1
2 1
G
6 6 1
G
2 3
3
(a) (b)
D1 = E1 − I1 = 1 − 0 = +1
D2 = E2 − I2 = 1 − 2 = −1
D3 = E3 − I3 = 0 − 1 = −1
D4 = E4 − I4 = 2 − 1 = +1
D5 = E5 − I5 = 1 − 1 = +0
D6 = E6 − I6 = 1 − 1 = +0
Chapter 2: Partitioning – p.31
Example - contd
• Step 3: Compute gains.
g36 = g2 = −3,
A0 = A0 − {3} = {2},
B 0 = B 0 − {6} = {5}.
(a) (b)
(a) (b)
A B A B
(c) (d)
• where F S(i) = the number of nets connected to cell i and not connected to any other cell
in the From_Block F (i) of cell i.
• and T E(i) = the number of nets that are connected to cell i and not crossing the cut.
Chapter 2: Partitioning – p.56
Example
A B
q
3 4 q
3 4
m j
1 m j
5 m q q
k 1 5
2
k
m 2
6
p p 6
(a) (b)
1. For each net n on the base cell we check for the critical
nets before the move.
2. If T (n) is zero then the gains of all free cells on the net n
are incremented.
3. If T (n) is one then the gains of the only T cell on net n is
decremented (if the cell is free).
X S
Cost
X
L X
G
States