You are on page 1of 7

A Linear-Time Heuristic for Improving Network Partitions

C.M. Fiduccia and R.M. Mattheyses

General Electric
Research and Development Center
Schenectady, NY 12301

tition to the other, in a attempt to


reduce the number of nets which have cells
in both blocks. This idea has been
An iterative mincut heuristic for parti- independently applied by Shiraishi and
tioning networks is presented whose worst
case computation time, per pass, grows Hirose 5. A technique due to Kernighan and
linearly with the size of the network. In Lin 3 is used to reduce the chance that the
practice, only a very small number of minimization process becomes trapped at
passes are typically needed, leading to a local minima. Our main contribution con-
fast approximation algorithm for mincut sists of an analysis of the effects a cell
partitioning. To deal with cells of vari- move has on its neighboring cells and a
ous sizes, the algorithm progresses by subsequent efficient implementation of
moving one cell at a time between the these results.
blocks of the partition while maintaining
a desired balance based on the size of the After specifying the network parti-
blocks rather than the number of cells per tioning problem, we discuss the Kernighan
block. Efficient data structures are used
to avoid unnecessary searching for the and Lin 3 heuristic and introduce the basic
best cell to move and to minimize unneces- concept of cell gain which is used to
sary updating of cells affected by each select the cell to be moved from one block
move. of the partition to the other. The pro-
perties of gain are then exploited to con-
struct a data structure that allows effi-
Introduction cient management of changing cell gains.
We then address the problem of achieving a
Given a network consisting of a set of desired balance between the sizes of the
cells (modules) connected by a set of nets two blocks of the partition in an environ-
(signals), the mincut partitioning problem ment which allows for differing cell
consists of finding a partition of the set sizes. The problem of determining which
of cells into two blocks A and B such that cells have their gains affected by each
the number of nets which have cells in move is then addressed. In both cases,
both blocks in minimal. In general, this the total amount of work required, per
process is subject to a balancing condi- pass, is shown to grow linearly with the
tion which admits only those partitions size of the network. We close with a dis-
whose blocks satisfy a user specified cri- cussion of the behavior of a VAX-based
terion based on size or cardinality con- implementation of the algorithm by giving
straints. the results and the execution times
encountered when the program was run on
An exact solution to this problem is several examples.
currently intractable in the sense that no
polynomial-time algorithm for it is known
to exist. Since in practice the network The Problem
may be very large, a practical algorithm
must of necessity employ heuristics which Following Schweikert and Kernighan 4 we
exhibit nearly linear running times. This view a network as a set of C cells
problem has been treated by a number of (modules) cell(1),...,cell(C) connected by
a set of N nets (signals)
researchers I-5 over the last decade. We
net(1),...,net(N). As far as partitioning
present an iterative algorithm whose worst is concerned, we may without loss of gen-
case running time, per pass, grows erality make the assumptions listed below
linearly with the size of the network, and about what comprises a network. We assume
which in practice typically converges in that a net is defined as a set consisting
several passes. This linear-time behavior of at least two cells, and that each cell
is achieved by a process of moving one is contained in at least in one net. The
cell at a time, from one block of the par- number of cells in net(i) will be denoted

19th Design Automation Conference


Paper 13.1
0420-0098/82/0000/0175500.75 © 1982 IEEE 175

