Professional Documents
Culture Documents
General Electric
Research and Development Center
Schenectady, NY 12301
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.
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
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.
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.