A recursive paradigm to solve Boolean relations David
A recursive paradigm to solve Boolean relations David Bañeres Univ. Politècnica de Catalunya Jordi Cortadella Univ. Politècnica de Catalunya Mike Kishinevsky Strategic CAD Lab. , Intel Corp.
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 a b c ? a b c x f ? y z ? a b c 2
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz a b c ? a b c x f ? y z ? a b c 3
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 x y 0 z 0 4
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 0 0 0 x y 0 z 0 5
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 0 0 x 0 y 0 z 1 6
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 | 01 x 0 y 0 z 1 7
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 | 01 1 x y 1 z 0 8
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 | 01 1 0 0 0 | 01 1 x y 1 z 0 9
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 | 01 1 0 0 0 | 01 x 1 y 1 z 1 10
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 | 01 1 0 | 11 0 0 | 01 x 1 y 1 z 1 11
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 | 01 1 0 | 11 0 0 | 01 x y z 12
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 0 1 0 xyz 0 0 | 01 1 0 | 11 0 0 | 01 x y z 13
Boolean relation: example a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 xyz 0 0 | 01 1 0 | 11 0 0 | 01 a b c ? a b c x f ? y z ? a b c 14
Boolean relation: example a a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 xyz 0 0 | 01 1 0 | 11 0 0 | 01 x f c y z b x f a ab y z c c x f b y z a 15
Applications of Boolean Relations Boolean matching techniques for library binding n L. Benini and G. D. Micheli, 1997 FSM encoding n B. Lin and F. Somenzi, 1990 Boolean decomposition n M. Damiani, J. Yang, and G. D. Micheli, 1995 … and others 16
Outline Boolean Relations The semi-lattice of solutions The recursive paradigm Experimental results 17
Boolean Relations a 0 0 1 1 b 0 1 f g 10 01 | 10 1 18
Boolean Relations a 0 0 1 1 b 0 1 f g 10 01 | 10 1 19
Boolean Relations a 0 0 1 1 b 0 1 f g 10 01 | 10 1 20
Solving Boolean Relations Finding f and g such that R is a tautology a 0 0 1 1 b 0 1 f g 10 01 | 10 1 21
Solving Boolean Relations Finding f and g such that R is a tautology a 0 0 1 1 b 0 1 f g 10 01 | 10 1 22
Solving Boolean Relations Finding f and g such that R is a tautology a 0 0 1 1 b 0 1 f g 10 01 | 10 1 23
Solving Boolean Relations Finding f and g such that R is a tautology a 0 0 1 1 b 0 1 f g 10 01 | 10 1 24
Solving Boolean Relations Finding f and g such that R is a tautology a 0 0 1 1 b 0 1 f g 10 01 | 10 1 25
Solving Boolean Relations Finding f and g such that R is a tautology a 0 0 1 1 b 0 1 f g 10 01 | 10 1 10 00 11 01 26
Related work Exact solvers n F. Somenzi and R. K. Brayton (1989) Method similar to Quine-Mc. Cluskey Extension of primes to c-primes n S. Jeong and F. Somenzi (1992) Formulate the problem as a BCP 27
Related work Heuristic approaches (based on ESPRESSO) n n A. Ghosh, S. Devadas and A. Newton (1992) Y. Watanabe and R. K. Brayton (1993) GYOCRO x: =Initial Solution; do REDUCE(x); EXPAND(x); IRREDUNDANT(x); while (x is improved); 28
ab f g 00 01 10 11 Boolean relation 29
ab f g 00 01 10 11 30
00 01 10 11 31
00 01 10 11 32
00 01 10 11 01 10 00 01 10 11 00 01 10 11 R R’ 00 01 10 11 00 01 10 11 00 01 10 11 Functions 00 01 10 11 01 11 00 01 10 11 00 01 10 11 00 01 10 11 33 00 01 10 11
ab 00 01 10 11 fg (Bn Bm) Maximum flexibility Less flexibility Functions 34
ab 00 01 10 11 fg ab 00 01 10 11 Optimum-cost function fg 10 00 | 11 1 1 | 1 ab 00 01 10 11 fg 10 00 11 01 35
Number of variables (Bn Bm) ( Number of functions ) Functions Size of the semi-lattice 36
Incompletely specified functions Shortcut: use 2 -level minimizers ! (ESPRESSO, Minato-Morreale, Scherzo) 37
Subclasses of Boolean relations ab f g 00 10 01 00 | 11 10 1 11 1 | 1 00 01 10 11 General Boolean Relations 10 11 1 Incompletely Specified Functions ESPRESSO Minato-Morreale (BDDs) Scherzo (ZDDs). . . ab f g 00 01 10 11 01 10 Completely Specified Functions 2 -level minimizers Sum-of-products 38
ab f g 10 00 01 00 | 11 1 10 11 01 | 10 10 00 01 01 10 11 1 01 | 10 10 00 01 10 10 00 11 01 10 11 01 01 | 10 10 00 11 10 10 11 01 01 10 11 11 01 | 10 10 11 01 10 10 11 11 01 10 11 11 10 39
ab f g 10 00 01 00 | 11 1 10 11 01 | 10 Gyocro 10 00 1 01 | 10 10 00 11 01 | 10 10 00 01 01 10 11 1 01 | 10 10 00 01 10 10 00 11 01 10 11 01 01 | 10 10 00 11 10 10 11 01 01 10 11 11 01 | 10 10 11 01 10 10 11 11 01 10 11 11 10 42
GYOCRO x: =Initial Solution; do REDUCE(x); EXPAND(x); IRREDUNDANT(x); while (x is improved); ? 10 00 11 01 Impossible ! It’s a local minimum 10 11 11 10 43
The recursive approach (BREL)
Projections ab f g 00 10 01 00 | 11 10 1 11 01 | 10 f 00 01 10 11 1 47
Projections ab f g f 00 10 01 00 | 11 10 1 11 01 | 10 00 01 10 11 1 abg g 00 01 10 11 0 1 48
Projections ab f g f 00 10 01 00 | 11 10 1 11 01 | 10 R 00 01 10 11 1 abg g 00 01 10 11 0 1 ab fg merge 00 01 10 1 R’ R’ is an incompletely specified function, but … has more flexibility than R (R R’) 49
ISF BR projection 50
ISF minimizer done ! 51
ISF minimizer incompatible ! 52
The recursive paradigm ab f g 00 01 10 11 10 00 | 11 1 01 | 10 projection f g f g 10 10 11 11 10 00 | 11 1 01 | 10 minimization compatible? ISF with more flexibility 53
The recursive paradigm ab f g 00 01 10 11 10 00 | 11 1 01 | 10 projection f g f g 10 10 11 11 10 00 | 11 1 01 | 10 minimization compatible? ISF with more flexibility 54
ISF minimizer incompatible ! 55
The recursive paradigm pick one conflict ab f g 00 01 10 11 10 00 | 11 1 01 | 10 projection f g f g 10 10 11 11 10 00 | 11 1 01 | 10 minimization compatible? ISF with more flexibility 56
The recursive paradigm f g 10 00 1 01 | 10 ab f g 00 01 10 11 10 00 | 11 1 01 | 10 split f g 10 11 1 01 | 10 57
ISF minimizer incompatible ! 58
BR 1 BR 2 59
The recursive paradigm ab f g 00 01 10 11 10 00 | 11 1 01 | 10 f g f g 10 00 1 01 | 10 10 00 11 01 10 00 | 11 1 01 | 10 ISF split f g 10 11 1 01 | 10 60
The recursive paradigm ab f g 00 01 10 11 10 00 | 11 1 01 | 10 f g f g 10 00 1 01 | 10 10 00 11 01 ISF f g f g 10 11 1 01 | 10 10 11 11 11 split ISF incompatible split ? 61
ab f g 00 01 10 11 10 00 | 11 1 01 | 10 f g f g 10 00 1 01 | 10 10 00 11 01 ISF f g f g 10 11 1 01 | 10 10 11 11 11 split The recursive paradigm ISF incompatible cost 62
The recursive paradigm ab f g 00 01 10 11 10 00 | 11 1 01 | 10 f g f g 10 00 1 01 | 10 10 00 11 01 ISF f g f g 10 11 1 01 | 10 10 11 11 11 split ISF incompatible 63
ab f g 10 00 01 00 | 11 1 10 11 01 | 10 10 00 01 01 10 11 1 01 | 10 split 10 00 01 10 10 00 11 01 10 11 01 01 | 10 10 00 11 10 10 11 01 01 10 11 11 01 | 10 10 11 01 10 10 11 11 01 10 11 11 10 64
ab f g 10 00 01 00 | 11 1 10 11 01 | 10 10 00 1 01 | 10 10 11 1 01 | 10 incompatible split 10 11 01 01 | 10 10 00 11 01 10 11 01 01 10 11 11 01 | 10 10 11 01 10 10 11 11 01 10 11 11 10 65
ab f g 10 00 01 00 | 11 1 10 11 01 | 10 10 00 1 01 | 10 split 10 11 1 01 | 10 incompatible 10 00 11 01 66
67
BREL (R, best. F ) R’ : = project (R) F : = ISF-minimize (R’) R’ if cost(F) cost(best. F) best. F return if F R then best. F : = F else x : = pick-one-conflict (F, R) (R 1, R 2): = split (R, x) BREL( BREL R 1, best. F) best. F BREL( BREL R 2, best. F) best. F endif 68
Algorithmic engineering details BDDs for the exploration of solutions n n n Efficient manipulation of characteristic functions ISF minimizers (Minato-Morreale, Restrict, …) Intensive use of the cache (many identical sub-problems) Store the best k solutions n ESPRESSO + factorization (accurate cost estimation) Hybrid exploration of the tree (BFS + DFS + quick solver) Clever conflict selection (with many neighboring conflicts) Highly customizable: cost function, traversal strategy, best solution after timeout 69
Gyocro PI PO int 1 4 int 10 BREL LIT AREA CPU 3 8 9280 0. 03 9 8352 0. 01 6 4 32 44544 0. 08 34 41296 0. 02 c 17 i 5 3 34 34336 0. 04 30 32016 0. 01 she 1 5 3 16 16240 0. 04 15 17632 0. 00 she 2 5 5 31 30624 0. 09 24 26488 0. 01 she 3 6 4 23 24592 0. 08 21 21344 0. 01 she 4 5 6 56 62176 0. 14 40 46864 0. 03 gr 14 11 318 346608 3. 43 313 322016 6. 79 b 9 16 5 321 382336 4. 68 256 306240 0. 19 int 15 22 14 506 525248 21. 94 459 472352 19. 14 vtx 22 6 117 151728 30. 10 101 Normalized sum 1. 00 BREL Configuration: 1. 00 0. 89 94656 0. 86 0. 58 0. 44 Cost function Sum of BDDs sizes ISF Minimizer Minato-Morreale # explored relations: 10 70
Gyocro PI PO int 1 4 int 10 BREL LIT AREA CPU 3 8 9280 0. 03 9 8352 0. 01 6 4 32 44544 0. 08 34 41296 0. 02 c 17 i 5 3 34 34336 0. 04 30 32016 0. 01 she 1 5 3 16 16240 0. 04 15 17632 0. 00 she 2 5 5 31 30624 0. 09 24 26488 0. 01 she 3 6 4 23 24592 0. 08 21 21344 0. 01 she 4 5 6 56 62176 0. 14 40 46864 0. 03 gr 14 11 318 346608 3. 43 313 322016 6. 79 b 9 16 5 321 382336 4. 68 256 306240 0. 19 int 15 22 14 506 525248 21. 94 459 472352 19. 14 vtx 22 6 117 151728 30. 10 101 Normalized sum 1. 00 0. 89 94656 0. 86 0. 58 0. 44 71
Gyocro PI PO int 1 4 int 10 BREL LIT AREA CPU 3 8 9280 0. 03 9 8352 0. 01 6 4 32 44544 0. 08 34 41296 0. 02 c 17 i 5 3 34 34336 0. 04 30 32016 0. 01 she 1 5 3 16 16240 0. 04 15 17632 0. 00 she 2 5 5 31 30624 0. 09 24 26488 0. 01 she 3 6 4 23 24592 0. 08 21 21344 0. 01 she 4 5 6 56 62176 0. 14 40 46864 0. 03 gr 14 11 318 346608 3. 43 313 322016 6. 79 b 9 16 5 321 382336 4. 68 256 306240 0. 19 int 15 22 14 506 525248 21. 94 459 472352 19. 14 vtx 22 6 117 151728 30. 10 101 Normalized sum 1. 00 0. 89 94656 0. 86 0. 58 0. 44 72
Gyocro PI PO int 1 4 int 10 BREL LIT AREA CPU 3 8 9280 0. 03 9 8352 0. 01 6 4 32 44544 0. 08 34 41296 0. 02 c 17 i 5 3 34 34336 0. 04 30 32016 0. 01 she 1 5 3 16 16240 0. 04 15 17632 0. 00 she 2 5 5 31 30624 0. 09 24 26488 0. 01 she 3 6 4 23 24592 0. 08 21 21344 0. 01 she 4 5 6 56 62176 0. 14 40 46864 0. 03 gr 14 11 318 346608 3. 43 313 322016 6. 79 b 9 16 5 321 382336 4. 68 256 306240 0. 19 int 15 22 14 506 525248 21. 94 459 472352 19. 14 vtx 22 6 117 151728 30. 10 101 Normalized sum 1. 00 0. 89 94656 0. 86 0. 58 0. 44 73
Recursive n-way decomposition f 1 f 2 f 3 f 4 f 1 f 2 f f 3 f 4 f 1 f 2 subsumes bi-decomposition f 1 f 3 f 2 74
Recursive n-way decomposition f 1 f 2 f 3 f 4 f 1 f 2 f f 3 f 4 0 f 2 subsumes bi-decomposition f 1 f 3 f 2 75
Recursive n-way decomposition f 1 f 2 f 3 f 4 f 1 f 2 f f 3 f 4 f 2 subsumes bi-decomposition f 1 f 3 f 2 76
ALGEBR + SPEED BREL-DECOMPOSITION PI PO AREA DELAY CPU 9 symml 9 1 293712 9. 79 149872 7. 85 192. 34 majority 5 1 8352 3. 06 7424 2. 86 3. 32 b 1 3 4 12528 2. 86 10672 2. 81 0. 97 cm 150 a 21 1 63568 7. 25 63568 5. 96 46. 02 cm 85 a 11 3 68208 5. 57 57072 4. 82 30. 42 cm 162 a 14 5 83520 5. 93 75632 5. 37 42. 26 cm 163 a 16 5 61248 6. 19 63104 5. 44 29. 26 frg 1 28 3 139664 9. 07 68672 5. 67 679. 48 c 8 28 18 150800 6. 99 198128 6. 01 84. 92 cc 21 20 87696 5. 98 89088 5. 16 29. 20 ttt 2 24 21 232464 8. 66 271904 7. 29 162. 19 cht 47 36 174000 6. 08 270976 5. 16 40. 67 i 5 133 66 447296 8. 20 600880 6. 99 503. 50 i 7 199 67 724304 8. 71 817568 7. 29 283. 52 x 3 135 99 832416 11. 10 1215680 7. 50 1082. 86 1. 00 1. 17 0. 81 Normalized sum 77
Conclusions Boolean relations carry a huge space of solutions. Easy to be trapped on sub-optimal local minima. The semi-lattice is “infested” by ISFs ! BREL: finds a path to the best ISF by recursively solving conflicts Future work: n Exploitation of symmetries n Boolean decomposition targeting at delay minimization BREL publicly available (send e-mail) 78
- Slides: 74