Winter 2014 S. Areibi School of Engineering University of Guelph

Slides:



Advertisements
Similar presentations
FUNCTION OPTIMIZATION Switching Function Representations can be Classified in Terms of Levels Number of Levels, k, is Number of Unique Boolean (binary)
Advertisements

Irredundant Cover After performing Expand, we have a prime cover without single cube containment now. We want to find a proper subset which is also a cover.
CSEE 4823 Advanced Logic Design Handout: Lecture #2 1/22/15
AN ITERATIVE TECHNIQUE FOR IMPROVED TWO-LEVEL LOGIC MINIMIZATION Kunal R. Shenoy Nikhil S. Saluja Nikhil S. Saluja (University of Colorado, Boulder) Sunil.
EEE324 Digital Electronics Ian McCrumRoom 5B18, Lecture 5: Software for.
ECE C03 Lecture 31 Lecture 3 Two-Level Logic Minimization Algorithms Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
EE 4271 VLSI Design1 Logic Synthesis. Starts from RTL description in HDL or Boolean expressions Outputs a standard cell netlist EE 4271 VLSI Design2.
ELEC Digital Logic Circuits Fall 2008 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and.
MVI Function Review Input X is p -valued variable. Each Input can have Value in Set {0, 1, 2,..., p i-1 } literal over X corresponds to subset of values.
Divide and Conquer. Recall Complexity Analysis – Comparison of algorithm – Big O Simplification From source code – Recursive.
Nattee Niparnan. Recall  Complexity Analysis  Comparison of Two Algos  Big O  Simplification  From source code  Recursive.
Two-Level Logic Synthesis -- Heuristic Method (ESPRESSO)
Logic Synthesis 2 Outline –Two-Level Logic Optimization –ESPRESSO Goal –Understand two-level optimization –Understand ESPRESSO operation.
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.
EDA (CS286.5b) Day 15 Logic Synthesis: Two-Level.
COE 561 Digital System Design & Synthesis Two-Level Logic Synthesis
COE 561 Digital System Design & Synthesis Two-Level Logic Synthesis Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum.
1 Multi-Valued Logic Up to now…two-valued synthesis –Binary variables take only values {0, 1} Multi-Valued synthesis –Multi-valued variable X i can take.
Logic Synthesis Outline –Logic Synthesis Problem –Logic Specification –Two-Level Logic Optimization Goal –Understand logic synthesis problem –Understand.
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 9b 1 ECE 697B (667) Fall 2004 ECE 697B (667) Fall 2004 Synthesis and Verification of Digital Systems Boolean.
Gate Logic: Two Level Canonical Forms
Two-Level Logic Minimization Exact minimization –problem : very large number of prime and very large number of minterm Heuristic minimization –avoid computing.
Irredundant Cover After performing Expand, we have a prime cover without single cube containment now. We want to find a proper subset which is also a cover.
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.
1 Generalized Cofactor Definition 1 Let f, g be completely specified functions. The generalized cofactor of f with respect to g is the incompletely specified.

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
Simple Minimization Loop F = EXPAND(F,D); F = IRREDUNDANT(F,D); do { cost = F ; F = REDUCE(F,D); F = EXPAND(F,D); F = IRREDUNDANT(F,D); } while ( F < cost.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization I.
Two Level Logic Optimization. Two-Level Logic Minimization PLA Implementation Ex: F 0 = A + B’C’ F 1 = AC’ + AB F 2 = B’C’ + AB product term AB, AC’,
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization II.
2-Level Minimization Classic Problem in Switching Theory
Quine-McCluskey (Tabular) Minimization Two step process utilizing tabular listings to: Identify prime implicants (implicant tables) Identify minimal PI.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Multi-Valued Logic.
2-Level Minimization Classic Problem in Switching Theory Tabulation Method Transformed to “Set Covering Problem” “Set Covering Problem” is Intractable.
Heuristic Two-level Logic Optimization Giovanni De Micheli Integrated Systems Centre EPF Lausanne This presentation can be used for non-commercial purposes.
Two-Level Simplification Approaches Algebraic Simplification: - algorithm/systematic procedure is not always possible - No method for knowing when the.
ICS 252 Introduction to Computer Design Lecture 9 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.
Two Level and Multi level Minimization
COE 561 Digital System Design & Synthesis Two-Level Logic Synthesis Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum.
ICS 252 Introduction to Computer Design Lecture 10 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.
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.
2-1 Introduction Gate Logic: Two-Level Simplification Design Example: Two Bit Comparator Block Diagram and Truth Table A 4-Variable K-map for each of the.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 5: Quine-McCluskey Method José Nelson Amaral.
State university of New York at New Paltz Electrical and Computer Engineering Department Logic Synthesis Optimization Lect15: Heuristic Two Level Logic.
1 Quine-McCluskey Method. 2 Motivation Karnaugh maps are very effective for the minimization of expressions with up to 5 or 6 inputs. However they are.
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Output Grouping Method Based on a Similarity of Boolean Functions Petr Fišer, Pavel Kubalík, Hana Kubátová Czech Technical University in Prague Department.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 15: March 4, 2002 Two-Level Logic-Synthesis.
June 12, 2002© Howard Huang1 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
Chapter 13 Backtracking Introduction The 3-coloring problem
Boolean Functions 1 ECE 667 ECE 667 Synthesis and Verification of Digital Circuits Boolean Functions Basics Maciej Ciesielski Univ.
ICS 252 Introduction to Computer Design Lecture 8- Heuristics for Two-level Logic Synthesis Winter 2005 Eli Bozorgzadeh Computer Science Department-UCI.
ICS 252 Introduction to Computer Design Lecture 8 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.
ELEC Digital Logic Circuits Fall 2014 Logic Minimization (Chapter 3)
Computer Organisation
Lecture #6 EGR 277 – Digital Logic
SINGLE-LEVEL PARTITIONING SUPPORT IN BOOM-II
CS 352 Introduction to Logic Design
ICS 252 Introduction to Computer Design
Synthesis of Two Level Circuits
EE4271 VLSI Design Logic Synthesis EE 4271 VLSI Design.
ECB2212-Digital Electronics
Minimization of Switching Functions
Heuristic Minimization of Two Level Circuits
Heuristic Minimization of Two Level Circuits
ICS 252 Introduction to Computer Design
Presentation transcript:

Winter 2014 S. Areibi School of Engineering University of Guelph ENGG3190 Logic Synthesis “Two Level Logic Synthesis: Heuristics (ESPRESSO)” (Part II) Winter 2014 S. Areibi School of Engineering University of Guelph

Outline Optimality Heuristics ESPRESSO Expand, Reduce, Irredundant Steps Input Format Comparison: QM vs. ESPRESSO

Exact Algorithm vs. Heuristics

Don’t forget that essential prime implicants should be included in every solution!!

Global Local Global Optimal versus Local Optimal By Iterative Improvement we can move from a Local bad solution to yet another Local better solution

Local Search

Local Search HOW?

ESPRESSO ESPRESSO utilizes modified local search keep in mind local minimum problem Composed of three main operations: Expand, Reduce, Irredundant Espresso Heuristic (in a nutshell) Apply Expand and Irredundant operators to: optimize the current function specification go down hill  improve the objective function Uses the Reduce operator to: get out of local minimum go up hill  deteriorate the objective function This is iterated till the solution converges

EXPAND Objective: Take a cube c and make it prime by removing literals. a). Greedy way

