logic synthesis 2 1 logic synthesis part ii maciej ciesielski [email protected] univ. of...

32
1 Logic Synthesis 2 Logic Synthesis Logic Synthesis Part II Part II Maciej Ciesielski Maciej Ciesielski [email protected] [email protected] Univ. of Massachusetts Univ. of Massachusetts Amherst, MA Amherst, MA

Post on 19-Dec-2015

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

1Logic Synthesis 2

Logic SynthesisLogic SynthesisPart IIPart II

Maciej CiesielskiMaciej Ciesielski

[email protected]@ecs.umass.edu

Univ. of MassachusettsUniv. of Massachusetts

Amherst, MAAmherst, MA

Page 2: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 2

OutlineOutline

Last time:• Synthesis flow• Two-level synthesis (PLA)

– Exact methods (Quine McCluskey)– Heuristic methods (Espresso)

• Multi-level synthesis (standard cells/FPGA)– Structural synthesis (SIS)

Today:• Functional decomposition

• Traditional – disjoint decomposition (Ashenhurst Curtis)• BDD-based bidecomposition (BDS)

Page 3: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 3

Synthesis Flow Synthesis Flow

Logic synthesis Logic synthesis

HDL specification

Technology-independent

optimizationTechnology-independent

optimization

Technology

mappingTechnology

mappingCell library

Manufacturing

Front-end

parsingFront-end

parsing

Page 4: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 4

Logic Optimization methods Logic Optimization methods

Logic Optimization

Multi-level logic

(standard cells)Multi-level logic

(standard cells)

Two-level logic (PLA)Two-level logic (PLA)

Exact (QM)Exact (QM)Heuristic

(espresso)Heuristic

(espresso)

Structural

(SIS)Structural

(SIS)

Functional

(AC, Karp)Functional

(AC, Karp)

Functional

(BDD-based)Functional

(BDD-based)

algebraic

Boolean

Boolean

Page 5: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 5

Two-level minimization - basic ideaTwo-level minimization - basic idea

Initial representation: x y z

0 – 0

0 1 –

– 1 1

1 – 1

f1 f2

0 1

0 1

1 0

1 0

xy

z

000 100

110010

111011

010

000 100

110010

111011

010

f1f2

101 101

f1 f2

000 100

110010

111011

010

000 100

110010

111011

010101 101

x y z

0 – 0

0 1 1

1 – 1

f1 f2

0 1

1 1

1 0

Minimized function:

Page 6: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 6

Exact 2-Level Minimization (Exact 2-Level Minimization (Quine-McCluskeyQuine-McCluskey))

Solution: {p1,p2} y + w is minimum prime cover (non-unique).

Possible approach (SAT): (p1+p3)(p2 +p3)(p1+p2)p2 = 1

Min

term

s of

F y’ w x’z’

010

011

110

101

x y z’ w

x’ y z w

x’ y z’ w

x’ y’ z’ w’

essential minterm

Primes of (F+D) = ( p1 p2 p3 )

F x yzw xyzw x yzw xyzw

D yz xyw x yzw x yw xyzw

(on set)

(don’t care set)

Page 7: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 7

Heuristic 2-level logic minimization (Heuristic 2-level logic minimization (espressoespresso))

Consider F(a,b,c) initially specified as:

f = {abc, abc, abc} (on-set), and d ={abc, abc} (don’t care set)

off

on

don’t care abc is redundanta is prime F3= a+abc

Expand abc bc

Expand abca

F2= a+abc + abc

F4= a+bc

F1= abc + abc+ abc

a

cb

Page 8: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 8

Multi-level Minimization: Boolean networkMulti-level Minimization: Boolean network

InputsOutputs

6

1

53

47

8

92

Internal nodes,

single-output functions

• Goal: minimize some measure of network complexity

- number of 2-input gates

- number of literals (variables), represe

• Eventually, the nodes have to be mapped to standard cells

(technology mapping)

Page 9: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 9

Structural Operations (algebraic)Structural Operations (algebraic)

Basic Operations: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. Factoring (series-parallel decomposition)

f = ac+ad+bc+bd+e

f = (a+b)(c+d)+e

Page 10: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 10

Structural Operations, cont’d.Structural Operations, cont’d.

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’

Note: algebraic division plays a key role in all these algorithms:• given function f, find g, such that

f = g h, where support(g) support(h) =

Page 11: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

11Logic Synthesis 2

Functional DecompositionFunctional Decomposition(multi-level minimization)(multi-level minimization)