Authorized licensed use limited to: University of Texas at Austin. Downloaded on January 31,2022 at 06:40:19 UTC from IEEE Xplore. Restrictions apply.
by n(i). Any two cells which share at cut if it has at least one cell in each
least one net are said to be neighbors. block and / ~ otherwise. Call this the
Each ceil is a s s u m e d to have a size s(i) c u t s t a t e of the net. This state may be
and a number of pins p(i), i n d i c a t i n g that d e d u c e d from the net's ~ , this
it b e l o n g s to exactly that many nets. being the number of cells it has in blocks
These a s s u m p t i o n s are easily e s t a b l i s h e d A and B respectively. D e f i n e the c u t s e t
by the input routine. For input, we assume of the p a r t i t i o n to be the set of all nets
that the nets are p r e s e n t e d one at a time, w h i c h are cut. Finally, define the size
in any order; each net being c o m p l e t e l y IXl of a block of cells X to be the sum of
given before another net is started. the sizes s(i) of its c o n s t i t u e n t cells.
Since each pin is on one and only one net,
the total number of pins p(1) + ... + Given a fraction (ratio) 0<r<l, we
p(C), call it P, may be taken as the wish to p a r t i t i o n the n e t w o r k into two
"length" of the input and, hence, as the blocks A and B such that IAI/(IAI+IBI)Sr,
"size" of the network. It is clear that and such that the size (cardinality) of
neither C nor N will serve this purpose, the r e s u l t i n g cutset is m i n i m i z e d . The
since n e i t h e r the number of pins per cell ratio r is only i n t e n d e d to c a p t u r e the
p(i) nor the number of cells per net n(i) b a l a n c e c r i t e r i o n of the final p a r t i t i o n
is bounded. In any event, both C and N produced by the algorithm. This should
are O(P). not be taken to m e a n that each m o v e must
maintain balance (although this is cer-
The f o l l o w i n g input routine will deal tainly not ruled out) nor that, in p a r t i c -
with real networks, whose nets are often ular, the initial partition need be
given as lists of (cell, pin) pairs, which balanced. We will discuss this point i n
v i o l a t e some of the above a s s u m p t i o n s con- m o r e detail later. In a d d i t i o n to speci-
c e r n i n g w h a t c o n s t i t u t e s a net. Nets are fying the ratio r and an initial p a r t i t i o n
s e q u e n t i a l l y n u m b e r e d 1 , 2 , . . . N as they are (with one of A or B p o s s i b l y empty), the
encountered in the input stream. Cells user is a l l o w e d to d e s i g n a t e c e r t a i n cells
are a s s u m e d to be i d e n t i f i e d by integers as b e i n g "fixed" in either block A or
in the range 1,2,...C. The principal block B of the partition. This allows the
f u n c t i o n p e r f o r m e d by the routine is to algorithm to be used to further refine
construct two data structures from the blocks c r e a t e d by p r e v i o u s p a r t i t i o n s .
sequence of nets given as input. The
first s t r u c t u r e is a CELL array, which for
each cell c o n t a i n s a l i n k e d list of the The Basic Idea
nets that c o n t a i n the cell. The second
s t r u c t u r e is a NET array, which for each Given a p a r t i t i o n (A,B) of the cells, the
net c o n t a i n s a l i n k e d list of the cells on main idea of the a l g o r i t h m is to m o v e a
the net. In both cases, each linked list cell at a time from one block of the par-
created is r e g a r d e d as a set, with no tition to the other in an a t t e m p t to
duplicates and no i m p l i c i t order. Each m i n i m i z e the cutset of the final parti-
record in each of the arrays also c o n t a i n s tion. The cell to be moved, call it the
several a d d i t i o n a l fields w h i c h the algo- base G@II, is chosen both on the basis of
rithm uses to p e r f o r m its function. the b a l a n c e c r i t e r i o n and its effect on
the size of the current cutset. Define
/* n e t - l i s t input routine */ the ~ain g(i) of cell(i) as the number of
FOR each net n = 1 ... N DO nets by which the cutset w o u l d d e c r e a s e
FOR each (cell, pin) pair were cell(i) to be m o v e d from its current
(i,j) on net n DO block to its c o m p l i m e n t a r y block. Note
/* m a i n t a i n set p r o p e r t y */ that a cell's gain may be negative.
IF net n is not at the front of Indeed, g(i) must be an integer in the
the n e t - l i s t for cell i range -p(i) to +p(i). It is also clear
THEN insert cell i into the that d u r i n g each move we must keep in mind
c e l l - l i s t of net n and the b a l a n c e c r i t e r i o n to p r e v e n t all cells
insert net n into the from m i g r a t i n g to one block of the parti-
n e t - l i s t of cell i tion. For surely that would be the best
END FOR partition were balance to be ignored.
END F O R Thus the b a l a n c e criterion is used to
select the block from w h i c h a cell of
One should also d e l e t e nets with only one highest gain is to be moved. It will
cell and a cells that may no longer be on often be the case that this cell has a
any of the r e s u l t i n g nets. It is clear n o n - p o s i t i v e gain. In that case, we still
that O(P) time will suffice to do all of move the cell with the e x p e c t a t i o n that
the above work, p r o v i d e d that the number the move will allow the algorithm to
of (cell, pin) p a i r s in the input stream "climb out of local minima". After all
is O(P). moves have been made, the best p a r t i t i o n
e n c o u n t e r e d d u r i n g the pass is taken as
Given any p a r t i t i o n of the cells into the output of the pass. This m i n i m i z a t i o n
two blocks A and B, a net is said to be technique is due to K e r n i g h a n and Lin 3.