Expand Operation Expand expand essential cubes in F in decreasing size to a prime cube prime cube - fully expanded against OFF-set essential cube - contains essential vertex essential vertex - minterm no other cube covers remove any covered cubes ON DC OFF 00 01 11 10 00 01 11 10 Expand

EXPAND: Check Validity Determining the correct direction of expansion is important!! Expand abc by removing a (results in bc) Is it valid? NO

EXPAND: Objective

REDUCE: Cube Operations shrink cubes in descending order of size while maintaining cover smaller cubes can expand in more directions smaller cubes more likely to be covered by other cubes during expansion ON DC OFF 00 01 11 10 00 01 11 10 Reduce

REDUCE Operator: Validate Solutions

REDUCE: Good vs. Bad Problem: Given a cover F and c  F, find the smallest cube c  c such that F\{ c } + { c } is still a cover. c is called the maximally reduced cube of c. REDUCE is order dependent on off WHY? Don’t care

REDUCE: Order Dependent Example: Two orders: REDUCE is order dependent !

REDUCE followed by Expand Main Idea: Make a prime not a prime but still maintain cover: {c1 ,…, ci,…, ck}  {c1 ,…,ci,ci+1 ,…,ck } But Get out of a local minimum (prime and irredundant is local minimum) Then have nonprimes, so can expand again in different directions. (Since EXPAND is “smart”, it may know best direction)

