Download presentation
Presentation is loading. Please wait.
Published byMaud Butler Modified over 9 years ago
1
1 مرتضي صاحب الزماني Partitioning
2
2 First Project Synthesis by Design Compiler Physical design by SoC Encounter –Use tutorials in \\fileserver\common\szamani\EDA (MS)\Tools\ مرتضي صاحب الزماني
3
3 Fiduccia-Mattheyses Algorithm “ A linear time heuristic for improving network partitions ”, Fiduccia and Mattheyses, DAC 82.
4
4 مرتضي صاحب الزماني Basic Ideas Differences from KL: –Move only one cell each time. –Cells can have different sizes. –Nets can be multi-terminal. –Maintain a balanced partition after every move. –O(#Pins) #Pins = ∑ e edge degrees
5
5 مرتضي صاحب الزماني FM Algorithm Start with a balanced partition P = {X, Y}. Repeat –For i = 1 to n: Choose a free cell b X Y s.t. moving b to the other side gives the highest gain, gain(b), and moving b preserves balance in P. Move and lock b. Let g i = gain(b). –Find k s.t. G = g 1 + g 2 + ….. + g k is maximized and shuffle the cells up to this k th step. Until G = 0.
6
6 مرتضي صاحب الزماني An Example abcabc defdef acac defdef b locked acac dfdf be acac f b e d g1g1 g2g2 g3g3 g4g4
7
7 مرتضي صاحب الزماني An Example c f b e d g5g5 a f b e d g6g6 a c b e d a cf If G = g 1 + g 2 + g 3 + g 4 is the largest partial sum, the final partition after this pass is: cdecde afbafb
8
8 مرتضي صاحب الزماني Balanced Partition A partition P = (X, Y) is balanced iff: r ( 1): Ratio Factor S(X): total size of cells in X. Balancing condition: cell b is moved if, after moving, S tot = S(X Y) S max =maximum cell size
9
9 Digital Design Contest مرتضي صاحب الزماني
10
10 مرتضي صاحب الزماني Cell Gain gain(i) = تعداد نتهاي خوب - تعداد نتهاي بد i نت خوب : نتي که متصل به سلول i است و به هيچ سلول ديگري در پارتيشن مبدأ وصل نيست (cutsize را يک واحد کاهش مي دهد ). i نت بد : نتي که متصل به سلول i است و cut را قطع نکرده است ( cutsize را يک واحد افزايش مي دهد ).
11
11 مرتضي صاحب الزماني Cell Gain i نت خنثي : نتي که متصل به سلول i است و به سلولهايي در هر دو پارتيشن وصل است.
12
12 مرتضي صاحب الزماني Cell Gain Note: -p(i) gain(i) p(i) where p(i) is the no. of pins in cell i. i i gain(i) = -p(i) gain(i) = p(i)
13
13 مرتضي صاحب الزماني Gain Bucket Cell # Cell # Max Gain +pmax -pmax 1 2n Two “bucket lists”, one for X and one for Y
14
14 مرتضي صاحب الزماني Gain Bucket Cell # Cell # Max Gain +pmax -pmax 1 2 n Cell # Cell # Max Gain +pmax -pmax 1 2 n
15
15 مرتضي صاحب الزماني Gain Update Let cell b move from X to Y. Let N(b) be the set of nets connecting b. This move will only affect those cells connected by the nets in N(b).
16
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 16 Gain g(c) for cell c g(c) = FS(c) – TE(c) FS(c): (moving force): No. of good nets connected to c TE(c): (retention force): No. bad nets connected to c Cell 2: FS(2) = 0TE(2) = 1 g(2) = -1 1 3 4 2 5 a b c d e 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Terminology
17
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 17 Gain g(c) for cell c g(c) = FS(c) – TE(c), Cell 1: FS(1) = 2TE(1) = 1 g(1) = 1 Cell 2: FS(2) = 0TE(2) = 1 g(2) = -1 Cell 3: FS(3) = 1TE(3) = 1 g(3) = 0 Cell 4: FS(4) = 1TE(4) = 1 g(4) = 0 Cell 5: FS(5) = 1TE(5) = 0 g(5) = 1 1 3 4 2 5 a b c d e 1 3 4 2 5 a b c d e 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Terminology
18
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 18 Maximum positive gain G m of a pass 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Terminology
19
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 19 1 3 4 2 5 A B a b c d e 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example Step 0: Compute the balance criterion [ r ∙ area(V) – S max (V) ] ≤ area(A) ≤ [ r ∙ area(V) + area max (V) ] 0,375 * 16 – 5 = 1 area(A) 11 = 0,375 * 16 +5. Given: Ratio factor r = 0,375 area(Cell_1) = 2 area(Cell_2) = 4 area(Cell_3) = 1 area(Cell_4) = 4 area(Cell_5) = 5.
20
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 20 1 3 4 2 5 A B a b c d e Step 1: Compute the gains of each cell Cell 1: FS(Cell_1) = 2TE(Cell_1) = 1 g(Cell_1) = 1 Cell 2: FS(Cell_2) = 0TE(Cell_2) = 1 g(Cell_2) = -1 Cell 3: FS(Cell_3) = 1TE(Cell_3) = 1 g(Cell_3) = 0 Cell 4: FS(Cell_4) = 1TE(Cell_4) = 1 g(Cell_4) = 0 Cell 5: FS(Cell_5) = 1TE(Cell_5) = 0 g(Cell_5) = 1 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example
21
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 21 1 3 4 2 5 A B a b c d e Cell1: FS(Cell_1) = 2 TE(Cell_1) = 1 g(Cell_1) = 1 Cell 2: FS(Cell_2) = 0 TE(Cell_2) = 1 g(Cell_2) = -1 Cell 3: FS(Cell_3) = 1 TE(Cell_3) = 1 g(Cell_3) = 0 Cell 4: FS(Cell_4) = 1 TE(Cell_4) = 1 g(Cell_4) = 0 Cell 5: FS(Cell_5) = 1 TE(Cell_5) = 0 g(Cell_5) = 1 Step 2: Select the base cell Possible base cells are Cell 1 and Cell 5 Balance criterion after moving Cell 1: area(A) = area(Cell_2) = 4 Balance criterion after moving Cell 5: area(A) = area(Cell_1) + area(Cell_2) + area(Cell_5) = 11 Both moves respect the balance criterion, but Cell 1 is selected, moved, and fixed as a result of the tie-breaking criterion. 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example
22
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 22 1 3 4 2 5 A B a b c d e Step 3: Fix base cell, update g values Cell 2: FS(Cell_2) = 2TE(Cell_2) = 0 g(Cell_2) = 2 Cell 3: FS(Cell_3) = 0TE(Cell_3) = 1 g(Cell_3) = -1 Cell 4: FS(Cell_4) = 0TE(Cell_4) = 2 g(Cell_4) = -2 Cell 5: FS(Cell_5) = 0TE(Cell_5) = 1 g(Cell_5) = -1 After Iteration i = 1: Partition A 1 = 2 , Partition B 1 = 1,3,4,5 , with fixed cell 1 . 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example
23
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 23 1 3 4 2 5 A B a b c d e Cell 2: FS(Cell_2) = 2 TE(Cell_2) = 0 g(Cell_2) = 2 Cell 3: FS(Cell_3) = 0 TE(Cell_3) = 1 g(Cell_3) = -1 Cell 4: FS(Cell_4) = 0 TE(Cell_4) = 2 g(Cell_4) = -2 Cell 5: FS(Cell_5) = 0 TE(Cell_5) = 1 g(Cell_5) = -1 Iteration i = 2 Cell 2 has maximum gain g 2 = 2, area(A) = 0, balance criterion is violated. Cell 3 has next maximum gain g 2 = -1, area(A) = 5, balance criterion is met. Cell 5 has next maximum gain g 2 = -1, area(A) = 9, balance criterion is met. Move cell 3, updated partitions: A 2 = {2,3}, B 2 = {1,4,5}, with fixed cells {1,3} Iteration i = 1 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example
24
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 24 Cell 2: g(Cell_2) = 1 Cell 4: g(Cell_4) = 0 Cell 5: g(Cell_5) = -1 Iteration i = 3 Cell 2 has maximum gain g 3 = 1, area(A) = 1, balance criterion is met. Move cell 2, updated partitions: A 3 = {3}, B 3 = {1,2,4,5}, with fixed cells {1,2,3} 1 3 4 2 5 A B a b c d e Iteration i = 2 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example
25
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 25 Cell 4: g(Cell_4) = 0 Cell 5: g(Cell_5) = -1 Iteration i = 4 Cell 4 has maximum gain g 4 = 0, area(A) = 5, balance criterion is met. Move cell 4, updated partitions: A 4 = {3,4}, B 3 = {1,2,5}, with fixed cells {1,2,3,4} 1 3 4 2 5 B A a b c d e Iteration i = 3 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example
26
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 26 Cell 5: g(Cell_5) = -1 Iteration i = 5 Cell 5 has maximum gain g 5 = -1, area(A) = 10, balance criterion is met. Move cell 5, updated partitions: A 4 = {3,4,5}, B 3 = {1,2}, all cells {1,2,3,4,5} fixed. 1 3 4 2 5 B A a b c d e Iteration i = 4 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example
27
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 2: Netlist and System Partitioning © KLMH Lienig 27 Step 5: Find best move sequence c 1 … c m G 1 = g 1 = 1 G 2 = g 1 + g 2 = 0 G 3 = g 1 + g 2 + g 3 = 1 G 4 = g 1 + g 2 + g 3 + g 4 = 1 G 5 = g 1 + g 2 + g 3 + g 4 + g 5 = 0. Maximum positive cumulative gain found in iterations 1, 3 and 4. The move prefix m = 4 is selected due to the better balance ratio (area(A) = 5); the four cells 1, 2, 3 and 4 are then moved. Result of Pass 1: Current partitions: A = {3,4}, B = {1,2,5}, cut cost reduced from 3 to 2. 1 3 4 2 5 B A a b c d e 2.4.3Fiduccia-Mattheyses (FM) Algorithm – Example
28
28 مرتضي صاحب الزماني Ratio Cut Objective It is not desirable to have a pre-defined ratio on the partition sizes. Wei and Cheng proposed the ratio cut objective ( C XY /(|X| |Y|) where C XY is the cut size ) instead of C XY. A heuristic based on FM was proposed. e.g. |X+Y| = 13 6*7 is the maximum (vs. 5*8 or 4*9).
29
29 مرتضي صاحب الزماني Component Replication Before replication: Cutsize = 15 After replication: Cutsize = 10
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.