Paper 13.1
176

Authorized licensed use limited to: University of Texas at Austin. Downloaded on January 31,2022 at 06:40:19 UTC from IEEE Xplore. Restrictions apply.
To prevent the cell-moving process
from "thrashing" or going into an infinite
loop, each base cell is immediately For any partition (A,B) we have defined
"locked" in its new block for the the gain g(i) of cell(i) as the number of
remainder of the pass. Thus only "free" nets by which the cutset would decrease,
cells are actually allowed to make one were cell(i) to be moved from its current
move during a pass, until either all cells block to its complimentary block.
become locked or the balancing criterion
prevents further moves. The best parti-
tion encountered during the pass is then
returned. Additional passes may then be
performed until no further improvements I
are obtained. In practice this typically
occurs quickly, in several passes, result-
ing in a nearly linear algorithm; however,
we make no claims about the number of
passes required in the worst case, except
to point out the obvious fact that, only Figure i. Example of cell gains
O(N) passes are possible since the cutset
is bounded by the number of nets. Clearly, g(i) is an integer in the range
-p(i) to + p(i), so that each cell has its
The bulk of the work needed to make a gain in the range -pmax to +pmax, where
move consists of selecting the base cell, pmax=max{p(i) Icell(i) is initially free}.
moving it, and then adjusting the gains of In view of the restricted set of values
its free neighbors. Unless this is care- which cell gains may take on, we can use
fully done, each cell will have its gain "bucket" sorting to maintain a sorted list
recomputed each time one of its neighbors of cell gains. This is done using an
moves. This is definitely not necessary. array BUCKET[-pmax ... pmax], whose k th
The naive approach will lead to an algo- entry contains a doubly-linked list of
rithm which performs (n(i))2+...+(n(i)) 2 = free cells with gains currently equal to
k. Two such arrays are needed, one for
O(P 2) gain computations per pass. This block A and one for block B. Each array
stems from the fact that the neighborhood is maintained by quickly moving a cell to
relation induced by a net containing n the appropriate bucket whenever its gain
cells is a complete graph with O(n 2 ) changes due to the movement of one of its
edges. Since a single gain computation neighbors. Direct access to each cell,
for a cell with p(i) pins takes O(p(i)) from a separate field in the CELL array,
work, this approach to m a i n t a i n i n g cell allows us to yank a cell from its current
list and move it to the head of its new
gains will require more than O(P 2) work. bucket list in constant time. Because
This is particularly expensive even when only free cells are allowed to move, only
one large net exists. they need to have their gains updated.
Whenever a base cell is moved, it is
We solve the first problem, that of "locked", removed from its bucket list,
selecting a base cell having the largest and placed on a "FREE CELL LIST" which is
gain in its block, by the use of a data later used to reinitialize the BUCKET
structure which quickly returns a cell of array for the next pass. This "FREE CELL
highest gain and allows recomputed cell LIST" saves a great deal of work when a
gains to be reentered into the structure large number of cells have permanent block
in constant time. We consider the solu- assignments and are thus not free to move.
tion to this problem in the next section
where we discuss the notion of cell gain.
+ pmax
The second problem, that of updating
the gains of the neighbors of the base
cell, is much more interesting. The naive
algorithm consists of recomputing the gain
of every free cell on every net of the GAIN
> loe 4 Ice 4d "
base cell. We avoid these time consuming
pitfalls by showing that a net(i) never
accounts for more than 2n(i) gain recompu-
tations during one entire pass. Moreover, - pmax
we show that each gain recomputation can
be replaced by an appropriate sequence of
simple gain increment/decrements which can
be done in constant time. These solutions 1 2 ... C
to the two problems reduce the total work
required to perform one pass to O(P) in Figure 2. Bucket list structure
the worst case.

Paper 13.1
177

