Partitioning 1 Outline –What is Partitioning –Partitioning Example –Partitioning Theory –Partitioning Algorithms Goal –Understand partitioning problem –Understand partitioning algorithms
What is Partitioning Divide a design into smaller pieces –based on a set of constraints Constraints –amount of design in a partition –number of nets to/from partition –number of partitions allowed –balance between partition sizes –weight nets crossing partition boundaries Applications –divide large design into multiple packages –place circuit components on a chip or board
Partitioning Example Constraints –12 transistors per package –7 pins per package –few packages as possible –nets of equal weight Bounds –30 xistors => >=3 packages –21 terminals => <=3 packages xistors 7 pins 12 xistors 5 pins 6 xistors 4 pins xistors 7 pins 10 xistors 6 pins 8 xistors 5 pins etc.
Partitioning Theory Partitioning is NP-complete
Partitioning Theory Partitioning Set Formulation –V a set of nodes (components) –each node r having area a(r) –X a set of nodes (terminals) external to V –S = (S 1, S 2,..., S N ) a set of subsets of V U X »S i correspond to nets –partition V into disjoint subsets V 1, V 2,..., V k such that »area of nodes in V i <= A i »number of sets in S which have nodes external and internal to V i is <= T i, (pin count) Other formulations –graphs - weighted nets, edges –connection matrix - eigenvectors
Partitioning Algorithms Direct –seed each module, grow based on constraints Group Migration –randomly place components, then move between partitions Metric Allocation –goodness metric for each component pair, partition to minimize metric Simulated Annealing –shuffle components among partitions to minimize cost function, permit uphill moves to get around local minima
Direct Partitioning place a component r from V into each partition V i –pick relatively independent components for each remaining component r in V { for each V i with area of nodes <= A i and number of sets in S which have nodes external and internal to V i <= T i, compute cost of placing r in V i place r in lowest-cost V i } Complexity –O(V*k) –assumes placement cost computation is O(1) Issues –sensitive to initial seeding –sensitive to component examination order –gets stuck in local minimum
Direct Partitioning Example A B C D E F G A BC D E F G D A D A E D A E B E B A BC D E C G, F
Group Migration 1. Partition nodes into groups A and B 2. For every a in A, and every b in B { compute change in terminal counts D a and D b that occur if a and b are swapped.} –set queue to empty and i = Select from all pairs (a, b) the pair (a i, b i ) that gives most reduction in total terminal count when swapped. –add to queue –save the improvement in terminal count as g i 4. Remove a i from A and b i from B, recalculate D a and D b. –if A and B not empty, i++, go to Find k such that G = sum of g 1 to g k is a minimum. –swap a 1,...a k and b 1,...b k. –if G 0, go to 2, else stop.
Group Migration Example A B C D E F G A BC D E F G Initial Partition, Cutset = 6 (A,E) 0 -3 (A,F) -1 0 (A,G) -1 0 (D,E) (D,F) (D,G) (B,E) (B,F) 0 0 (B,G) 0 0 (C,E) (C,F) 0 0 (C,G) 0 0 Queue 1: (D,E) -5 2: (A,F) +1 (-1,+3)... Minimum G=-5 at k=1 Swap D and E Next iteration: all pairs positive k=0, quit D a D b A B CF G Final Partition, Cutset = 1 removed (D,E)
Group Migration Complexity –O(n 2 ) per iteration in worst case for n nodes »steps 2, 3 –converges in only a few iterations –newer versions are O(nlogn) - discuss in next lecture Application to partitioning –use bisection –divide into two partitions, then split those partitions, etc. –partition area is ignored, partitions remain balanced »subdivide until partition area is small enough –algorithm also called min-cut since it minimizes terminals