Specialized Applications of Decision Diagrams Alan Mishchenko

Slides:



Advertisements
Similar presentations
Switching circuits Composed of switching elements called “gates” that implement logical blocks or switching expressions Positive logic convention (active.
Advertisements

FUNCTION OPTIMIZATION Switching Function Representations can be Classified in Terms of Levels Number of Levels, k, is Number of Unique Boolean (binary)
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
ECE 667 Synthesis & Verification - Boolean Functions 1 ECE 667 Spring 2013 ECE 667 Spring 2013 Synthesis and Verification of Digital Circuits Boolean Functions.
ECE 331 – Digital System Design
Logic Synthesis Part II
A New Approach to Structural Analysis and Transformation of Networks Alan Mishchenko November 29, 1999.
ENEE 6441 On Quine-McCluskey Method > Goal: find a minimum SOP form > Why We Need to Find all PIs? f(w,x,y,z) = x’y’ +wxy+x’yz’+wy’z = x’y’+x’z’+wxy+wy’z.
ECE Synthesis & Verification - Lecture 19 1 ECE 667 Spring 2009 ECE 667 Spring 2009 Synthesis and Verification of Digital Systems Functional Decomposition.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 4-1 Chapter #2: Two-Level Combinational Logic Section 2.3, Switches and Tools.
Cook-Levin Theorem Circuit Satisfiability –A “first” NP-complete problem Reduction overview Example reduction.
ECE Synthesis & Verification - Lecture 10 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Binary.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
ECE 667 Synthesis & Verification - BDD 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Binary Decision Diagrams (BDD)
 2000 M. CiesielskiPTL Synthesis1 Synthesis for Pass Transistor Logic Maciej Ciesielski Dept. of Electrical & Computer Engineering University of Massachusetts,
ECE 667 Synthesis and Verification of Digital Systems
Grover’s Algorithm in Machine Learning and Optimization Applications
Fast Spectral Transforms and Logic Synthesis DoRon Motter August 2, 2001.
State Minimization and Determinization EECS 290A Sequential Logic Synthesis and Verification.
Logic Decomposition ECE1769 Jianwen Zhu (Courtesy Dennis Wu)
Faster Logic Manipulation for Large Designs Alan Mishchenko Robert Brayton University of California, Berkeley.
Combinatorial Algorithms Unate Covering Binate Covering Graph Coloring Maximum Clique.
Combinational Problems: Unate Covering, Binate Covering, Graph Coloring and Maximum Cliques Example of application: Decomposition.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Boolean Functions 1 ECE 667 ECE 667 Synthesis and Verification of Digital Circuits Boolean Functions Basics Maciej Ciesielski Univ.
BDS – A BDD Based Logic Optimization System Presented by Nitin Prakash (ECE 667, Spring 2011)
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
EET 1131 Unit 5 Boolean Algebra and Reduction Techniques
CHAPTER 6 Quine-McCluskey Method
Reducing Structural Bias in Technology Mapping
Logic Synthesis Boolean Division.
Lecture 3: Incompletely Specified Functions and K Maps
Combinational Logic Design&Analysis.
CSC205 Jeffrey N. Denenberg Lecture #5
Combinational Circuit Design
Delay Optimization using SOP Balancing
Computer Architecture CST 250
Faster Logic Manipulation for Large Designs
Robert Brayton Alan Mishchenko Niklas Een
CHAPTER 2 Boolean Algebra
A. Mishchenko S. Chatterjee1 R. Brayton UC Berkeley and Intel1
Alan Mishchenko University of California, Berkeley
Versatile SAT-based Remapping for Standard Cells
Example of application: Decomposition
A Boolean Paradigm in Multi-Valued Logic Synthesis
Lecture 3: Incompletely Specified Functions and K Maps
LPSAT: A Unified Approach to RTL Satisfiability
Faster Logic Manipulation for Large Designs
CHAPTER 5 KARNAUGH MAPS 5.1 Minimum Forms of Switching Functions
ECE 667 Synthesis and Verification of Digital Systems
Fast Computation of Symmetries in Boolean Functions Alan Mishchenko
Alan Mishchenko University of California, Berkeley
Binary Decision Diagrams
Optimization Algorithm
SAT-based Methods for Scalable Synthesis and Verification
COE 202: Digital Logic Design Combinational Logic Part 3
Alan Mishchenko UC Berkeley (With many thanks to Donald Knuth,
Synthesis and Verification of Finite State Machines
Alan Mishchenko UC Berkeley (With many thanks to Donald Knuth for
Introduction to Logic Synthesis
Overview Part 2 – Circuit Optimization
SAT-Based Logic Synthesis
Heuristic Minimization of Two Level Circuits
design entry (schematic capture, VHDL, truth table and etc.)
Delay Optimization using SOP Balancing
Basic circuit analysis and design
Canonical Computation without Canonical Data Structure
SAT-based Methods: Logic Synthesis and Technology Mapping
SAT-Based Logic Synthesis
Lecture 3: Incompletely Specified Functions and K Maps
Presentation transcript:

Specialized Applications of Decision Diagrams Alan Mishchenko Electrical and Computer Engineering Portland State University October 22, 2001

Electronic Systems Design Seminar, UC Berkeley Overview Applications of Decision Diagrams (DDs) Typical, not so typical, and specialized Fast checks Generic DD traversal procedure Case study: Checking for redundant variables Other specialized operators Decomposability checks Encoding Two-level SOP minimization Computing of Walsh and Haar spectra Conclusions September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Applications of DD operators Standard Apply (Boolean AND,OR,XOR), If-Then-Else (ITE), quantifications, cofactoring Non-standard ISOP, compatible projection, disjoint cover Specialized Useful for one application only Performance improvements are possible by tailoring DD operators to the application Significant improvements are possible if processing can be reduced to checking conditions on the DD structure, without building new DD nodes ( example: Cudd_bddIteConstant() ) September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Generic DD Traversal Procedure dd Traversal( dd A, dd B ) { (1) terminal cases (2) cache lookup (3) cofactoring w.r.t. the top variable in A and B (4) recursively solving subproblems (5) deriving the solution from the partial solutions (6) cache insert (7) returning the result } Typically, in the case of recursive pseudo-code, it makes sense to put on the slide only the essential relationships, without mentioning all the details. Meanwhile, the speaker can say: Functions and variable sets are represented by BDDs, spectra by ADDs. (2) TopVariable(), Cofactors(), and ITE() are standard constant-time operations on decision diagrams. (3) In the expression “V-x”, minus stands for the set-difference operator. (4) One line below, “+” and “-” are operations, which take two sets of coefficients represented as ADDs, and return an ADD representing the set of coefficients computed by adding (subtracting) the corresponding coefficients of the arguments. In other words, these operations implement the element-wise addition and subtraction of matrices. (5) The cache lookup and insert are omitted for clarity. September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Traversal Procedure: Boolean AND bdd AND( bdd A, bdd B ) { (1) if ( A == 0 ) return 0; if ( B == 0 ) return 0; if ( A == 1 ) return B; if ( B == 1 ) return A; if ( A == B ) return A; if ( A == B’ ) return 0; (2) cache lookup (3) (A0,A1)=Cofactors(A,x); (B0,B1)=Cofactors(F,x); (4) R0 = AND( A0, A1 ); R1 = AND( B0, B1 ); (5) R = ITE( x, R1, R0 ); (6) cache insert (7) return R; } Typically, in the case of recursive pseudo-code, it makes sense to put on the slide only the essential relationships, without mentioning all the details. Meanwhile, the speaker can say: Functions and variable sets are represented by BDDs, spectra by ADDs. (2) TopVariable(), Cofactors(), and ITE() are standard constant-time operations on decision diagrams. (3) In the expression “V-x”, minus stands for the set-difference operator. (4) One line below, “+” and “-” are operations, which take two sets of coefficients represented as ADDs, and return an ADD representing the set of coefficients computed by adding (subtracting) the corresponding coefficients of the arguments. In other words, these operations implement the element-wise addition and subtraction of matrices. (5) The cache lookup and insert are omitted for clarity. September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Checking Variable Redundancy 1 00 01 - 11 10 ab 1 00 - 01 11 10 ab Theorem. Variable c is redundant if and only if and September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Ellimination of Redundant Variables c c c ab 1 00 - 01 11 10 ab 1 00 01 - 11 10 ab 1 00 01 11 10 September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Redundancy Checking Procedure A procedure to perform the redundancy check for a set of variables without building new BDD nodes bool CheckRedundant( bdd F, bdd G, bdd Vars ); Arguments F is the on-set; G is the off-set; Vars is the variable set Return value TRUE, if variables in Vars are redundant in the incompletely specification function and can be removed from the support FALSE, otherwise September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Redundancy Checking Procedure Terminal cases If one of the arguments is 0, Vars are redundant If one of the arguments is 1, Vars are not redundant Recursive step If the topmost variable does not belong to Vars, call the procedure for both cofactors If the topmost variable belongs to Vars, check that the redundancy conditions are true September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Redundancy Checking Pseudocode bool CheckRedundant( bdd F, bdd G, bdd Vars ) { if ( F == 0 || G == 0 ) return TRUE; if ( F == 1 || G == 1 ) return FALSE; x = TopVar( F, G, Vars ); (F0, F1) = Cofactors( F, x ); (G0, G1) = Cofactors( G, x ); if ( x  Vars ) { /* the topmost variable belongs to Vars */ Res = CheckRedundant( F0, G1, Vars – x ); if ( Res == TRUE ) Res = CheckRedundant( F1, G0, Vars – x ); } else { /* the topmost variable does not belong to Vars */ Res = CheckRedundant( F0, G0, Vars ); if ( Res == TRUE ) Res = CheckRedundant( F1, G1, Vars ); } return Res; Typically, in the case of recursive pseudo-code, it makes sense to put on the slide only the essential relationships, without mentioning all the details. Meanwhile, the speaker can say: Functions and variable sets are represented by BDDs, spectra by ADDs. (2) TopVariable(), Cofactors(), and ITE() are standard constant-time operations on decision diagrams. (3) In the expression “V-x”, minus stands for the set-difference operator. (4) One line below, “+” and “-” are operations, which take two sets of coefficients represented as ADDs, and return an ADD representing the set of coefficients computed by adding (subtracting) the corresponding coefficients of the arguments. In other words, these operations implement the element-wise addition and subtraction of matrices. (5) The cache lookup and insert are omitted for clarity. September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Electronic Systems Design Seminar, UC Berkeley Resubstitution F F  G G Algebraic resubstitution exists if the result of division of F by G is not an empty cover Boolean resubstitution exists if adding the output of G to the support of F leads to the simplification of F September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Boolean Resubstitution Force variable g = G(x) into the support of F Minimize the support of FR(x,g) Accept the transformation, if the resulting function is simpler than F September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Impact on Boolean Resubstitution A - algebraic resubstitution A+B - algebraic resubstitution followed by boolean resubstitution BF - brute force approach S - smart approach September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Disjoint-Support Decomposition (DSD) DSD is the decomposition into logic blocks with disjoint support Theorem. For a completely specified function, the structure of DSD of the finest granularity is canonical (unique up to the complementation of inputs and outputs of the blocks) F d e G H a b c f g September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Checking Existence of DSD The algorithm [Bertacco, Damiani, ICCAD’97] computes the DSD structure from the shared BDD of a set of completely specified Boolean functions The condition that should be verified many times in the process of DSD: Is it true that two Boolean functions, F and G, are equal when restricted to the domains DF and DG? A specialized checking procedure has been designed to perform this check September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Electronic Systems Design Seminar, UC Berkeley Speeding-up DSD BD – Bertacco/Damiani, ICCAD’97 150 MHz PC M – Matsunaga, SASHIMI’98 266 MHz PC New – our implementation 933 MHz PC Dash (-) means that the result is not available in the publications. September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Non-Disjoint Decomposition Ashenhurst-Curtis Variable grouping Decomposition table Graph coloring Encoding Bi-Decomposition Variable grouping Checking conditions Deriving A and B using boolean formulas These schemes work for binary and MV functions/relations September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

DD Operators for MV Decomposition Ashenhurst-Curtis Checking column compatibility Problem: Given MV relation R(X,Y,V) and two columns C1(X) and C2(X), find out whether these columns are compatible bool CheckColumnCompatibility( bdd R, bdd C1, bdd C2 ); Bi-Decomposition Checking the existence of MAX/MIN-bi-decomposition Problem: Given MV relation R(X,V) and the partitioning of X into three sets Xa, Xb, and Xc, find out whether there exists bi-decomposition using MAX or MIN gate bool CheckMMDecomposability( bdd R, bdd Xa, bdd Xb ); September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Optimal Non-Strict Encoding Definition. Encoding is strict, if a code is a minterm depending on the encoding variable. Definition. Encoding is non-strict, if a code is a set of minterms depending on the encoding variable. (There should be no overlap between the sets.) Problem: Given a set of N Boolean or MV functions, Fi(X), and an array of variables V, |V|  |log2N|, find a non-strict encoding of the set of function, which guarantees that the resulting code-bit functions are simple in some sense. bdd FindEncoding(bdd * F, int N, bdd * Vars, int nVars); September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Electronic Systems Design Seminar, UC Berkeley Encoding: Good and Bad Before encoding Encoding   After encoding September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Two-Level SOP Minimization The problem with long history Explicit solutions Quine (1952), Espresso (1984), Espresso-Signature (1993) Implicit solutions Swami et al (1992), Coudert/Madre (1993), Scherzo (1994) Specialized DD operators in the implicit approach Prime computation Covering table reduction Minimization of the number of literals in the SOP SOP minimizer Rondo was designed after Scherzo http://www.ee.pdx.edu/~alanmi/research/min/minSop.htm September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Electronic Systems Design Seminar, UC Berkeley Espresso vs. Rondo E – Espresso R – Rondo September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Electronic Systems Design Seminar, UC Berkeley Walsh Spectrum Applications: Logic synthesis, technology mapping, NPN checking Traditionally computed using the Walsh matrix [Clarke et al, 1993] Walsh matrix can be defined recursively Examples: Wn-1 -Wn-1 Wn = W0 = 1 1 -1 1 -1 W1 = W2 = September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Computing Walsh Spectrum Brute-force approach Deriving the matrix and multiplying it by the truth vector Smart approach Developing a specialized DD procedure Illustration of the brute force approach: F = a + b. Truth vector is (0,1,1,1) Encoded truth vector is (1,-1,-1,-1) Spectrum is ( -2, 2, 2, 2 ) 1 -1 1 -1 -2 2 1 x1 x2 x1 x2 x = September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Computing Walsh Spectrum Smart approach Developing a specialized DD procedure based on a recursive definition of the Walsh matrix Walsh “butterfly diagram” [Thornton et al, RM’01] Illustration of the smart approach: F = a + b A A + B B A - B 1 -1 2 -2 -2 2 September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Walsh Spectrum Computation spectrum Walsh( bdd F, varset V ) { if ( F = 0 ) return +1; /* S-encoding */ if ( F = 1 ) return -1; x = TopVariable( V ); (F0, F1) = Cofactors( F, x ); W0 = Walsh( F0 , V - x ); W1 = Walsh( F1 , V - x ); R0 = W0 + W1; R1 = W0 - W1; return ITE( x, R1, R0 ); } Typically, in the case of recursive pseudo-code, it makes sense to put on the slide only the essential relationships, without mentioning all the details. Meanwhile, the speaker can say: Functions and variable sets are represented by BDDs, spectra by ADDs. (2) TopVariable(), Cofactors(), and ITE() are standard constant-time operations on decision diagrams. (3) In the expression “V-x”, minus stands for the set-difference operator. (4) One line below, “+” and “-” are operations, which take two sets of coefficients represented as ADDs, and return an ADD representing the set of coefficients computed by adding (subtracting) the corresponding coefficients of the arguments. In other words, these operations implement the element-wise addition and subtraction of matrices. (5) The cache lookup and insert are omitted for clarity. September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Haar Spectrum Computation spectrum Haar( bdd F, varset V ) { if ( F = 0 ) return 0; /* R-encoding */ if ( F = 1 ) return 1; var x = TopVariable( V ); (F0, F1) = Cofactors( F, x ); H0 = Haar( F0 , V - x ); H1 = Haar( F1 , V - x ); C0 = NegPathCoef( H0 ); C1 = NegPathCoef( H1 ); R0 = Update(H0 , C0 +C1); R0 = Update(H0 , C0 - C1); return ITE( x, R1, R0 ); } Comments to this slide: (1) As in the previous slide, functions and variable sets are represented by BDDs, spectra by ADDs. (2) ToptVariable(), Cofactors(), and ITE() are standard, constant-time operations on decision diagrams (3) In the expression “V-x”, minus stands for the set-difference operator (4) In expresions “C0 +C1” and “C0 -C1”, “+” and “-” stand for arithmetic addition (subtraction) of spectral coefficients (5) The cache lookup and insert are omitted for clarity. (6) Function NegPathCoef() retrieves the coefficient corresponding to the (000…000)-assignment of the encoding variables in one top-down pass on the ADD. (6) Function Update(F,C) updates the current value of the (000…000)-assignment coefficient in the spectrum F for the given value C, in one bottom-up traversal of the ADD representing F. September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Electronic Systems Design Seminar, UC Berkeley Experimental Results Name In/Out vars BDD nodes Read time, s Walsh nodes Walsh time, s Haar nodes Haar time, s alu4 14 / 8 804 0.16 8,005 0.17 2,827 0.01 pdc 16 / 40 695 0.66 10,581 0.05 2,992 soar 83 / 94 482 0.44 3,778 0.06 2,321 apex3 54 / 50 851 0.60 34,879 0.46 15,109 des 256 / 245 3,038 2.15 27,892 0.38 16,664 dalu 75 / 16 1,037 1.10 26,692 0.55 11,399 0.28 pair 173 / 137 3,747 4,23 memout - 42,385 0.33 rot 135 / 107 5,922 1.53 116,370 0.99 c3540 50 / 22 23,851 23.84 316,666 5.82 c5315 178 / 123 2,197 1.81 77,554 3.40 58,037 1.15 c7552 207 / 108 9,485 10.49 62,684 1.95 The dynamic BDD variable reordering was enabled during input file reading and disabled during the computation of spectra. Columns “BDD” and “Tr” report the size of the shared BDD with complemented edges and the benchmark reading time. Columns “ADD” and “Tw” report the size of the shared ADD and the computation time for the Walsh spectrum. Columns “ADD” and “Th” report the size of the shared ADD and the computation time for the Haar spectrum. All time measurements (the last three columns) are in seconds on 500Mhz PC with 64Mb RAM under Windows 98. September 20, 2018 Electronic Systems Design Seminar, UC Berkeley

Electronic Systems Design Seminar, UC Berkeley Conclusions Analyzed the generic DD traversal procedure Discussed standard and specialized DD operators Looked into several applications of specialized operators Experimental results show that the performance may increase several orders of magnitude if the DD operators are skillfully tailored to the application You are welcome to use the source code at http://www.ee.pdx.edu/~alanmi/research/extra.htm September 20, 2018 Electronic Systems Design Seminar, UC Berkeley