Presentation is loading. Please wait.

Presentation is loading. Please wait.

Winter 2014 S. Areibi School of Engineering University of Guelph

Similar presentations


Presentation on theme: "Winter 2014 S. Areibi School of Engineering University of Guelph"— Presentation transcript:

1 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

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

3 Exact Algorithm vs. Heuristics

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

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

6 Local Search

7 Local Search HOW?

8 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

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

10 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

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

12 EXPAND: Objective

13 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

14 REDUCE Operator: Validate Solutions

15 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

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

17 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)

18 Reduce + Expand: Example

19 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

20 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

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

22 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.

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

24 Espresso – Irredundant Operator

25 Irredundant & Minimal Covers

26 Espresso – Additional Concerns
We will cover this Later!

27 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

28 ESPRESSO Illustrated

29 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

30 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

31 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

32 Espresso – Algorithm

33 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 .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 .e ƒ = A C' D + A B' D' + A' B

34 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

35 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:

36 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

37 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.

38 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

39 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

40 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?

41 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’

42 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’?)

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

44

45

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

47 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

48 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

49

50 Extra Slides

51 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!

52 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!

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

54 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

55 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

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

57 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

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

59 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.

60 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!!

61 Removing the redundant Cube leads to a better solution now.

62 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

63 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

64 REDUCE Algorithm

65 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!!


Download ppt "Winter 2014 S. Areibi School of Engineering University of Guelph"

Similar presentations


Ads by Google