ECE 667 Synthesis & Verification - Multi-level Optimization 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Multi-level Minimization (Kernel-based)

Slides:



Advertisements
Similar presentations
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Factored Forms.
Advertisements

Glitches & Hazards.
ECE 667 Synthesis & Verification - Algebraic Division 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Multi-level Minimization Algebraic.
ECE 667 Synthesis and Verification of Digital Systems
1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.
1 Outline Division is central in many operations. –What is it (in the context of Boolean functions)? –What to divide (divisor) with? –How to divide (quotient.
Logic Synthesis Part II
Common Subexpression Elimination Involving Multiple Variables for Linear DSP Synthesis 15 th IEEE International Conference on Application Specific Architectures.
Circuit Optimization Goal: To obtain the simplest implementation for a given function Optimization is a more formal approach to simplification that is.
ECE Synthesis & Verification - Lecture 19 1 ECE 667 Spring 2009 ECE 667 Spring 2009 Synthesis and Verification of Digital Systems Functional Decomposition.
Lecture 5 Multilevel Logic Synthesis
Reducing Hardware Complexity of Linear DSP Systems by Iteratively Eliminating Two-Term Common Subexpressions IEEE/ACM Asia South Pacific Design Automation.
ECE Synthesis & Verification - Lecture 9b 1 ECE 697B (667) Fall 2004 ECE 697B (667) Fall 2004 Synthesis and Verification of Digital Systems Boolean.
ECE Synthesis & Verification - Lecture 9 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Multi-level.
ECE Synthesis & Verification - Lecture 14 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems BDD-based.
Multilevel Logic Synthesis -- Algebraic Methods. ENEE 6442 Why Algebraic Methods? > What is our goal? minimization, maximally factored form. > Algebraic.
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.
Logic Synthesis 3 1 Logic Synthesis Part III Maciej Ciesielski Univ. of Massachusetts Amherst, MA.
ECE Synthesis & Verification 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Exact Two-level Minimization Quine-McCluskey Procedure.
ECE 667 Synthesis and Verification of Digital Systems
MVSIS Front End 219b Project Presentation Spring 2000 Minxi Gao, EECS, UC Berkeley.
1 Outline Division is central in many operations. –What is it (in the context of Boolean functions)? –What to divide (divisor) with? –How to divide (quotient.
Logic Decomposition ECE1769 Jianwen Zhu (Courtesy Dennis Wu)
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization I.
ECE 667 Synthesis and Verification of Digital Systems
ECE Synthesis & Verification - Lecture 8 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Multi-level.
CSE Autumn Combinational Logic - 1 Multi-Level Optimization z1. Reduce number of literals yfewer literals means less transistors (less space)
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization II.
Slide Chapter 7 Systems and Matrices 7.1 Solving Systems of Two Equations.
Based on slides by: Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 9 – Multilevel Optimization.
1 Simplification of Boolean Functions:  An implementation of a Boolean Function requires the use of logic gates.  A smaller number of gates, with each.
Department of Computer Engineering
Graph Partitioning Problem Kernighan and Lin Algorithm
Statistical Analysis Professor Lynne Stokes Department of Statistical Science Lecture 14 Sequential Experimentation, Screening Designs, Fold-Over Designs.
1 Check your homework assignment with your partner!
State university of New York at New Paltz Electrical and Computer Engineering Department Logic Synthesis Optimization Lect19: Multi Level Logic Minimization.
Zvi Kohavi and Niraj K. Jha 1 Multi-level Logic Synthesis.
1 Multi-Level Logic Synthesis Slides courtesy of Andreas Kuehlmann (Cadence)
Optimization Algorithm
Chapter 4 – Finite Fields
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Algebraic Division.
Two Level Networks. Two-Level Networks Slide 2 SOPs A function has, in general many SOPs Functions can be simplified using Boolean algebra Compare the.
07 KM Page 1 ECEn/CS 224 Karnaugh Maps. 07 KM Page 2 ECEn/CS 224 What are Karnaugh Maps? A simpler way to handle most (but not all) jobs of manipulating.
Multi-Level Logic Optimization. Multi-Level Logic Synthesis Two Level Logic : –Espresso –Programmable Logic Array (PLA) Multilevel Logic : –Standard Cell.
1 BOOLEAN ALGEBRA Basic mathematics for the study of logic design is Boolean Algebra Basic laws of Boolean Algebra will be implemented as switching devices.
CONSENSUS THEOREM Choopan Rattanapoka.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 4: Cost of Logic Circuits and Karnaugh Maps José Nelson Amaral.
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)
State university of New York at New Paltz Electrical and Computer Engineering Department Logic Synthesis Optimization Lect18: Multi Level Logic Minimization.
1 CS 352 Introduction to Logic Design Lecture 2 Ahmed Ezzat Boolean Algebra and Its Applications Ch-3 + Ch-4.
©2010 Cengage Learning SLIDES FOR CHAPTER 3 BOOLEAN ALGEBRA (continued) Click the mouse to move to the next page. Use the ESC key to exit this chapter.
Logic Synthesis Boolean Division.
Lecture 7 Multi-Level Gate Networks
Reducing Number of Candidates
ECE 667 Synthesis and Verification of Digital Systems
CS 352 Introduction to Logic Design
Lecture 3 Algebraic Simplification
CHAPTER 5 KARNAUGH MAPS 5.1 Minimum Forms of Switching Functions
ECE 667 Synthesis and Verification of Digital Systems
Optimization Algorithm
Fractional Factorial Design
ECB2212-Digital Electronics
Synthesis and Verification of Finite State Machines
AB AC AD AE AF 5 ways If you used AB, then, there would be 4 remaining ODD vertices (C, D, E and F) CD CE CF 3 ways If you used CD, then, there.
Exploring Partially ordered sets
VLSI CAD Flow: Logic Synthesis, Placement and Routing Lecture 5
Design matrix Run A B C D E
Presentation transcript:

ECE 667 Synthesis & Verification - Multi-level Optimization 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Multi-level Minimization (Kernel-based) Slides adapted (with permission) from A. Kuehlmann, UC Berkeley, 2003

ECE 667 Synthesis & Verification - Multi-level Optimization 2 Multi-level Logic Transformation Basic Operations on multi-level network: 1. Decomposition (single function) f = abc+abd+a’c’d’+b’c’d’  f = xy+x’y’, x = ab, y = c+d 2. Extraction (multiple functions) f = (az+bz’)cd+e g = (az+bz’)e’ h = cde  f = xy+e, g = xe’, h = ye, x = az+bz’, y = cd 3. Factorization (series-parallel decomposition) f = ac+ad+bc+bd+e  f = (a+b)(c+d)+e

ECE 667 Synthesis & Verification - Multi-level Optimization 3 Multi-level Logic Transformation 4. Substitution g = a+b f = ac+bc + d  f = gc+d 5. Collapsing (elimination) f = ga+g’b g = c+d  f = ac+ad+bc’d’ Kernel-based extraction plays a key role in all of these operations: finding “best” kernel intersections that can be used as divisors.

ECE 667 Synthesis & Verification - Multi-level Optimization 4 Factoring Algorithm Algorithm FACTOR(F) { if(F has no factor) return F // e.g. if |F|=1, or F is an OR of single literals // or if no literal appears more than once D = CHOOSE_DIVISOR(F) (Q,R) = DIVIDE(F,D) return FACTOR(Q)×FACTOR(D) + FACTOR(R) // recur } – –Different heuristics can be applied for CHOOSE_DIVISOR – –Different DIVIDE routines may be applied (e.g. also Boolean divide) Now that we know how to find good divisors (kernels) and how to effect division, we can perform factorization and decomposition.

ECE 667 Synthesis & Verification - Multi-level Optimization 5 Factoring Methods Various methods of factoring can be obtained by choosing different forms of DIVISOR and different methods of DIVIDE. CHOOSE_DIVISOR methods: – –LITERAL - chooses most frequent literal (LF) – –QUICK_DIVISOR - chooses the first level-0 kernel – –BEST_DIVISOR - chooses the best kernel among all DIVIDE methods: – –Algebraic division – –Boolean division

ECE 667 Synthesis & Verification - Multi-level Optimization 6 Literal Factor (LF) Algorithm LF(F, C, DIVISOR, DIVIDE) { L = BEST_LITERAL(F, C) // most frequent (Q, R) = DIVIDE(F, L) C = COMMON_CUBE(Q) // largest one Q’ = CUBE_FREE(Q) Q = GFACTOR(Q’, DIVISOR, DIVIDE) R = GFACTOR(R, DIVISOR, DIVIDE) return L × C × Q’ + R = L Q + R }

ECE 667 Synthesis & Verification - Multi-level Optimization 7 Algorithm FACTOR - example Example: F = abc + abd + ae + af + g D = c + d Q = ab P = ab(c + d) + ae + af + g O = ab(c + d) + a(e + f) + g O is not optimal since not maximally factored. Can be further factored to a(b(c + d) + e + f) + g The problem occurs when quotient Q is a single cube, and some of the literals of Q also appear in the remainder R, so they can be factored out. Notation: F = the original function, D = the divisor, Q = the quotient, P = the partial factored form, O = final factored form obtained by FACTOR. Restrict to algebraic operations only. R

ECE 667 Synthesis & Verification - Multi-level Optimization 8 Improved FACTOR (1) Solving this problem: If the quotient Q is a single cube, then: – –pick a literal l 1 in Q which occurs most frequently in cubes of F. – –divide F by l 1 to obtain a new divisor D 1. Now, F has a new partial factored form F = (l 1 )(D 1 ) + (R 1 ) and literal l 1 does not appear in R 1. Note: The new divisor D 1 contains the original D as a divisor because l 1 is a literal of Q. When recursively factoring D 1, D can be discovered again. Look at the previous example.

ECE 667 Synthesis & Verification - Multi-level Optimization 9 Second problem with FACTOR Example: F = ace + ade + bce + bde + cf + df D = a + b Q = ce + de P = (ce + de)(a + b) + (c + d) f O = e(c + d)(a + b) + (c + d)f O is not maximally factored because (c + d) is common to both: product QD = e(c + d)(a + b) and remainder R=(c + d)f. The final factored form should have been: (c+d)(e(a + b) + f) Notation: F = the original function, D = the divisor, Q = the quotient, P = the partial factored form, O = the final factored form obtained by FACTOR. R

ECE 667 Synthesis & Verification - Multi-level Optimization 10 Improved FACTOR (2) Solving the problem: Essentially, we reverse D and Q ! (first make it cube free) Make Q cube-free to get Q 1 Obtain a new divisor D 1 by dividing F by Q 1 If D 1 is cube-free, the partial factored form is F = (Q 1 )(D 1 ) + R 1, and can recursively factor Q 1, D 1, and R 1 If D 1 is not cube-free, let D 1 = cD 2 and D 3 = Q 1 D 2. We have the partial factoring F = cD 3 + R 1. Now recursively factor D 3 and R 1.

ECE 667 Synthesis & Verification - Multi-level Optimization 11 Improved Factoring Algorithm Improved Factoring Algorithm Algorithm GFACTOR(F, DIVISOR, DIVIDE) { D = DIVISOR(F) if(D = 0) return F Q = DIVIDE(F,D) if (|Q| = 1) return LF(F, Q, DIVISOR, DIVIDE) Q = MAKE_CUBE_FREE(Q) (D, R) = DIVIDE(F,Q) if (CUBE_FREE(D)) { Q = GFACTOR(Q, DIVISOR, DIVIDE) D = GFACTOR(D, DIVISOR, DIVIDE) R = GFACTOR(R, DIVISOR, DIVIDE) return Q × D + R } else { C = COMMON_CUBE(D) return LF(F, C, DIVISOR, DIVIDE) }}

ECE 667 Synthesis & Verification - Multi-level Optimization 12 Factoring Algorithms Example: x = ac + ad + ae + ag + bc + bd +be + bf + ce + cf + df + dg LITERAL_FACTOR: x = a(c + d + e + g) + b(c + d + e + f) + c(e + f) + d(f + g) QUICK_FACTOR: x = g(a + d) + (a + b)(c + d + e) + c(e + f) + f(b + d) GOOD_FACTOR: x = (c + d + e)(a + b) + f(b + c + d) + g(a + d) + ce

ECE 667 Synthesis & Verification - Multi-level Optimization 13 Example: QUICK_FACTOR QUICK_FACTOR uses GFACTOR, First level-0 kernel DIVISOR, and WEAK_DIV. x = ae + afg + afh + bce + bcfg + bcfh + bde + bdfg + bdfh D = c + d ---- level-0 kernel (first found) Q = x/D = b(e + f(g + h)) ---- weak division Q = e + f(g + h) ---- make cube-free (D, R) = WEAK_DIV(x, Q) ---- second division D = a + b(c + d) x = QD + R R = 0 x = (e + f(g + h)) (a + b(c + d))

ECE 667 Synthesis & Verification - Multi-level Optimization 14 Application - Decomposition Decomposition is the same as factoring except: – –divisors are added as new nodes in the network. – –the new nodes may fan out elsewhere in the network in both positive and negative phases Algorithm DECOMP(f i ) { k = CHOOSE_KERNEL(f i ) if (k == 0) return f m+j = k // create new node m + j f i = (f i /k)y m+j +(f i /k)’y’ m+j +r // change node i using new // node for kernel DECOMP(f i ) DECOMP(f m+j ) } Similar to factoring, we can define – –QUICK_DECOMP: pick a level 0 kernel and improve it. – –GOOD_DECOMP: pick the best kernel.

ECE 667 Synthesis & Verification - Multi-level Optimization 15 Re-substitution Idea: An existing node in a network may be a useful divisor in another node. If so, no loss in using it (unless delay is a factor). Algebraic substitution consists of the process of algebraically dividing the function f i at node i in the network by the function f j (or by f’ j ) at node j. During substitution, if f j is an algebraic divisor of f j, then f i is transformed into f i = qy j + r (or f i = q 1 y j + q 0 y’ j + r ) In practice, this is tried for each node pair of the network. For n nodes in the network  O(n 2 ) divisions. fifififi fjfjfjfj yjyjyjyj

ECE 667 Synthesis & Verification - Multi-level Optimization 16 Extraction Recall: Extraction operation identifies common sub-expressions and manipulates the Boolean network. Combine decomposition and substitution to provide an effective extraction algorithm. Algorithm EXTRACT foreach node n { DECOMP(n) // decompose all network nodes } foreach node n { RESUB(n) // resubstitute using existing nodes } ELIMINATE_NODES_WITH_SMALL_VALUE }

ECE 667 Synthesis & Verification - Multi-level Optimization 17 Extraction Kernel Extraction: 1. Find all kernels of all functions 2. Choose kernel intersection with best “value” 3. Create new node with this as function 4. Algebraically substitute new node everywhere 5. Repeat 1,2,3,4 until best value  threshold New Node

ECE 667 Synthesis & Verification - Multi-level Optimization 18 Example - Extraction f 1 = ab(c(d + e) + f + g) + h, f 2 = ai(c(d + e) + f + j) + k (only level-0 kernels used in this example) 1. K-extraction: K 0 (f 1 ) = K 0 (f 2 ) = {d + e} K 0 (f 1 )  K 0 (f 2 ) = {d + e} l = d + ef 1 = ab(cl + f + g) + h f 2 = ai(cl + f + j) + k 2. K-extraction: K 0 (f 1 ) = {cl + f + g}; K 0 (f 2 ) = {cl + f + j) K 0 (f 1 )  K 0 (f 2 ) = cl + f m = cl + ff 1 = ab(m + g) + h f 2 = ai(m + j) + k No kernel intersections anymore ! 3. Cube extraction: n = amf 1 = b(n + ag) + h f 2 = i(n + aj) + k

ECE 667 Synthesis & Verification - Multi-level Optimization 19 Rectangle Covering Alternative method for extraction: Matrix Method Build co-kernel cube matrix M = R  C – –rows correspond to co-kernels of individual functions – –columns correspond to individual cubes of kernel – –m ij = cubes of functions – – = 0 if cube not there Rectangle covering: – –identify sub-matrix M’ = R’  C’, where R’  R, C’  C, and m’ ij  0 – –construct divisor d corresponding to M’ as new node – –extract d from all functions

ECE 667 Synthesis & Verification - Multi-level Optimization 20 Example of Rectangle Covering F = af + bf + ag + cg + ade + bde + cde G = af + bf + ace + bce H = ade + cde Kernels/Co-kernels : F: (de+f+g)/a (de + f)/b (a+b+c/de (a + b)/f (de+g)/c (a+c)/g G: (ce+f)/{a,b} (a+b)/{f,ce} H: (a+c)/de

ECE 667 Synthesis & Verification - Multi-level Optimization 21 Example of Rectangle Covering F = af + bf + ag + cg + ade + bde + cde G = af + bf + ace + bce H = ade + cde Pick sub-matrix M’ Extract new expression X X = a + b F = fx + ag + cg + dex + cde G = fx + cex H =ade + cde Update M

ECE 667 Synthesis & Verification - Multi-level Optimization 22 Value of a Sub-Matrix Number literals before - Number of literals after For the example V = = 8

ECE 667 Synthesis & Verification - Multi-level Optimization 23 Pseudo-Boolean Division Idea: consider entries in covering matrix that are don’t cares – –overlap of rectangles (a+a = a) – –product that cancel each other out (a+a’ = 0) Example: F = ab’ + ac’ + a’b + a’c + bc’ + b’c Result: X = a’ + b’ + c’ F = ax + bx + cx

ECE 667 Synthesis & Verification - Multi-level Optimization 24 Faster “Kernel” Extraction Non-robustness of kernel extraction – –Recomputation of kernels after every substitution: expensive – –Some functions may have many kernels (e.g. symmetric functions) Cannot measure if kernel can be used as complemented node Solution: compute only subset of kernels: – –Two-cube “kernel” extraction [Rajski et al ‘90] – –Objects: 2-cube divisors 2-literal cube divisors – –Example: f = abd + a’b’d + a’cd ab + a’b’, b’ + c and ab + a’c are 2-cube divisors. a’d is a 2-literal cube divisor.

ECE 667 Synthesis & Verification - Multi-level Optimization 25 Fast Divisor Extraction Properties of fast divisor (kernel) extraction: O(n 2 ) number of 2-cube divisors in an n-cube Boolean expression. Concurrent extraction of 2-cube divisors and 2-literal cube divisors. Handle divisor and complemented divisor simultaneously Example: f = abd + a’b’d + a’cd. k = ab + a’b’, k’ = ab’ + a’b (both 2-cube divisors) j = ab + a’c, j’ = a’b’ + ac’ (both 2-cube divisors) c = ab (2-literal cube), c’ = a’ + b’ (2-cube divisor)

ECE 667 Synthesis & Verification - Multi-level Optimization 26 Generating All 2-cube Divisors F = {c i }, D(F) = {d | d = make_cube_free(c i + c j )} This takes all pairs of cubes in F and makes them cube-free. c i, c j are any pair of cubes of cubes in F Divisor generation is O(n 2 ), where n = number of cubes in F Example: F = axe + ag + bcxe + bcg make_cube_free(c i + c j ) = {xe + g, a + bc, axe + bcg, ag + bcxe} Note: the function F is made into an algebraic expression before generating double-cube divisors not all 2-cube divisors are kernels (why ?)

ECE 667 Synthesis & Verification - Multi-level Optimization 27 Key Result For 2-cube Divisors THEOREM: Expressions F and G have a common multiple-cube divisors if and only if D(F)  D(G)  0. Proof: If: If D(F)  D(G)  0 then  d  D(F)  D(G) which is a double-cube divisor of F and G. d is a multiple-cube divisor of F and of G. Only if: Suppose C = {c 1, c 2,..., c m } is a multiple-cube divisor of F and of G. Take any e = (c i + c j ). If e is cube-free, then e  D(F)  D(G). If e is not cube-free, then let d = make_cube_free(c i + c j ). Then d has 2 cubes since F and G are algebraic expressions. Hence d  D(F)  D(G).

ECE 667 Synthesis & Verification - Multi-level Optimization 28 Example: Suppose that C = ab + ac + f is a multiple divisor of F and G. If e = ac + f, e is cube-free and e  D(F)  D(G). If e = ab + ac, d = {b + c}  D(F)  D(G) As a result of the Theorem, all multiple-cube divisors can be “discovered” by using just double-cube divisors. Key Result For 2-cube Divisors

ECE 667 Synthesis & Verification - Multi-level Optimization 29 Fast Divisor Extraction Algorithm: Generate and store all 2-cube kernels (2-literal cubes) and recognize complement divisors. Find the best 2-cube kernel or 2-literal cube divisor at each stage and extract it. Update 2-cube divisor (2-literal cubes) set after extraction Iteratate extraction of divisors until no more improvement Results: – –Much faster – –Quality as good as that of kernel extraction