A Fast SPFD - based Rewiring Technique Pongstorn Maidee and Kia Bazargan Pongstorn Maidee and Kia Bazargan University of Minnesota University of Minnesota USA USA 1
Rewiring : What is it & Why Use it? Rewiring : What is it & Why Use it? IFU f 1 f 1 A A f 1 B B C C f 2 g 2 DEC D D E g 3 E f 3 f 2 f 3 F F ALU 1) Synthesis 2) Mapping 3) Placement 4) Routing � If optimization goal is not met at placement, � Feed info back to earlier stage (slow, may not converge) � Restructure circuit at this stage (circuit rewiring) 2
Rewiring Techniques Rewiring Techniques Methods How? speed quality FPGA? Methods How? speed quality FPGA? ATPG Check redundancy fast OK Yes ATPG Check redundancy fast OK Yes Graph- - Match subcircuit to Very OK No Graph Match subcircuit to Very OK No based prototype fast based prototype fast SPFD Better way to describe Slow Best Yes SPFD Better way to describe Slow Best Yes circuit functionality circuit functionality Symbolic Boolean reasoning Slow OK yes Symbolic Boolean reasoning Slow OK yes 3
SPFD- -based Rewiring Engine: based Rewiring Engine: SPFD Problems & Solutions Problems & Solutions Conventional SPFD- -based rewiring based rewiring Conventional SPFD � � � Use BDD to represent SPFD � Use BDD to represent SPFD ⇒ BDD size may be large ⇒ BDD size may be large ⇒ Runtime/ ⇒ Runtime/Memory bottleneck. Memory bottleneck. Propose: Propose: � � ⇒ fast based rewiring engine ⇒ � � SAT- -based SPFD based SPFD- -based rewiring engine fast SAT Contributions: Contributions: � � ⇒ use less memory based rewiring ⇒ � � Use SAT for SPFD- -based rewiring use less memory Use SAT for SPFD � � Use auxiliary circuits to find SPFD propagation paths propagation paths Use auxiliary circuits to find SPFD � � Devise a way to use one SAT run one SAT run to see if a rewiring is valid. to see if a rewiring is valid. Devise a way to use 4
Outline Outline � Binary functions and their representations. Binary functions and their representations. � � Definition of SPFD. Definition of SPFD. � � Why SPFD? Why SPFD? � � SPFD computation SPFD computation � � SPFD SPFD- -based rewiring based rewiring � � Efficient SPFD rewiring Efficient SPFD rewiring � 5
Binary Functions = Bipartite Graphs Binary Functions = Bipartite Graphs � Incompletely Specified Incompletely Specified � Completely Specified Completely Specified � � Function (ISF) Function (ISF) Function Function x y y f x f x y y f x f 0 0 0 0 0 0 0 0 0 0 0 0 Where? 0 1 1 1 1 0 0 1 1 1 1 0 11 1 0 1 0 1 1 1 0 1 0 1 1 01 00 1 1 1 1 0 0 1 1 1 1 * * 10 On set Off set 11 11 01 11 01 01 00 00 10 00 10 10 A function can be represented as a bipartite graph. 6
Set of Pairs of Functions to be Set of Pairs of Functions to be Distinguished (SPFD) Distinguished (SPFD) � List each edge of a bipartite graph : List each edge of a bipartite graph : � 01 {(00,01 00,01),( ),(00,10 00,10)} )} {( 00 10 � If each node is a function : the list becomes If each node is a function : the list becomes � SPFD = {( g g 1 , h h 1 ),( g g 2 , h h 2 ),… …,( ,( g g n , h h n )}. SPFD = {( 1 , 1 ),( 2 , 2 ), n , n )}. � f f satisfies a pair of functions ( satisfies a pair of functions ( g g , , h h ), ), � if f f includes either includes either g g or or h h BUT BUT not both. not both. if � f f satisfies SPFD, if satisfies SPFD, if f f satisfies each pair in SPFD. satisfies each pair in SPFD. � NOR 11 XOR G H 01 00 10 OR 7
Why SPFD? Why SPFD? 001 011 SPFD is more flexible than ISF. ⇓ 111 Rewiring based on SPFD is more powerful 110 than those based on ISF. 101 ISF SPFD 001 011 001 011 001 011 ... 111 111 111 110 110 110 101 101 101 2 4 = 16 functions 2 3 * 2 2 = 32 functions As a requirement for a node to be a valid Boolean function: - ISF: combine both groups and implicitly add extra edges - SPFD: no need to combine groups. A Boolean function at a node (complete bipartite ) must be superset of the SPFD 8
SPFD Computation SPFD Computation � No synthesis tool generates SPFD (as of now) No synthesis tool generates SPFD (as of now) � � Need to compute SPFD on a synthesized network Need to compute SPFD on a synthesized network � � SPFD at a PO SPFD at a PO x x is ( f( is ( f( x x ) , inv(f( ) , inv(f( x x )) ) )) ) � � Propagate SPFD backwards Propagate SPFD backwards � abc Distinguish by Gate 1, Distribute to Gate 1. 001 011 Gate 1 a x 001 011 111 f 1 = x+y 100 f 1 = x+y Gate 2 y b 101 x f 2 = x y f 2 = x y c y 111 100 Distinguish by c , 101 Distribute to c . 9
Distributing Order Distributing Order � What if more than one fanin distinguish a pair ? What if more than one fanin distinguish a pair ? � � Convention : Distribute to the first fanin in a distributing ord Convention : Distribute to the first fanin in a distributing order. er. � � Important ? Distributing order determines # pairs flowing in Important ? Distributing order determines # pairs flowing in � parts of a circuit. parts of a circuit. Distinguished by abc 001 011 both fanins. Gate 1 a 100 x 001 011 f 1 = x+y f 1 = x+y y b 111 100 Gate 2 1st 2nd 101 x f 2 = x y f 2 = x y c y 2nd 1st Show 2 different orders: 001 ( x , y ) and ( y , x ) 111 Distributing order 100 101 at Gate 2 10
SPFD- -based Rewiring based Rewiring SPFD � Where to add a new wire ? Effect of removing wr pass node A. e N Add wn at A may compensate for that. A wr d wn g Dominator of N = { N , A } � Rewiring is valid if SPFD( wr ) ⊆ SPFD(sr( wn )) Gate 3 Satisfied by both gates 1 and 3 x z 001 011 z = !x y ⇒ replace (1,2) with (3,2) y 111 Gate 1 a x z 001 011 z = x ⊕ y y b 111 100 Gate 2 x z z = x y y c 11
Previous work � Conventional SPFD-based rewiring � Use BDD to represent SPFD ⇒ BDD size becomes bottleneck. � Use SAT for circuit restructuring � Build new node producing the same care minterms as the old node. � Don’t care is not as flexible as SPFD ⇒ inferior to SPFD-based. � Previous use of SAT to compute SPFD � Cannot capture SPFD flow 0 1 1 0 0 s r s r s’ r’ 1 1 0 p 0 p q q p’ q’ 0 = q don’t need to distinguish (101,001) because p does. But, there is no path from p to s ! 1 0 1 0 0 1
Our Efficient Given Our Efficient w r , w n SPFD Rewiring SPFD Rewiring Create a SAT instance � For each candidate wire For each candidate wire � NO � Build rewiring instance such Build rewiring instance such � Unsatisfiable that it is unsatisfiable if valid that it is unsatisfiable if valid YES � Check rewiring validity Check rewiring validity � Find new local functions � Find new function for the valid Find new function for the valid � rewiring rewiring � Check the rewiring circuit against Check the rewiring circuit against Check the rewired circuit � against the original one. the original circuit. the original circuit. (extra pairs of minterms introduced (extra pairs of minterms introduced inside the circuit are not captured ) inside the circuit are not captured ) YES Invalid rewiring Satisfiable NO Valid rewiring 13
The Pair Distinguishable ? The Pair Distinguishable ? a p f(y) =(a ⊕ e)u r x SPFD(y) e q 101 00- s y 011 010 u 100 11- 1 1 a 1 If a pair ∉ SPFD( y ), p 1 r 1 x 1 output is 0 . e 1 0 0 1 1 1 1 q 1 If a pair ∈ SPFD( y ), s 1 y 1 u 1 1 1 0 output is 1 . a 2 0 0 p 2 r 2 x 2 1 e 2 If a pair ∈ SPFD( y ), 1 0 1 0 q 2 s 2 ∃ a distinguishable path. y 2 u 2 1 1 0 1 14
Find Distinguishable Pairs with SAT Find Distinguishable Pairs with SAT 1 a 1 p 1 a r 1 p r x SPFD(X) e 1 0 e 1 r 1 /r 2 1 q 1 q s 1 force s y u 1 1 u 1 a 2 Circuit to find pairs of 0 p 2 r 2 SPFD(X) SPFD( x ) | SPFD( y ). s 1 /s 2 or e 2 0 (can be converted to 0 0 q 2 SPFD(Y) s 2 a SAT instance) u 2 1 � A pair ∈ SPFD( x ) | SPFD( y ) if output is 1 ⇒ add forcing clause Forcing clause := become 0 if NOT match Eg. a 1 ,e 1 ,u 1 ,a 2 ,e 2 ,u 2 = 101001 is (a 1 )( ē 1 )(u 1 )( ā 2 )( ē 2 )(u 2 ) � Prevent SAT solver to discover the same pair ⇒ add blocking clause Blocking clause := become 0 if match Eg. a 1 ,e 1 ,u 1 ,a 2 ,e 2 ,u 2 = 101001 is ( ā 1 +e 1 + ū 1 +a 2 +e 2 + ū 2 ) 15
Finding SPFD at an internal node � A pair ∈ SPFD at PO x, if x distinguishes the pair. � (101,001) distinguished by p and a PO y . But, (101,001) ∉ SPFD( p ) because NO distinguishable path path from p to a PO. 1 a 1 0 1 p 1 r 1 x 1 e 1 0 1 1 q 1 y 1 s 1 u 1 1 0 a 2 0 p 2 0 r 2 x 2 e 2 0 0 q 2 y 2 s 2 u 2 1 0 � To find SPFD at an internal node ⇒ need to add some circuits to trace a distinguishable path
Miter to Find SPFD(n) to Find SPFD(n) Miter a f I 0 0 0 O 0 0 0 b x j O 1 0 1 I 1 0 1 Priority encoder c g i maintains n O 2 1 0 1 1 I 2 y k d Distributing order h 0 0 O 3 0 0 I 3 e Transitive fanout cone of n a 1 /a 2 For PO X f 1 /f 2 j 1 /j 2 g 1 /g 2 i 1 /i 2 b 1 /b 2 k 1 /k 2 n 1 n 1 /n 2 h 1 /h 2 For PO Y e 1 /e 2 Priority encoder 17
Recommend
More recommend