• Classical Asenhurst-Curtis decomposition, (based on decomposition charts)

• A-C decomposition using BDDs

• BDD-based bi-decomposition (BDS)

Page 12: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 12

OverviewOverview

• The concept of functional decomposition• Two uses of BDDs in synthesis

– as a computation engine to implement algorithms– as a representation that helps find decompositions

• Two ways to direct decomposition using BDDs– bound set on top (Lai/Pedram/Vardhula, DAC’93)– free set on top (Stanion/Sechen, DAC’95)– other approaches

• Disjoint and non-disjoint decomposition

• Bi-decomposition

Page 13: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 13

Two-LevelTwo-Level Curtis DecompositionCurtis Decomposition

if B A = , this is disjoint decomposition

if B A , this is non-disjoint decomposition

X

B = bound set A= free set

F(X) = H( G(B), A ), X = B A

F

G

HA

BF

Page 14: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 14

Decomposition TypesDecomposition Types

Simple disjoint decomposition (Asenhurst)

FHA

GB

B

F

G

HA

Disjoint decomposition (Curtis)

Non-disjoint decomposition

F

G

H

A

B

Page 15: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 15

Decomposition ChartDecomposition Chart

1 2 3 4

000010

101011

010101

111100

10110100

Bound Set = {a,b}

Free Set = {c,d}

3

1

4

2

Incompatibility Graph

=2

G

G

G

G

Definition 1: Column Compatibility

Two columns i and j are compatible if each element in i is equal to the corresponding element in j, or the element in either i or j is not specified

Definition 2: Column Multiplicity = the number of compatible sets (distinct column patterns)

Page 16: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 16

Fundamental Decomposition TheoremsFundamental Decomposition Theorems

• Theorem (Asenhurst)Let k be the minimum number of compatible sets in the decomposition chart. Then function H must distinguish at least k values

• Theorem (Curtis)

Let (A | B) denote column multiplicity under decomposition into the bound set B and free set A. Then:

(A | B) 2k F(B,A) = H(G1(B), G2(B), …, Gk(B), A)

FG

H

B

A

k

Page 17: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 17

Asenhurst-Curtis DecompositionAsenhurst-Curtis Decomposition

F(a,b,c,d) = (ab+ ab)c'+ (ab+ ab)(cd+cd)

G(a,b)= ab+ab H(G,c,d) = Gc+ G(cd+cd)

1 2 1 2

000010

101011

010101

111100

10110100

Bound Set = {a,b}

Free Set = {c,d}

Here = 2, function H must

distinguish two values• need k=1 bit to encode outputs of G

FG

H

ab

cd

Page 18: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 18

• Two-level decomposition is iteratively applied to new functions Hi and Gi, until smaller functions Gt and Ht are created, that are not further decomposable.

• One of the possible cost functions is Decomposed Function Cardinality (DFC). It is the total cost of all blocks, where the cost of a binary block with n inputs and m outputs is m * 2n.

Multi-Level Curtis DecompositionMulti-Level Curtis Decomposition

Page 19: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 19

Typical Decomposition AlgorithmTypical Decomposition Algorithm

• Find a set of partitions (Bi, Ai) of input variables X into bound set variables Bi and free set variables Ai

• For each partition, find decompositionF(X) = Hi (Gi(Bi ), Ai )

such that the column multiplicity is minimal, and compute DFC (disjoint function cardinality).

• Repeat the process for all partitions until the decomposition with minimum DFC is found.

Page 20: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 20

Using BDD to direct DecompositionUsing BDD to direct Decomposition

• Problem with classical AC decomposition:– Need one decomposition chart for each decomposition– Computationally expensive!

• Alternatively, the algorithm may exploit the BDD structure of the function F to direct the decomposition:– in the bound set selection, – column multiplicity computation, and – deriving the decomposed functions G and H

Page 21: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 21

Binary Decision Diagram (BDD) - reviewBinary Decision Diagram (BDD) - review

f = ab+a’c+a’bd

1

0

c

a

b b

c c

d

0 1

c+bd b

root node

c+d

d

Graph representation of a Boolean function - vertices represent decision nodes for variables

- two children represent the two subfunctions

f(x = 0) and f(x = 1) (cofactors)

- restrictions on ordering and reduction rules

can make a BDD representation canonical

Page 22: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 22

BDD-Based DecompositionBDD-Based Decomposition