Authorized licensed use limited to: University of Texas at Austin. Downloaded on January 31,2022 at 06:40:19 UTC from IEEE Xplore. Restrictions apply.
For each B U C K E T array, a M A X G A I N index is Call a p a r t i t i o n (A,B) balanced pro-
m a i n t a i n e d w h i c h is used to keep t r a c k of v i d e d that
the b u c k e t h a v i n g a cell of h i g h e s t gain.
This index is u p d a t e d by d e c r e m e n t i n g it rW - smax i IAI i rW + smax
w h e n e v e r its b u c k e t is f o u n d to be empty
and r e s e t t i n g it to a h i g h e r b u c k e t w h e n - w h e r e W = IAI + IBi is the sum of the
ever a cell m o v e s to a b u c k e t a b o v e M A X - s(i), a n d s m a x = m a x { s ( i ) } is the size of
GAIN. Experience with integrated circuit the l a r g e s t cell w h i c h is i n i t i a l l y free.
n e t w o r k s shows that gains tend to c l u s t e r A s p e c i a l initial pass is u s e d to e s t a b -
s h a r p l y a r o u n d the o r i g i n and that M A X G A I N lish the b a l a n c e by m o v i n g c e l l s to or
m o v e s v e r y l i t t l e indeed, m a k i n g the a b o v e f r o m b l o c k A d e p e n d i n g on the sizes of
i m p l e m e n t a t i o n e x c e p t i o n a l l y fast and sim- b l o c k s A and B and the d e s i r e d r a t i o r.
ple. We now e s t a b l i s h that, d e s p i t e its D u r i n g t h i s pass, as in all other passes,
s i m p l i c i t y , this s c h e m e a c t u a l l y does only the base cell is s e l e c t e d a c c o r d i n g to the
linear w o r k per pass. highest gain criterion. Once b a l a n c e is
achieved, it is p o s s i b l e to m a i n t a i n it
• The total a m o u n t of w o r k with every move because the tolerance
r e q u i r e d to m a i n t a i n each B U C K E T array is a l w a y s a l l o w s at least one free cell f r o m
O(P) per pass. either A or B to be moved. If d e s i r e d , a
t o l e r a n c e of ~ k * s m a x may be used, w h e r e
Proof. Let f = O(P) be the n u m b e r of k = k(s) Z 1 is some s l o w l y g r o w i n g f u n c -
cells in the n e t w o r k w h i c h are i n i t i a l l y tion of the n u m b e r of free c e l l s in the
free. I n i t i a l i z a t i o n r e q u i r e s O(pmax) + network.
O(f) = O(P) time. If g is the total
n u m b e r of g a i n a d j u s t m e n t s p e r f o r m e d dur- H a v i n g e s t a b l i s h e d b a l a n c e , the b a s i c
ing one pass, then O(g) w o r k is s u f f i c i e n t idea of r e p e a t e d l y c h o o s i n g a base cell to
to m o v e all free cells to t h e i r a p p r o p r i - be m o v e d is d e s c r i b e d as follows:
ate b u c k e t lists, since each cell can be
m o v e d in c o n s t a n t time. In the s e c t i o n on i. C o n s i d e r the first cell (if any) of
m a i n t a i n i n g cell gains, we e s t a b l i s h that h i g h e s t gain f r o m each B U C K E T array,
g = O(P). We m u s t f i n a l l y a c c o u n t for the r e j e c t i n g it if m o v i n g it w o u l d cause
w o r k r e q u i r e d to r e t u r n a cell of h i g h e s t imbalance. If n e i t h e r b l o c k has a
g a i n w h e n one is requested. Let R be the q u a l i f y i n g cell, no m o r e m o v e s w i l l
sum of all the a m o u n t s by w h i c h M A X G A I N is be a t t e m p t e d .
reset by all the v a r i o u s reset actions.
A l t h o u g h we c a n n o t in g e n e r a l s e a r c h and 2. A m o n g t h o s e cells r e t u r n e d in s t e p
r e t u r n a cell in c o n s t a n t time, the total one, c h o o s e a cell of h i g h e s t gain,
time, per pass, used to s e a r c h down for a b r e a k i n g ties by c h o o s i n g the one
n o n - e m p t y b u c k e t and to r e t u r n and r e m o v e w h i c h g i v e s the best b a l a n c e . Break
a cell of h i g h e s t g a i n is O ( R + pmax) + r e m a i n i n g ties as d e s i r e d .
O(f) = O(R) + O(P). In the next s e c t i o n
we show that R = O(g); so that O(P) t o t a l 3. R e t u r n this as the base cell; r e m o v e
work, per pass, is s u f f i c i e n t to i n i t i a l - it f r o m its b u c k e t list; and p l a c e it
ize and m a i n t a i n the b u c k e t lists. QED on the F R E E C E L L LIST.

