Partitioning 2 Outline Goal Fiduccia-Mattheyses Algorithm Approach Example Algorithm Properties Goal Understand Fidducia-Mattheyses partitioning algorithm
Fiduccia-Mattheyses Algorithm Approach move one cell at a time between partitions A and B less restrictive than pair moves no longer need to maintain partition size balance use special data structures to minimize cell gain updates only move cells once per pass Complexity prove constant number of updates per cell per pass runtime per pass = O(P) - P pins/terminals vs. O(n2) for group migration small (3-5) number of passes to converge estimate total time is O(PlogP) more pins than nets usually more pins than cells
Definitions ni - number of cells on neti si - size (area) of celli smax - largest cell = max(si) S - total size of cells = sum(si) pi - number of pins on celli pmax - most pins on a cell = max(pi) P - total number of pins = sum(pi) C - total number of cells N - total number of nets r - fraction of cell area in partition A CELL - C-entry array, entry is linked list of nets on cell NET - N-entry array, entry is linked list of cells on net
Cell Gain Cell Gain Gain Data Structure gi - reduction in cutset by moving celli label each cell with its gain -pi <= gi <= pi -pmax <= gi <= pmax Gain Data Structure BUCKET array of cell gains one per partition O(1) access to cells of a given gain MAXGAIN tracks cells of max gain remove cell once it has moved cells move once per pass gain does not matter after that +2 +1 -1 MAX GAIN 1 2 C Cell # +pmax -pmax BUCKET CELL
Critical Nets Minimize cell gain updates Critical nets if all cells are updated on each move - O(C2) algorithm only cells that share a net with a moved cell must be updated but big net implies many moves and many updates only cells on critical nets must be updated Critical nets moving a cell would change cutstate cutstate - whether net is cut or not critical only if net has 0 or 1 cells in A or B A=0, B=3 critical A=1, B=2 critical A=2, B=2 not critical
Partition Balance Control size balance between partitions otherwise all cells move to one partition cutset = 0 Balance criterion rS - smax <= |A| <= rS + smax permits some “wiggle room” for cells to move yes no
Algorithm Initially place cells randomly into A and B Compute cell gains Algorithm for each pass for all cells in A and B of maximum gain whose move would not cause imbalance choose one with best balance result - the base cell if none qualify, quit pass move to opposite partition and lock (remove from BUCKET) unlocked cells are free cells update cell gains and MAXGAIN pointer Repeat passes until no moves occur unlock all cells at beginning of pass
Update Cell Gains F = “from” partition of base cell T = “to” partition of base cell FT(n) = # free T cells of net n FF(n) = # free F cells of net n LT(n) = # locked T cells of net n LF(n) = # locked F cells of net n for each net n on base cell do if LT(n) == 0 if FT(n) == 0 UpdateGains(NET(n)) else if FT(n) == 1 UpdateGains(NET(n)) FF(n)-- LT(n)++ if LF(n) == 0 if FF(n) == 0 UpdateGains(NET(n)) else if FF(n) == 1 UpdateGains(NET(n))
Example Initial partition cutset = 3 si = 1, r = 0.5, 1 <= |A| <= 3 Final partition cutset = 1 +3 +1 +1 -1 L -3 L +1 a b c d b a c d - b, c are highest-gain candidates - choose b, move and lock - recompute gains for a and b - no candidates qualify - quit pass - second pass - quit L +1 +1 -1 b a c d -1 -3 -1 +1 - a, c are highest-gain candidates - choose c, move and lock - recompute gains for a, d b a c d
Properties of Algorithm Fast O(PlogP) constant factors are small arrays, pointer access Space Efficient 5 words/net overhead 4 words/cell overhead small constant overhead Suboptimal gets stuck in local minima any one move has negative gain need multiple moves for positive gain Example moving a or b results in -3 or -4 gain moving both a and b results in +1 gain a -3 -3 -4 -4 b