Reduce + Expand: Example

Redundant Prime Implicant (RPI) If each minterm subsuming a prime implicant (PI) is also covered by other essential prime implicants, then that PI is called a redundant prime implicant (RPI). Also called redundant prime cube (RPC). A 1 EPI C RPI B

Irredundant Cubes Let F = {c1, c2, …, ck} be a cover for f, i.e. f = ik=1 ci A cube ci F is irredundant if F\{ci}  f Example: f = ab + ac + bc ac bc bc Not covered ab ac c b F\{ab}  f a

IRREDUNDANT Problem: Given a cover of cubes {ci}, find a minimal subset {cik} that is also a cover, i.e.

Irredundant: Definitions Relatively essential set Er Implicants covering some minterms of the function not covered by other implicants Important remark: we do not know all the primes! Totally redundant set Rt Implicants covered by the relatively essentials Partially redundant set Rp Remaining implicants Find a subset of Rp that, together with Er covers the function.

Irredundant: Example Er = {α, ε} Rt = ∅ Rp = {β, γ, δ} α 10 10 11 α 10 10 11 δ 01 01 11 γ 01 11 01 β 11 10 01 ε 11 01 10 b a c Er = {α, ε} Rt = ∅ Rp = {β, γ, δ} Irredundant Cover Minimum Irredundant Cover

Espresso – Irredundant Operator

Irredundant & Minimal Covers

Espresso – Additional Concerns We will cover this Later!

ESPRESSO: Steps a’b’ a’b ab ab’ x = a’b + ab + a’b’ Expand a’b’ a’b ab Irredundant Reduce a’b’ a’b ab ab’ a’b’ a’b ab ab’ Expand a’b’ a’b ab ab’ x = a’ + b a’b’ a’b ab ab’ Irredundant Cost Stable

ESPRESSO Illustrated

Heuristic Logic Minimization Apply a sequence of logic transformations to reduce a cost function Transformations Expand: Input expansion Enlarge cube by combining smaller cubes Reduces total number of cubes Output expansion Use cube for one output to cover another Reduce: break up cube into sub-cubes Increases total number of cubes Hope to allow overall cost reduction in a later expand operation Irredundant Remove redundant cubes from a cover

Example: Input Expansion Expand: input expansion z y Redundant! x On-set member Off-set member xyz f 000 1 01- -11 xyz f 0-0 1 01- -11 xyz f 0-0 1 -11

Example: Output Expansion Expand: output expansion Two output functions of three variables each with initial covers shown below z z y y x x f1 f2 f1 f2 xyz F1F2 0-1 10 1-0 00- 01 -00 -11 xyz F1F2 0-1 11 1-0 10 00- 01 -00 -11

Espresso – Algorithm