H a v i n g c h o s e n a base cell, we now m o v e it


Establishina Balance to its c o m p l i m e n t a r y block; lock it; and
d e t e r m i n e the e f f e c t s it p r o d u c e s on the
The concept of mincut partitioning is d i s t r i b u t i o n s of its nets and on the gains
m e a n i n g l e s s u n l e s s a r e s t r i c t i o n is p l a c e d of its n e i g h b o r i n g cells. U n l e s s this is
on the sizes of the two blocks; o t h e r w i s e , done c a r e f u l l y , the r e s u l t i n g time, per
we c o u l d a c h i e v e an empty c u t s e t by m o v i n g
pass, will be w o r s e t h a n O ( p 2 ) . We next
all of the cells to one block of the par-
show how to do this in l i n e a r time per
tition. The a p p r o a c h we h a v e t a k e n is to
pass.
s p e c i f y a f r a c t i o n (ratio), 0 < r < i, to
s u g g e s t that only final p a r t i t i o n s s a t i s -
fying IAI/(JAJ + IBJ) ~ r are a c c e p t a b l e . ~omputating and M a i n t a i n i n a Cell G a i n s
Since in general equality cannot be
achieved, some n o t i o n of an a c c e p t a b l e We h a v e yet to d e s c r i b e how to c o m p u t e and
t o l e r a n c e m u s t be i n c o r p o r a t e d into the m a i n t a i n cell gains. To do this, we m u s t
balancing scheme. We have considered i n t r o d u c e the n o t i o n of a c r i t i c a l net.
several approaches, i n c l u d i n g the use of
C o n s i d e r an a r b i t r a r y net n. G i v e n a par-
cost f u n c t i o n s b a s e d on the size of the t i t i o n (A,B), d e f i n e the d i s t r i b u t i o n of
cutset and the amount by w h i c h the p a r t i -
net n, r e l a t i v e to this p a r t i t i o n , as an
tion d e v i a t e s f r o m the d e s i r e d r a t i o r. o r d e r e d p a i r of i n t e g e r s (A(n),B(n)) w h i c h
We are c u r r e n t l y u s i n g a s c h e m e w h i c h is
r e p r e s e n t s the n u m b e r of c e l l s the net n
both fast and s e e m s to w o r k w e l l when the has in blocks A and B r e s p e c t i v e l y . These
v a r i a n c e in cell sizes is not too large. are c l e a r l y c o m p u t a b l e in O(P) t i m e for
all nets. R e c a l l i n g the d e f i n i t i o n of the

Paper 13.1
178

Authorized licensed use limited to: University of Texas at Austin. Downloaded on January 31,2022 at 06:40:19 UTC from IEEE Xplore. Restrictions apply.
c u t s t a t e of a net, we say that a net is the inner l o o p scans t h r o u g h each of the
9ritical if there exists a cell on it c e l l ' s nets and p e r f o r m s a s i m p l e incre-
w h i c h if m o v e d w o u l d c h a n g e the n e t ' s cut- ment or d e c r e m e n t operation. Thus the
state. It is easy to see that n is criti- total work i n v o l v e d is O(rp) = O(P), w h e r e
cal iff: e i t h e r A(n) or B(n) is equal to 0 rp is the n u m b e r of pins r e a c h a b l e f r o m
or I. all the free cells. QED

Next we p r o v e that a linear amount of