• Disjoint decomposition: based on BDD cut that separates bound set from free set – Bound set on top (Lai/Pedram/Vardhula, DAC’93)– Free set on top (Stanion/Sechen, DAC’95)

• Bi-decomposition using the concept of dominators – BDS system (Yang/Ciesielski, ICDD’99)

• Recursive decomposition – (Bertacco/Damiani,ICCAD’97)

• Implicit decomposition – (Wurth/Eckl/Legl,DAC’95)

Page 23: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 23

BDD-based Functional DecompositionBDD-based Functional Decomposition

• Functional decomposition (AC): F(X) = H (G(B ), A )

• Find a BDD cut , dividing variables into disjoint sets:– bound set B– free set A

FG

H

B

A

F

B

ABDD

cut

free set

bound set

Page 24: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 24

Bound Set on TopBound Set on Top Algorithm Algorithm - - Function Function GG

G={g0,g1}, A=g0g1, B=g0g1, C=g0g1

g0=abc+abc+abc, g1 = abc+ abc

A=00 C=01

B=10

Bound Set

Free Set

A A AB BB CC

= 1

= 0

0 1

Page 25: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 25

Bound Set on TopBound Set on Top Algorithm -Algorithm - Function Function HH

A A AB BB CC

F(a,b,c,d,e) = H( g1(a,b,c), g2(a,b,c), d, e )

H=g0g1e + g0g1d + g0g1e

F

A=00 C=01

B=10

Bound Set

Free Set

= 1

= 0

0 1

Page 26: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 26

AC Decomposition Algorithm AC Decomposition Algorithm ((bound set on topbound set on top))

• Reorder variables in BDD for F and check column multiplicity for each bound set

• For the bound set with the smallest column multiplicity, perform decomposition :– Encode the cut nodes with minimum number of bits (log )

– derive functions G and H (both depend on encoding)

• Iteratively repeat the process for functions G and H (typically, only H)

Note: This is an ALGEBRAIC decomposition• The algorithm work only for disjoint decompositions: the

variables in the bound set and the free set are disjoint !

Page 27: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 27

Free Set on TopFree Set on Top Algorithm Algorithm - - Function Function GG

Bound Set

G={g1,g2}, g1=cde+cd, g2=d+e

A=00 C=01

B=10

Free Set

Bound Set

g1 g2

F

10

= 1

= 0

Page 28: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 28

Free Set on TopFree Set on Top Algorithm - Algorithm - Function Function HH

A=00 C=01

B=10

Bound Set

F(a,b,c,d,e) = H( a, b, g1(c,d,e), g2(c,d,e) )

H=(ab+ ab) g1 + (ab+ ab) g2

Free Set

Bound Set

g1 g2

F

10

= 1

= 0

Page 29: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 29

Free Set on Top Algorithm

• Find good variable order• Derive implicit representation of all feasible cuts on

the BDD representing F• Use some cost function to find the best bound set

and perform decomposition• Repeat the process for functions G and H• This algorithms is faster than “bound set on top” but

it does not work for non-disjoint decompositions and incompletely specified functins (with DCs).

Page 30: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 30

Non-Disjoint DecompositionNon-Disjoint Decomposition

• Non-disjoint decomposition can be reduced to disjoint decomposition by adding variables

• Bound Set = {a,b,c}, Free Set = {c,d}

Disjoint decomposition can be generated by introducing variables c1=c2=c instead of c

• In terms of the Karnaugh map, it is equivalent to introducing two variables instead of one in such a way that c1c2 +c1c2 is a don’t care set.

Why: c1 c2 c1c2 +c1c2

Page 31: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 31

Non-Disjoint Decomposition ExampleNon-Disjoint Decomposition Example

There is no disjoint decomposition with any bound set.

But there exists a non-disjoint decomposition with bound set {a,b,c}

A A A ABBBBA B C B

Page 32: Logic Synthesis 2 1 Logic Synthesis Part II Maciej Ciesielski ciesiel@ecs.umass.edu Univ. of Massachusetts Amherst, MA

Logic Synthesis 2 32

Non-Disjoint Bi-DecompositionNon-Disjoint Bi-Decomposition

• There is a better,more systematic way to perform non-disjoint decomposition without adding variables

• Bi-decomposition: F = D Q– uses BDD cut , but there is no concept of bound set / free set– The top set defines a divisor D– The bottom set defines the quotient Q (sort of …)

FD

Q

Boolean operator

(AND, OR, XOR)

F

D

F/DBDD

cut