Multi-Level Logic Optimization. Technology Independent. Thanks to R. Rudell, S. Malik, R. Rutenbar. University of California, Berkeley, CA

Similar documents
Multilevel Logic Synthesis Algebraic Methods

Fundamental Algorithms for System Modeling, Analysis, and Optimization

Logic Minimization. Two-Level. University of California. Prof. Srinivas Devadas. Prof. Richard Newton Prof. Sanjit Seshia. Prof.

Computational Boolean Algebra. Pingqiang Zhou ShanghaiTech University

Karnaugh Maps Objectives

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Logic Synthesis. Basic Definitions. k-cubes

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

INTRO TO I & CT. (Boolean Algebra and Logic Simplification.) Lecture # By: Department of CS & IT.

Advanced Digital Design with the Verilog HDL, Second Edition Michael D. Ciletti Prentice Hall, Pearson Education, 2011

Chapter 7 Logic Circuits

Computer Organization I. Lecture 13: Design of Combinational Logic Circuits

Alebraic division: { Let f dividend = ac + ad + bc + bd + e and f divisor = a + b { Then f quotient = c + d f remainder = e { Because (a + b) (c + d)

For smaller NRE cost For faster time to market For smaller high-volume manufacturing cost For higher performance

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

Chapter 2 Combinational Logic Circuits

Final Exam. ECE 25, Spring 2008 Thursday, June 12, Problem Points Score Total 90

Chap 2. Combinational Logic Circuits

UNIT 5 KARNAUGH MAPS Spring 2011

CHAPTER 3 BOOLEAN ALGEBRA

ELC224C. Karnaugh Maps

Large-Scale SOP Minimization Using Decomposition and Functional Properties

Signals and Systems Digital Logic System

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Optimizations and Tradeoffs. Combinational Logic Optimization

Chapter 3. Boolean Algebra. (continued)

Equivalence Checking of Sequential Circuits

Unit 2 Session - 6 Combinational Logic Circuits

Reduction of Logic Equations using Karnaugh Maps

Boolean Algebra & Logic Gates. By : Ali Mustafa

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

ENGG 1203 Tutorial_9 - Review. Boolean Algebra. Simplifying Logic Circuits. Combinational Logic. 1. Combinational & Sequential Logic

PLA Minimization for Low Power VLSI Designs

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

UNIT 3 BOOLEAN ALGEBRA (CONT D)

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

EEE130 Digital Electronics I Lecture #4

ECE 697B (667) Spring 2003

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

Simplify the following Boolean expressions and minimize the number of literals:

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Karnaugh Map & Boolean Expression Simplification

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

T02 Tutorial Slides for Week 6

THE UNIVERSITY OF MICHIGAN. Faster Static Timing Analysis via Bus Compression

T9: Covering. Prove true by: Method 1: Perfect induction Method 2: Using other theorems and axioms. Number Theorem. T9 B (B+C) = B Covering

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

ECE 238L Boolean Algebra - Part I

ENGG 1203 Tutorial - 2 Recall Lab 2 - e.g. 4 input XOR. Parity checking (for interest) Recall : Simplification methods. Recall : Time Delay

Boolean Algebra, Gates and Circuits

Anand Raghunathan MSEE 348

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

2 Application of Boolean Algebra Theorems (15 Points - graded for completion only)

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

Fundamentals of Boolean Algebra

211: Computer Architecture Summer 2016

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

CHAPTER 2 BOOLEAN ALGEBRA

ENG2410 Digital Design Combinational Logic Circuits

Number System conversions

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Digital Logic Appendix A

Synthesis for Testability Techniques for Asynchronous Circuits

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

CHAPTER 5 KARNAUGH MAPS

DIGITAL LOGIC CIRCUITS

Binary addition example worked out

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Boolean Algebra and logic gates

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.

Unit 3 Session - 9 Data-Processing Circuits

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

CS470: Computer Architecture. AMD Quad Core

Lecture 7: Karnaugh Map, Don t Cares

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

Two-Level Logic Synthesis for Probabilistic Computation

Philadelphia University Student Name: Student Number:

CMSC 313 Preview Slides

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

This form sometimes used in logic circuit, example:

Gate-Level Minimization

Chapter 2 Combinational Logic Circuits

Binary Multipliers. Reading: Study Chapter 3. The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding

Combinational Logic. Course Instructor Mohammed Abdul kader

Chapter 2 Combinational Logic Circuits

EECS150 - Digital Design Lecture 16 Counters. Announcements

Chapter 2 Boolean Algebra and Logic Gates

Lecture 3: Boolean Algebra

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

CHAPTER III BOOLEAN ALGEBRA

Transcription:

Technology Independent Multi-Level Logic Optimization Prof. Kurt Keutzer Prof. Sanjit Seshia EECS University of California, Berkeley, CA Thanks to R. Rudell, S. Malik, R. Rutenbar 1

Logic Optimization Library netlist logic optimization a b 0 1 s d clk q Perform a variety of transformations and optimizations Structural graph transformations Boolean transformations Mapping into a physical library netlist a b 0 d q 1 s clk smaller, faster less power K. Keutzer & S. Seshia 2

What We ve Seen: Early Synthesis Flow & 2-Level Minimization FSM FSM Synthesis logic F1 = B + D + A C + A C SOP logic optimization PLA physical design I1 I2 O1 O2 layout K. Keutzer & S. Seshia 3

Reduce to Combinational Optimization B Flip-flops inputs Combinational outputs Logic input arrival times input drive output required times output load K. Keutzer & S. Seshia 4

Combinational Logic Optimization Input: Output: Initial Boolean circuit Timing characterization for the module - input arrival times and drive factors - output loading factors Optimization goals - output required times output load Target library description Minimum-area net-list of library gates which meets timing constraints A very difficult optimization problem! K. Keutzer & S. Seshia 5

Modern Approach to Logic Optimization Divide logic optimization into two subproblems: Technology-independent optimization - determine overall logic structure - estimate costs (mostly) independent of technology - simplified cost modeling Technology-dependent optimization (technology mapping) - binding onto the gates in the library - detailed technology-specific cost model Orchestration of various optimization/transformation techniques for each subproblem K. Keutzer & S. Seshia 6

Logic Optimization netlist 2-level Logic opt Library logic optimization netlist tech independent tech dependent multilevel Logic opt Generic Library Real Library K. Keutzer & S. Seshia 7

Outline Motivation for Multilevel Ckts Overview of Multilevel Optimization Details on Multilevel Optimization Techniques K. Keutzer & S. Seshia 8

Why Multilevel Combinational Circuits? There are many functions that are too expensive to implement in two-level form Try 16-bit adder 32 input lines and 2 16 product terms! Delay vs. Area tradeoff 2-level ckt: tiny delay, large area (many gates & literals) multi-level: bigger delay, less area K. Keutzer & S. Seshia 9

Outline Motivation for Multilevel Ckts Overview of Multilevel Optimization Details on Multilevel Optimization Techniques K. Keutzer & S. Seshia 11

Representation: Boolean Network a b x c y a ab b c c + x x y K. Keutzer & S. Seshia 12

Boolean Network, Explained It s a graph: Primary inputs (variables) Primary outputs Intermediate nodes (in SOP form in terms of its inputs) Generic library technology independent Has standard functions ND2, ND4, AOI22 Quality of network: area, delay, measured in terms of #(literals), depth, K. Keutzer & S. Seshia 13

Tech.-Independent Multi-Level Optimization: Operations Involves performing the following operations iteratively until good enough result is obtained: 1. Simplification Minimizing two-level logic function (SOP for a single node) 2. Elimination Substituting one expression into another. 3. Decomposition Expressing a single SOP with 2 or more simpler forms 4. Extraction Finding & pulling out subexpressions common to many nodes 5. Substitution Like extraction, but nodes in the network are re-used K. Keutzer & S. Seshia 14

Example (due to G. De Micheli) a v = a d + bd + c d + ae w b p = ce + de r = p + a s = r + b x c d t = ac + ad + bc + bd + e y e q = a + b u = q c + qc + qc z #literals = 33, depth = 3 K. Keutzer & S. Seshia 15

Example: Elimination a v = a d + bd + c d + ae w b p = ce + de r = p + a s = r + b x c d t = ac + ad + bc + bd + e y e q = a + b u = q c + qc + qc z #literals = 33, depth = 3 K. Keutzer & S. Seshia 16

Example: Eliminate node r a v = a d + bd + c d + ae w b p = ce + de s = p + a + b x c d t = ac + ad + bc + bd + e y e q = a + b u = q c + qc + qc z #literals = 32, depth = 2 K. Keutzer & S. Seshia 17

Example: Simplification a v = a d + bd + c d + ae w b p = ce + de s = p + a + b x c d t = ac + ad + bc + bd + e y e q = a + b u = q c + qc + qc z #literals = 32, depth = 2 K. Keutzer & S. Seshia 18

Example: Simplifying node u a v = a d + bd + c d + ae w b p = ce + de s = p + a + b x c d t = ac + ad + bc + bd + e y e q = a + b u = q + c z #literals = 28, depth = 2 K. Keutzer & S. Seshia 19

Example: Decomposition a v = a d + bd + c d + ae w b p = ce + de s = p + a + b x c d t = ac + ad + bc + bd + e y e q = a + b u = q + c z #literals = 28, depth = 2 K. Keutzer & S. Seshia 20

Example: Decomposing node v a j = a + b + c v = jd + ae w b p = ce + de s = p + a + b x c d t = ac + ad + bc + bd + e y e q = a + b u = q + c z #literals = 27, depth = 2 K. Keutzer & S. Seshia 21

Example: Extraction a j = a + b + c v = jd + ae w b p = ce + de s = p + a + b x c d t = ac + ad + bc + bd + e y e q = a + b u = q + c z #literals = 27, depth = 2 K. Keutzer & S. Seshia 22

Example: Extracting from p and t a j = a + b + c v = jd + ae w b p = ke s = p + a + b x c k = c + d d t = ka + kb + e y e q = a + b u = q + c z #literals = 23, depth = 3 K. Keutzer & S. Seshia 23

Example: What next? a j = a + b + c v = jd + ae w b p = ke s = p + a + b x c k = c + d d t = ka + kb + e y e q = a + b u = q + c z #literals = 23, depth = 3 K. Keutzer & S. Seshia 24

Which Operations Do We Know How to Do? Involves performing the following operations iteratively until good enough result is obtained: 1. Simplification Minimizing two-level logic function (SOP for a single node) 2. Elimination Substituting one expression into another. 3. Decomposition Expressing a single SOP with 2 or more simpler forms 4. Extraction Finding & pulling out subexpressions common to many nodes 5. Substitution Like extraction, but nodes in the network are re-used K. Keutzer & S. Seshia 25

Outline Motivation for Multilevel Ckts Overview of Multilevel Optimization Details on Multilevel Optimization Techniques K. Keutzer & S. Seshia 26

Need for Factoring/Division Factored versus Disjunctive forms f = ac + ad + bc + bd + ae sum-of-products or disjunctive form factored form f = ( a + b ) ( c + d ) + a e multi-level or complex gate What we need is a way to do division K. Keutzer & S. Seshia 27

Divisors and Decomposition Given Boolean function F, we want to write it as F = D. Q + R where D Divisor, Q Quotient, R Remainder Decomposition: Searching for divisors which are common to many functions in the network identify divisors which are common to several functions introduce common divisor as a new node re-express existing nodes using the new divisor K. Keutzer & S. Seshia 28

Boolean Division Given Boolean function F, we want to write it as F = D. Q + R D is a factor of F iff F. D = 0 ON-SET(D) contains ON-SET(F) If F. D!= 0, then D is a divisor of F How many possible factors D can there be for a given F? K. Keutzer & S. Seshia 29

Algebraic Model Idea: Perform division using only the rules (axioms) of real numbers, not all of Boolean algebra Real Numbers a.b = b.a a+b = b+a a.(b.c) = (a.b).c a+(b+c) = (a+b)+c a.(b+c) = a.b + a.c a.1 = a a.0 = 0 a+0 = a Boolean Algebra a.b = b.a a+b = b+a a.(b.c) = (a.b).c a+(b+c) = (a+b)+c a.(b+c) = a.b + a.c a.1 = a a.0 = 0 a+0 = a a+(b.c) = (a+b). (a+c) a+a = 1 a.a = 0 a.a = a a+a=a a+1 = 1 a+ab = a a.(a+b) = a K. Keutzer & S. Seshia 30

Algebraic Division A literal and its complement are treated as unrelated Each literal as a fresh variable E.g. f = ab + a x + b y as f = ab + dx + ey Treat SOP expression as a polynomial Division/factoring then becomes polynomial division/factoring Boolean identities are ignored Except in pre-processing Simple local simplifications like a + ab a performed K. Keutzer & S. Seshia 31

Algebraic vs. Boolean factorization f = a b + a c + b a + b c + c a + c b Algebraic factorization produces f = a ( b + c ) + a ( b + c ) + b c + c b Boolean factorization produces f = ( a + b + c ) ( a + b + c ) K. Keutzer & S. Seshia 32

Algebraic Division Example F = ac + ad + bc + bd + e Want to get Q, R, where F = D Q + R for 1. D = a + b 2. D = a K. Keutzer & S. Seshia 33

Algebraic Division Algorithm What we want: Given F, D, find Q, R F, D expressed as sets of cubes (same for Q, R) Approach: For each cube C in D { let B = {cubes in F contained in C} if (B is empty) return Q = { }, R = F let B = {cubes in B with variables in C removed} if (C is the first cube in D we re looking at) let Q = B; else Q = Q B; } R = F \ (Q x D); Complexity? K. Keutzer & S. Seshia 34

Taking Stock What we know: How to perform Algebraic division given a divisor D What we don t How to pick D? Recall what we wanted to do: Given 2 functions F and G, find a common divisor D and factorize them as F = D Q1 + R1 G = D Q2 + R2 K. Keutzer & S. Seshia 35

New Terminology: Kernels A kernel of a Boolean expression F is a cube-free expression that results when you divide F by a single cube That single cube is called a co-kernel Cube-free expression: Cannot factor out a single cube that leaves behind no remainder Examples: Which are cube-free? F = a F = a + b F = abc + abd K. Keutzer & S. Seshia 36

Kernels: Examples F = ae + be + cde + ab K(f) Kernel Co-kernel {a,b,cd} e {e,b}?? b {ae,be,cde,ab}? K. Keutzer & S. Seshia 37

Why are Kernels Useful? Goal of multi-level logic optimizer is to find common divisors of two (or more) functions f and g Theorem: [Brayton & McMullen] f and g have a non-trivial (multiple-cube) common divisor d if and only if there exist kernels k f K( f ), k g K( g ) such that k f k g is non-trivial, i.e., not a cube can use kernels of f and g to locate common divisors K. Keutzer & S. Seshia 38

Theorem, Put Another Way F = D1. K1 + R1 G = D2. K2 + R2 K1 = (X + Y + ) + stuff1 K2 = (X + Y + ) + stuff2 Then, F = (X + Y + ) D1 + stuff3 G = (X + Y + ) D2 + stuff4 So, if we find kernels and intersect them, the intersection gives us our common divisor K. Keutzer & S. Seshia 39

Kernel Intersection: Example F = ae + be + cde + ab G = ad + ae + bd + be + bc K(f) Kernel Co-kernel {a,b,cd} e {e,b} a {e,a} b {ae,be,cde,ab} 1 K(g) Kernel Co-kernel {a,b} d or e {d,e} a or b {d,e,c} b {ad,ae,bd,be,bc} 1 K. Keutzer & S. Seshia 40

How do we find Kernels? Overview: Given a function F 1. Pick a variable x appearing in F, and use it as a divisor 2. Find the corresponding kernel K if one exists (at least 2 cubes in F contain x) If not, go back to (1) and pick another variable 3. Use K in place of F and recurse to find kernels of K F = x K + R and K = y M + S F = xy M + Add kernels of K to those of F 4. Go back to (1) and pick another variable to keep finding kernels K. Keutzer & S. Seshia 41

Finding Kernels: Example F = abc + abd + bcd bc + bd ac + ad + cd ab + bd ab + bc Can we do better? K. Keutzer & S. Seshia 42

Finding Kernels: Example F = abc + abd + bcd bc + bd abc + ad + cd abc & bcd both contain c. Intersection is bc. Recurse on F/bc = a+d ab + bc Take intersection of all cubes containing a variable K. Keutzer & S. Seshia 43

Kernel Finding Algorithm FindKernels(F) { K = { }; for (each variable x in F) { if (F has at least 2 cubes containing x) { let S = {cubes in f containing x}; let c = cube resulting from intersection of all cubes in S K = K FindKernels(F/c); //recursion } } K = K F ; return K; } K. Keutzer & S. Seshia 44

Strong (or Boolean) Division Given a function f to be strong divided by g Add an extra input to f corresponding to g, namely G and obtain function h as follows h DC = G g + G g Inputs to f that cannot occur h ON = f ON h DC h OFF = f ON + h DC Minimize h using two-level minimizer Get: h = Q G + R K. Keutzer & S. Seshia 45

Additional Reading 1. Read Chapter 7 upto Sec. 7.6 2. R. Rudell, Logic Synthesis for VLSI Design, PhD Thesis, UC Berkeley, 1989. 3. R. Brayton, G. Hachtel, A. Sangiovanni- Vincentelli, Multilevel Logic Synthesis, Proceedings of the IEEE, Feb 90. OPTIONAL K. Keutzer & S. Seshia 46

Logic optimization - summary Current formulation of logic synthesis and optimization is the most common techniques for designing integrated circuits today Has been the most successful design paradigm 1989 - present Almost all digital circuits are touched by logic synthesis Microprocessors (control portions/random glue logic ~ 20%) Application specific standard parts (ASSPs)- 20-90% Application specific integrated circuits (ASICs) - 40-100% Real logic optimization systems orchestrate optimizations Technology independent Technology dependent NEXT LECTURE Application specific (e.g. datapath oriented) K. Keutzer & S. Seshia 47