I I time is s u f f i c i e n t to m a i n t a i n the gains
of all free cells d u r i n g a s i n g l e pass of
the a l g o r i t h m . Since a net is c r i t i c a l if
and only if it c o n t a i n s a cell w h i c h if
A(n) = 1 I A(n) = 0 m o v e d w o u l d alter the c u t s t a t e of the net,
we n e e d look at only those nets, c o n n e c t e d
i I to the base cell, that are c r i t i c a l b e f o r e
or after the move. Only nets c o n s i s t i n g
of either two or three cells can be criti-
cal both b e f o r e and after a move. For
B(n) = 1 B(n) = 0 I such nets, two g a i n adjustment actions
m i g h t be required: t w o - c e l l nets w i l l have
F i g u r e 3. C r i t i c a l nets one cell i n c r e m e n e t d or d e c r e m e n t e d twice,
w h e r e a s t h r e e - c e l l nets w i l l have one cell
It is now c l e a r that the g a i n of a cell, i n c r e m e n t e d and a n o t h e r cell d e c r e m e n t e d .
p r e v i o u s l y d e f i n e d in terms of its e f f e c t
I I
on the cutset, d e p e n d s only on its criti- I t
cal nets. This m e a n s that if the net is
not critical, its cutstate cannot be
a f f e c t e d by a move. What is m o r e impor-
tant, a net w h i c h is not c r i t i c a l either
b e f o r e or after a m o v e c a n n o t p o s s i b l y I
i n f l u e n c e the gains of any of its cells. I
This o b s e r v a t i o n , c o u p l e d w i t h the fact I
that base cells are "locked" after b e i n g
moved, will form the basis of our linear-
time claim.

Let F ("From") be the c u r r e n t block I


of cell(i) and T ("To") be its c o m p l i m e n - F i g u r e 4. Nets requiring 2 adjustments
tary block; so that F = A and T=B or vice-
versa. The gain of cell(i) is then given If a net is critical, either b e f o r e or
by after a move, the c o n t r i b u t i o n s it m a k e s
to the gains of its cells need to be
g(i) = FS(i) - TE(i), adjusted. Of course, this s h o u l d only be
done if the net's d i s t r i b u t i o n is c h a n g e d
w h e r e FS(i) is the number on nets w h i c h by the move; t h a t is, only for nets on the
h a v e cell(i) as their only F cell, and base cell. Using the "from-to" t e r m i n o l -
TE(i) is the n u m b e r of nets w h i c h c o n t a i n ogy of the gain c o m p u t a t i o n a l g o r i t h m , we
cell(i) and h a v e an empty T side. Thus a see that a net is c r i t i c a l b e f o r e the m o v e
c r i t i c a l net on cell(i) c o n t r i b u t e s +i or iff
-i to g(i). The f o l l o w i n g a l g o r i t h m com-
putes the initial gains of all free cells. F(n) = 1 or T(n) = 0 or T(n) = i.

/* c o m p u t e cell gains */ The case F(n) = 0 can not occur b e c a u s e


FOR each free cell i DO the base cell is on the F side b e f o r e the
g(i) <-- 0 move. S i m i l a r l y , a net is c r i t i c a l after
F <-- the "from block" of cell(i) a m o v e iff
T <-- the "to block" of cell(i)
FOR each net n on cell i DO T(n) = 1 or F(n) = 0 or F(n) = i.
IF F(n) = 1 THEN i n c r e m e n t g(i)
IF T(n) = 0 THEN then d e c r e m e n t g(i) TO s i m p l i f y the s i t u a t i o n , we f u r t h e r note
END FOR that F(n) = 1 b e f o r e the m o v e iff F(n) = 0
END FOR after the move, and that T(n) = 1 after
the m o v e iff T(n) = 0 b e f o r e the move.
~ i i . ~ . Initialization of all cell The following code checks for each of
gains r e q u i r e s O(P) work. these four cases to see if gain u p d a t e s
are required. A careful a n a l y s i s of the
Proof. M a k i n g use of the FREE CELL LIST, four cases, which are not i n d e p e n d e n t ,
the outer loop scans through the free will a s s u r e the reader that the c o r r e c t
cells in the network. For each free cell, u p d a t e s are applied.

Paper 13.1
179