Example of ESPRESSO Input/Output ƒ(A,B,C,D) = m(4,5,6,8,9,10,13) + d(0,7,15) Espresso Input Espresso Output .i 4 .o 1 .ilb a b c d .ob f .p 10 0100 1 0101 1 0110 1 1000 1 1001 1 1010 1 1101 1 0000 - 0111 - 1111 - .e -- # inputs -- # outputs -- input names -- output name -- number of product terms -- A'BC'D' -- A'BC'D -- A'BCD' -- AB'C'D' -- AB'C'D -- AB'CD' -- ABC'D -- A'B'C'D' don't care -- A'BCD don't care -- ABCD don't care -- end of list .i 4 .o 1 .ilb a b c d .ob f .p 3 1-01 1 10-0 1 01-- 1 .e ƒ = A C' D + A B' D' + A' B

How it Works: Interesting Mechanics The core representation is PCN cube lists Most operations are those covered in previous lecture (Unate Recursive Paradigm (URP)) Several heuristic techniques to order cubes (cleaver ordering techniques) You can easily implement the ESPRESSO heuristic with previous knowledge The main idea of Expansion is how to avoid expanding in the wrong direction!! Let’s see the details

EXPAND Step : Details Outline: Expand one cube, ci , at a time Build “blocking” matrix B = B ci See which other cubes cj can be feasibly covered using B. Choose expansion (literals to be removed) to cover most other cj . Note:

Expanding is covering more 1’s Covering more 1’s means removing variables from the cube Removing variables from the cube is essentially less literals!! How to find XZ’ or XY starting from XYZ’W’? We will use “Set Covering” technique

Covering problem!! Cover each element more than once. The covering problem is an Integer Linear Programming problem. Has many applications in industry: airline scheduling, crew scheduling, oil company vehicle scheduling, VLSI Design … We will turn the EXPAND problem into a covering problem.

Set Covering and Partitioning Min Z = c S j=1 j j a S = 1 ij j i  {1,…m} Subject to: Set Covering > n Min Z = c S j=1 j j a S = 1 ij j i  {1,…m} Subject to: Set Partitioning

EXPAND as a Covering Problem Expand = a Covering Problem on the Blocking Matrix First: Given function F, build a cube cover of the 0’s in F Why?: We need to know what our cube cannot touch when it expands!! How?: URP Complement of the starting cover of the function! Recall OFF Set, ON Set, DC Set The Blocking Matrix will help us avoid expansion in the wrong direction. We will start to expand from the Cube W’XYZ’ (since it is the worst!!) This is exactly the same step in ESSPRESSO! URP Complement will give me the grey Cubes

Building the Blocking Matrix Expand = a Covering Problem on the Blocking Matrix One row for each variable in the cube you are trying to expand One Column for each cube in the cover of the OFF set. Put a “1” in the matrix if the cube variable (row) <> polarity of variable in the cube (column) of the OFF cover; else “0”. If don’t care, it’s a “0” (draw blank) 1 1 1 1 1 Once you build the Blocking Matrix it will help us in avoiding the expansion in the wrong direction. We might not have too many rows, but we might have many columns in real life problems What do I do with this Blocking Matrix?

What does a ‘1’ in a row and column really mean? For example Row #1, if we attempt to remove W’ from W’XYZ’ the Matrix says “be careful” since we will hit WXZ’ or WY’Z’

The Blocking Matrix will assist us in obtaining a legal cube expansion! If we pick the first row (W’) and the second row (X) then we will cover all the F’ cubes. So we will end up with W’X and get rid of the Y and Z’ A second solution would be W’Z’ (1st and 4th rows) Check the K-Map on the left hand side (where is W’X, W’Z’?)

The Reduce-Expand-Irredundant Can lead to excellent solutions. Clever tricks and elegant heuristics. Lots of usage of covering problems.

Besides ESPRESSO there are other similar tools that can produce good solutions and based on heuristic techniques.

