Download presentation
Presentation is loading. Please wait.
1
VLSI Layout Algorithms CSE 6404 A 46 B 65 C 11 D 56 E 23 F 8 H 37 G 19 I 12J 14 K 27 X=(AB*CD)+ (A+D)+(A(B+C)) Y = (A(B+C)+AC+ D+A(BC+D)) Dr. Md. Saidur Rahman
2
Circuit Partitioning
3
Why is circuit partitioning necessary? The circuit is too large to be placed on a single chip. The larger the gate count of the circuit, the larger the number of I/O pins associated with the circuit. So circuit partitioning is necessary due to I/O pin limitations.
4
Decomposition of a complex system into smaller subsystems Done hierarchically Partitioning done until each subsystem has manageable size Each subsystem can be designed independently Interconnections between partitions minimized Less hassle interfacing the subsystems Communication between subsystems usually costly
5
Example: Partitioning of a Circuit [©Sherwani] Input size: 48 Cut 1=4 Size 1=15 Cut 2=4 Size 2=16Size 3=17
6
Hierarchical Partitioning Levels of partitioning: –System-level partitioning: Each sub-system can be designed as a single PCB –Board-level partitioning: Circuit assigned to a PCB is partitioned into sub- circuits each fabricated as a VLSI chip –Chip-level partitioning: Circuit assigned to the chip is divided into manageable sub-circuits [©Sherwani]
7
System Hierarchy
8
Levels of Partitioning System Level Partitioning Board Level Partitioning Chip Level Partitioning System PCBs Chips Subcircuits / Blocks
9
Delay at Different Levels of Partitions A B C PCB1 [©Sherwani] D x 10x 20x PCB2
10
Problem Definition 5 6 421 3 4 5 6 2 3 1
11
Given a graph G=(V,E), where each vertex v in V has a size s(v), and each edge e in E has a weight w(e), the problem is to divide the set V into k subsets V 1, V 2, ….V k, such that an objective function is optimized, subject to certain constraints. 5 6 421 3 4 5 6 2 3 1
12
Cost Functions and Constraints Bounded size partitions Minimize external wiring Delay due to partitioning Number of terminals Number of partitions
13
Bounded size partitions Each subcircuit has an upper bound on size. It is desirable to divide the circuit into roughly equal sizes.
14
Two-way partitioning problem Each node has unit size Each edge has unit weight Find two partition V 1 and V 2 such that Each of V 1 and V 2 has equal size External wiring will be minimum (cut-set will have to minimize)
15
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
16
2 3 4 5 6 7 8 9 10 11 12 13 14 15 s = 1 t = 16 st-numbering has two neighbors j, k
17
2 3 4 5 6 7 8 9 10 11 12 13 14 15 s = 1 t = 16 st-numbering Size of cutset = 4
18
2 3 4 5 6 7 8 9 10 11 12 13 1415 s = 1 t = 16 st-numbering Size of cutset = 3 To find a bipartition with the minimum cutset, we have to enumerate all bipartitions. We need to enumerate all st-numbering.
19
Two-way partitioning problem Each node has unit size Each edge has unit weight Find two partitions V 1 and V 2 such that Each of V 1 and V 2 has equal size External wiring will be minimum (cut-set will have to minimmize) NP-hard problem. Heuristic techniques to approximate solutions.
20
Classification of Partitioning Algorithms Deterministic algorithms Stochastic algoritms
21
Classification of Partitioning Algorithms Constructive algorithms Iterative algorithms
22
Problem instance Constructive heuristic Iterative heuristic Stopping criteria output
23
Kernighan-Lin (KL) Algorithm On non-weighted graphs An iterative improvement technique A two-way (bisection) partitioning algorithm The partitions must be balanced (of equal size)
24
Kernighan-Lin (KL) Algorithm Initial partition A, B Size of the cut set We have to minimize the size of the cut set.
25
Initial Partition Optimal Partition A, B A*, B* Swap such that
26
Initial Partition Optimal Partition B*B* Swap such that How to find X and Y ? A B A*A* X Y X Y
27
Internal cost GAGA GBGB a1a1 a2a2 anan aiai a3a3 a5a5 a6a6 a4a4 b2b2 bjbj b4b4 b3b3 b1b1 b6b6 b7b7 b5b5 [©Kang] External cost
28
Lemma: Consider any a i A, b j B. If a i, b j are interchanged, the gain is Proof: Total cost before interchange (T) between A and B Total cost after interchange (T’) between A and B Therefore Gain Calculation (cont.) [©Kang]
29
Gain Calculation (cont.) Lemma: –Let D x ’, D y ’ be the new D values for elements of A - {a i } and B - {b j }. Then after interchanging a i & b j, Proof: –The edge x-a i changed from internal in D x to external in D x ’ –The edge y-bj changed from internal in D x to external in D x ’ –The x-b j edge changed from external to internal –The y-a i edge changed from external to internal More clarification in the next two slides [©Kang]
30
Clarification of the Lemma aiai bjbj x
31
Decompose Ix and Ex to separate edges from ai and bj: Write the equations before the move... And after the move
32
Kernighan-Lin (KL) Algorithm Iterate as long as the cutsize improves: –Find a pair of vertices that result in the largest decrease in cutsize if exchanged –Exchange the two vertices (potential move) –“Lock” the vertices –If no improvement possible, and still some vertices unlocked, then exchange vertices that result in smallest increase in cutsize
33
Example: KL Step 1 - Initialization A = {2, 3, 4}, B = {1, 5, 6} A’ = A = {2, 3, 4}, B’ = B = {1, 5, 6} Step 2 - Compute D values D 1 = E 1 - I 1 = 1-0 = +1 D 2 = E 2 - I 2 = 1-2 = -1 D 3 = E 3 - I 3 = 0-1 = -1 D 4 = E 4 - I 4 = 2-1 = +1 D 5 = E 5 - I 5 = 1-1 = +0 D 6 = E 6 - I 6 = 1-1 = +0 [©Kang] 5 6 421 3 Initial partition 4 5 6 2 3 1
34
Example: KL (cont.) –Step 3 - compute gains g 21 = D 2 + D 1 - 2C 21 = (-1) + (+1) - 2(1) = -2 g 25 = D 2 + D 5 - 2C 25 = (-1) + (+0) - 2(0) = -1 g 26 = D 2 + D 6 - 2C 26 = (-1) + (+0) - 2(0) = -1 g 31 = D 3 + D 1 - 2C 31 = (-1) + (+1) - 2(0) = 0 g 35 = D 3 + D 5 - 2C 35 = (-1) + (0) - 2(0) = -1 g 36 = D 3 + D 6 - 2C 36 = (-1) + (0) - 2(0) = -1 g 41 = D 4 + D 1 - 2C 41 = (+1) + (+1) - 2(0) = +2 g 45 = D 4 + D 5 - 2C 45 = (+1) + (+0) - 2(+1) = -1 g 46 = D 4 + D 6 - 2C 46 = (+1) + (+0) - 2(+1) = -1 –The largest g value is g 41 = +2 interchange 4 and 1 (a 1, b 1 ) = (4, 1) A’ = A’ - {4} = {2, 3} B’ = B’ - {1} = {5, 6} both not empty [©Kang]
35
Example: KL (cont.) Step 4 - update D values of node connected to vertices (4, 1) D 2 ’ = D 2 + 2C 24 - 2C 21 = (-1) + 2(+1) - 2(+1) = -1 D 5 ’ = D 5 + 2C 51 - 2C 54 = +0 + 2(0) - 2(+1) = -2 D 6 ’ = D 6 + 2C 61 - 2C 64 = +0 + 2(0) - 2(+1) = -2 Assign D i = D i ’, repeat step 3 : g25 = D 2 + D 5 - 2C 25 = -1 - 2 - 2(0) = -3 g26 = D 2 + D 6 - 2C 26 = -1 - 2 - 2(0) = -3 g35 = D 3 + D 5 - 2C 35 = -1 - 2 - 2(0) = -3 g36 = D 3 + D 6 - 2C 36 = -1 - 2 - 2(0) = -3 All values are equal; arbitrarily choose g 36 = -3 (a2, b2) = (3, 6) A’ = A’ - {3} = {2}, B’ = B’ - {6} = {5} New D values are: D 2 ’ = D 2 + 2C 23 - 2C 26 = -1 + 2(1) - 2(0) = +1 D 5 ’ = D 5 + 2C 56 - 2C 53 = -2 + 2(1) - 2(0) = +0 New gain with D 2 D 2 ’, D 5 D 5 ’ g 25 = D 2 + D 5 - 2C 52 = +1 + 0 - 2(0) = +1 (a3, b3) = (2, 5) [©Kang]
36
Example: KL (cont.) Step 5 - Determine the # of moves to take g 1 = +2 g 1 + g 2 = +2 - 3 = -1 g 1 + g 2 + g 3 = +2 - 3 + 1 = 0 The value of k for max G is 1 X = {a 1 } = {4}, Y = {b 1 } = {1} Move X to B, Y to A A = {1, 2, 3}, B = {4, 5, 6} Repeat the whole process: The final solution is A = {1, 2, 3}, B = {4, 5, 6} 5 6 421 3
37
Kernighan-Lin (KL) Algorithm Initialize –Bipartition G into V 1 and V 2, s.t., |V 1 | = |V 2 | 1 –n = |V| Repeat –for i=1 to n/2 Find a pair of unlocked vertices v ai V 1 and v bi V 2 whose exchange makes the largest decrease or smallest increase in cut-cost Mark v ai and v bi as locked Store the gain g i. –Find k, s.t. i=1..k g i =Gain k is maximized –If Gain k > 0 then move v a1,...,v ak from V 1 to V 2 and v b1,...,v bk from V 2 to V 1. Until Gain k 0
38
Kernighan-Lin (KL) Example a b c d e f g h 4 { a, e } -2 0 -- 0 1 { d, g } 3 2 { c, f } 1 3 { b, h } -2 Step No.Vertex Pair Gain 5 5 2 1 3 Cut-cost [©Sarrafzadeh] Gain sum 0 3 4 2 0
39
Kernighan-Lin (KL) Example a bc d e f g h 4 { a, e } -2 0 -- 0 1 { d, g } 3 2 { c, f } 1 3 { b, h } -2 Step No.Vertex Pair Gain 5 5 2 1 3 Cut-cost [©Sarrafzadeh] Gain sum 0 3 4 2 0
40
Kernighan-Lin (KL) : Analysis Time complexity? –Inner (for) loop Iterates n/2 times Iteration 1: (n/2) x (n/2) Iteration i: (n/2 – i + 1) 2. –Passes? Usually independent of n –O(n 3 ) Drawbacks? –Local optimum –Balanced partitions only –No weight for the vertices –High time complexity
41
References and Copyright Some of the slides are used from the following references (with some modification if necessary). –[©Sarrafzadeh] © Majid Sarrafzadeh, 2001; Department of Computer Science, UCLA –[©Sherwani] © Naveed A. Sherwani, 1992 (companion slides to [She99]) –[©Keutzer] © Kurt Keutzer, Dept. of EECS, UC-Berekeley http://www-cad.eecs.berkeley.edu/~niraj/ee244/index.htm –[©Gupta] © Rajesh Gupta UC-Irvine http://www.ics.uci.edu/~rgupta/ics280.html –[©Kang] © Steve Kang UIUC http://www.ece.uiuc.edu/ece482/ http://www.ece.uiuc.edu/ece482/ –[@Kia] @ Kia Bazargan, University of Minnesota –[@Pan] @ Prof. David Z. Pan, http://users.ece.utexas.edu/~dpan/2008Fall_EE382V/Prof. David Z. Pan
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.