Authorized licensed use limited to: University of Texas at Austin. Downloaded on January 31,2022 at 06:40:19 UTC from IEEE Xplore. Restrictions apply.
/* m o v e base cell and update /* check for c r i t i c a l nets
neighbors' gains */ b e f o r e the move */
F <-- the "from block" of base cell IF LT(n) = 0
T <-- the "to block" of base cell THEN IF FT(n) = 0 THEN "update gains"
Lock the base cell and ELSE IF FT(n) = 1 THEN "update gains"
C o m p l i m e n t its block /* change the net d i s t r i b u t i o n
F O R each net n on the base cell DO to reflect the m o v e */
/* check c r i t i c a l nets d e c r e m e n t FF(n)
before the move */ increment LT(n)
IF T(n) = 0 THEN increment gains of /* check for critical nets
all free cells on after the move */
net(n) IF LF(n) = 0
ELSE IF T(n) = 1 THEN d e c r e m e n t gain THEN IF FF(n) = 0 THEN "update gains"
of the only T cell on ELSE IF FF(n) = 1 THEN "update gains"
net(n), if it is free
/* change the net d i s t r i b u t i o n O b s e r v e that once both blocks A and B have
to reflect the move */ s e r v e d in the c a p a c i t y of the T side for a
d e c r e m e n t F(n) given net n, no further update o p e r a t i o n s
i n c r e m e n t T(n) will occur for that net. This is b e c a u s e
/* check c r i t i c a l nets the code w h i c h updates the net's d i s t r i b u -
after the move */ tion will have i n c r e m e n t e d the l o c k e d cell
IF F(n) = 0 THEN d e c r e m e n t gains of count on both sides. Once this occurs,
all free cells on the net is e s s e n t i a l l y "dead", meaning
net(n) that its c u t s t a t e can no longer change,
ELSE IF F(n) = 1 THEN i n c r e m e n t gain thus ruling out the p o s s i b i l i t y of future
of the only F cell on updates.
net(n), if it is free
END FOR This o b s e r v a t i o n allows us to concen-
trate on only that p o r t i o n of the m o v e
The action of i n c r e m e n t i n g or d e c r e m e n t i n g sequence, for an i n d i v i d u a l net n, which
the gains of a s p e c i f i c subset of the i n c l u d e s the first change in d i r e c t i o n of
cells, on a net c o n s i s t i n g of n cells, cell movement. We will consider a
requires at most O(n) work because, in one s e q u e n c e of moves (with respect to the net
scan of the net, each cell can be r e a c h e d n) of cells from the A side (A-move) fol-
from the net's cell list and can be m o v e d lowed by a single m o v e of a cell from the
from one bucket to another in constant B side. D u r i n g the first A - m o v e T=B, thus
time. We shall refer to one scan of a for all s u b s e q u e n t moves LB(n) will be
net's cell list as an update operation. positive. Therefore, the B side, h a v i n g
only 0 or 1 cells, can only cause an
P r o p o s i t i o n 3. No m o r e than four update update on the first A-move of the
operations per net are p e r f o r m e d during sequence. D u r i n g the s e q u e n c e of A-moves,
one pass of the algorithm. each move causes the FA(n) c o m p o n e n t of
the net d i s t r i b u t i o n to be d e c r e m e n t e d by
Proof. We first t r a n s f o r m the inner loop one. U p d a t e s can occur only for v a l u e s of
of the gain update a l g o r i t h m to simplify FA(n) = 1 and FA(n) = 0, and only once for
the d i s c u s s i o n . To do this, we need to each value with F=A. The final move with
distinguish b e t w e e n the free and locked B=F could also cause an u p d a t e if the A
cells of net(n) in each block of the par- side has 1 or 0 cells. Since no further
tition. Let LF(n) and FF(n) r e s p e c t i v e l y updates can be required, we get a total of
refer to the number of l o c k e d and free at most four u p d a t e s per net. A more
cells net(n) has on the F side of the par- careful analysis reveals that three
tition. A similar n o t a t i o n is used for updates will be s u f f i c i e n t for any net,
the T side. Concentrating on the first and that three updates are n e c e s s a r y for
c o n d i t i o n a l in the loop body, n o t i c e that c e r t a i n nets. D u r i n g these three updates,
T(n) = 0 requires that LT(n) = FT(n) = 0. the gain g(i) of a given cell(i) is
The condition T(n) = 1 requires that a d j u s t e d at most twice. QED
either LT(n) = 1 and FT(n) = 0, or that
LT(n) = 0 and FT(n) = I; however, the U s i n g facts from the p r e v i o u s proof,
update is p e r f o r m e d only if the cell on we can now c o m p l e t e the proof of P r o p o s i -
the T side is free; that is, only if LT(n) tion i. We see that g, the total number
= 0. Using this o b s e r v a t i o n , and a similar of gain adjustments per pass is O(f),
observation for the c o n d i t i o n a l updates w h e r e f is the number of i n i t i a l l y free
after the d i s t r i b u t i o n shift, the code for cells. Thus g = O(f) = O(P) in P r o p o s i -
the inner loop of the gain adjustment tion i. Each time a net is updated, the
a l g o r i t h m can be r e s t a t e d as: gain of any cell on that net can be incre-
m e n t e d at most twice, by P r o p o s i t i o n 3;
thus, d u r i n g one update, the value of MAX-
GAIN can be reset to at most M A X G A I N + 2.