Comparison Performance Comparison Between Quine McClusky and Espresso Exact Method for Logic Minimization Compute Time is prohibitive for Minimizations (Doubly Exponential) Times-out for medium complexity benchmarks ESPRESSO Heuristic Method for Logic Minimization Based on Unate Recursive Paradigm Inferior to Quine McClusky in minimization Some sacrifice in optimization for a large reduction in run time Relatively unchanged for 20 years. Performance Comparison Between Quine McClusky and Espresso

ESPRESSO :: Conclusion The algorithm successively generates new covers until no further improvement is possible. Produces near-optimal solutions. Used for: PLA minimization, or as a sub-function in multilevel logic minimization. Can process very large circuits. 10,000 literals, 100 inputs, 100 outputs Less than 15 minutes on a high-speed workstation

Extra Slides

Need for Iterations in ESPRESSO Espresso: Why Iterate on Reduce, Irredundant Cover, Expand? Initial Set of Primes found by Steps1 and 2 of the Espresso Method Result of REDUCE: Shrink primes while still covering the ON-set Choice of order in which to perform shrink is important 4 primes, irredundant cover, but not a minimal cover!

ESPRESSO Example Espresso Iteration (Continued) Second EXPAND generates a different set of prime implicants IRREDUNDANT COVER found by final step of espresso Only three prime implicants!

Other operators Reduce Irredundant Future Expand operation Reduce Identified as redundant; removed Irredundant

Example of an Application of Operators (12 cubes) (10 cubes) -011 10 --11 11 1001 01 1101 -001 -1-0 1010 0110 0010 -100 1000 (9 cubes) reduce --11 11 1001 01 1101 10 -001 -1-0 1010 0110 -010 -100 1000 --11 11 1001 01 1101 10 -0-1 -1-0 1010 0-10 -100 10-0 expand expand reduce expand

Example of a minimization loop F = Expand(F, D) F = Irredundant(F,D) do { Cost = |F| F = Reduce(F,D) F = Expand(F,D) F = Irredundant(F,d) } while (|F| < Cost) F= Make_sparse(F,D) Make_sparse reduces output parts of a cube (e.g., from 11 to 10) to remove redundant connections) Example: xyz F1F2 11- 10 -01 1-1 11 0-0 01 xyz F1F2 11- 10 -01 1-1 01 0-0

P S R T Q The goal is to start with this and do some optimization Optimization involves three steps: Expand, Reduce, Irredundancy

The goal is to make cubes become “Prime Cover”, i. e The goal is to make cubes become “Prime Cover”, i.e., cover as many ones as possible This operation is called Expand

To create new solutions, all redundant cubes are removed This is called Irredundant Operation Note: this is still a local optimum solution

This is an essential step (Reduce) that might allow us to explore new solutions. The new solution is far from optimal!! But it can help in next iterations to find a more superior solution.

Expanding Cubes again will explore a new solution that might not have been seen before and whose cost is less than previous solutions. All 1’s in the T Cube have been covered by two other cubes. The T Cube becomes redundant!!

Removing the redundant Cube leads to a better solution now.

We managed to get the global minima but this will not always be the case!! Most combinatorial optimization problems can be solved effectively using heuristics or meta-heuristics

Irredundant: Cube Operations find minimal cover with each cube containing an essential vertex find relatively essential cubes E removing them violates cover - keep them redundant cubes R = F - E can be individually removed totally redundant Rt - covered by E+D remove Rt partially redundant Rp - R - Rt new F = E + minimal set of Rp E ON DC OFF 01 11 00 01 11 10 Rp Rt Irredundant 00 10 Rp

REDUCE Algorithm

IRREDUNDANT In ESPRESSO The algorithm in ESPRESSO uses a modification of the tautology check. The key idea is the following: Rather than checking the tautology, we determine the set of cubes that, when removed, prevents the function from being a tautology!! The tautology of the cofactor can be used to determine containment. Hence, we can determine the set of cubes that when removed, prevents the containment!!