Paper 13.1
180

Authorized licensed use limited to: University of Texas at Austin. Downloaded on January 31,2022 at 06:40:19 UTC from IEEE Xplore. Restrictions apply.
This shows that R, in Proposition i, is quarter, and so on. We feel that this is
O(N) = O(P). This establishing that the a novel approach to intra channel place-
bucket lists can be maintained with O(P) ment.
work per pass. QED
Acknowledgements
We are now in a position to establish
the behavior of the our algorithm for The authors wish to thank Bob Darrow, who
maintaining cell gains. implemented the algorithms on the VAX.
Without the feedback one gets from such
proposition 4. The total work required to implementations, it is difficult to evalu-
initialize and maintain cell gains is O(P) ate a heuristic solution. Thanks are also
per pass. due to Phil Lewis and Ron Rivest for their
suggestions.
Proof. The total amount of work required
for gain maintenance during one pass of
the algorithm is the sum of the work References
required for each individual net. Each
update of net(i) uses O(n(i)) work. Pro- [i] M.A. Breuer, "Min-Cut Placement," J.
position 3 shows that only a constant of Design and Fault- Tolerant Com-
number of updates are required, per net puting, Vol. I, number 4, Oct. 1977,
per pass; Since n(1) +...+n(N) = O(P), the pp. 343-362.
linear behavior is obtained. QED
[2] M.A. Breuer, "A Class of Min-Cut
Combining Propositions 1 and 4, we
may now state our main result. Placement Algorithms," Proc. 14 th
Design Automation Conference, New
Theorem. The minimization algorithm Orleans, 1977, pp. 284-290.
requires O(P) time to complete one pass.
[3] B.W. Kernighan and S. Lin, "An Effi-
cient Heuristic Procedure for Parti-
Performance and Application~
tioning Graphs," Bell System Techni-
cal Journal, Vol. 49, Feb. 1970, pp.
The algorithm has been implemented in the 291-307.
language C, and runs on a VAX 11/780. Its
performance was evaluated by using it to [4] D.G. Schweikert and B.W. Kernighan,
partitio 9 several random-logic polycell
"A Proper Model for the Partitioning
designs. Four samples are listed below.
The average chip has 267 cells, 245 nets, of Electrical Circuits," Proc. 9 th
and 2650 pins. On these chips, the algo- Design Automation Workshop, Dallas,
rithm typically makes about 900 moves per June 1979, pp. 57-62.
cpu-second. This will of course depend on
the average number of pins per cell and [5] H. Shiraishi and F. Hirose, "Effi-
the sizes of the nets. The factor by cient Placement and Routing for
which the algorithm will outperform the Masterslice LSI," Proc. 17 th Design
naive algorithm depends on network size
and especially on the size of the largest Automation Conference, Minneapolis,
nets. The new algorithm is superior espe- June 1980, pp. 458-464.
cially when the network contains even one
large net.

CELLS NETS PINS PASSES TIME


Chip 1 306 300 857 3 1.63
Chip 2 296 238 672 2 .98
Chip 3 214 222 550 5 1.91
Chip 4 255 221 571 5 2.09

As a cell placement tool, in a polycell


environment, the algorithm is being
evaluated in two quite distinct ways. The
first is a straight-forward application to
partition the cells into channels. We
call this inter-channel placement. Its
objective is to reduce the number of
inter-channel connections needed. The
second application is as an intra-channel
placement tool. Here the objective is to
reduce channel density and wire length.
This is done recursively to determine
first, in which half of the channel the
cell should be placed, then in which

Paper 13.1
181

Authorized licensed use limited to: University of Texas at Austin. Downloaded on January 31,2022 at 06:40:19 UTC from IEEE Xplore. Restrictions apply.

You might also like