multi level intro

23
Multilevel Logic Synthesis Multilevel Logic Synthesis -- -- Introduction Introduction

Upload: prem-rj

Post on 06-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 1/23

Multilevel Logic SynthesisMultilevel Logic Synthesis

-- -- IntroductionIntroduction

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 2/23

ENEE 644 2

Multilevel Logic Synthesis: OutlineMultilevel Logic Synthesis: Outline

IntroductionIntroduction What is multilevel logic?What is multilevel logic?

Why we need it?Why we need it?

Problems and challenges.Problems and challenges.

Multilevel Logic Synthesis and MinimizationMultilevel Logic Synthesis and Minimization

RestructuringRestructuring

Technology Independent Local OptimizationTechnology Independent Local Optimization

Technology MappingTechnology Mapping Delay Analysis and Optimization (*)Delay Analysis and Optimization (*)

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 3/23

ENEE 644 3

Multilevel Logic vs. TwoMultilevel Logic vs. Two--Level Logic Level Logic 

Example:Example: Let F=a¶b+ab¶, define G and H as follows:Let F=a¶b+ab¶, define G and H as follows:

if F is true, then G=cd+a¶d¶, H=cd+a¶d¶+e(f+b),if F is true, then G=cd+a¶d¶, H=cd+a¶d¶+e(f+b),

else G=e(f+b), H=(cd+a¶d¶)e(f+b).else G=e(f+b), H=(cd+a¶d¶)e(f+b).

c c 

d d a¶ a¶ 

d¶ d¶ 

f f 

bb

F F F¶ F¶ 

ee

G G 

MultiMulti--Level Implementation:Level Implementation:G=F(cd+a¶d¶)+F¶e(f+b)G=F(cd+a¶d¶)+F¶e(f+b) 44--levellevel

H=F(cd+a¶d¶+e(f+b))+F¶(cd+a¶d¶)e(f+b)H=F(cd+a¶d¶+e(f+b))+F¶(cd+a¶d¶)e(f+b) 55--levellevel

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 4/23

ENEE 644 4

Multilevel Logic vs. TwoMultilevel Logic vs. Two--Level Logic Level Logic 

Example:Example: Let F=a¶b+ab¶, define G and H as follows:Let F=a¶b+ab¶, define G and H as follows:if F is true, then G=cd+a¶d¶, H=cd+a¶d¶+e(f+b),if F is true, then G=cd+a¶d¶, H=cd+a¶d¶+e(f+b),

else G=e(f+b), H=(cd+a¶d¶)e(f+b).else G=e(f+b), H=(cd+a¶d¶)e(f+b).

G = F(cd+a¶d¶)+F¶e(f+b) = (a¶b + ab¶)(cd + a¶d¶) + (a¶b +G = F(cd+a¶d¶)+F¶e(f+b) = (a¶b + ab¶)(cd + a¶d¶) + (a¶b +

ab¶)¶(e)(f + b)ab¶)¶(e)(f + b)

= a¶bcd + a¶bd¶ + acdb¶ + e(f+b)(a+b¶)(a¶ +b)= a¶bcd + a¶bd¶ + acdb¶ + e(f+b)(a+b¶)(a¶ +b)

= a¶bcd + a¶bd¶ + acdb¶ + (efa + efb¶ + eba)(a¶+b)= a¶bcd + a¶bd¶ + acdb¶ + (efa + efb¶ + eba)(a¶+b)

= a¶bcd + a¶bd¶ + acdb¶ + efab + efb¶a¶ + eba= a¶bcd + a¶bd¶ + acdb¶ + efab + efb¶a¶ + eba

THIS IS MORE COMPLICATED TO IMPLEMENTTHIS IS MORE COMPLICATED TO IMPLEMENT

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 5/23

ENEE 644 5

Multilevel Logic vs. TwoMultilevel Logic vs. Two--Level Logic Level Logic 

TwoTwo--level:level:  At most two gates between a primary input and a primary output. At most two gates between a primary input and a primary output.

Real life circuits: PLA.Real life circuits: PLA.

Exact optimization methods: wellExact optimization methods: well--developed, feasible.developed, feasible.

Heuristics.Heuristics.

MultiMulti--level:level:  Any number of gates between a primary input and a primary output. Any number of gates between a primary input and a primary output.

Most circuits in real life are multilevel (e.g. standard cells, FPGA).Most circuits in real life are multilevel (e.g. standard cells, FPGA).

Smaller, less power, and (in many cases) faster.Smaller, less power, and (in many cases) faster.

Exact optimization methods: few, high complexity, impractical.Exact optimization methods: few, high complexity, impractical.

Heuristics.Heuristics.

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 6/23

ENEE 644 6

Optimization ObjectivesOptimization Objectives

1.1. Area Area: occupied by the logic gates and interconnect,: occupied by the logic gates and interconnect, e.g.e.g.measured by ³one literal = one transistor´ in technologymeasured by ³one literal = one transistor´ in technology

independent optimization.independent optimization.

2.2. DelayDelay: measured by the longest path (critical path) through: measured by the longest path (critical path) through

the logic.the logic.

3.3. Power ConsumptionPower Consumption

Optimization is performed while simultaneouslyOptimization is performed while simultaneously

satisfying upper/lower bound constraints placed onsatisfying upper/lower bound constraints placed onthese physical quantities.these physical quantities.

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 7/23

ENEE 644 7

Optimization Cost CriteriaOptimization Cost Criteria

(Figure source: Prof. Brayton¶s lecture notes.)(Figure source: Prof. Brayton¶s lecture notes.)

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 8/23

ENEE 644 8

 A design is technology independent when the formula A design is technology independent when the formula(function, system) has no connection with the building(function, system) has no connection with the building

blocks in the implementation.blocks in the implementation.

 Advantage: Advantage: cost can be simply estimated by the number of logiccost can be simply estimated by the number of logic

symbols (I.e. one literal = one transistor), delay is the length of thesymbols (I.e. one literal = one transistor), delay is the length of the

³critical path´, better for local optimization.³critical path´, better for local optimization.

ExampleExample: Full Adder : Full Adder 

z(x,y,c) = XOR(x,y,c) = xyc+x¶y¶c+x¶yc¶+xy¶c¶z(x,y,c) = XOR(x,y,c) = xyc+x¶y¶c+x¶yc¶+xy¶c¶

ccnewnew(

x

,y,c) = Majority(x

,y,c) =x

y+(x

+y)c(x

,y,c) = Majority(x

,y,c) =x

y+(x

+y)c The literal count is 12+5=17 The literal count is 12+5=17 

The critical path delay is 3: xThe critical path delay is 3: xppx+yx+ypp(x+y)c(x+y)cppccnewnew

Technology Independent Technology Independent 

 A design is technology independent when the formula A design is technology independent when the formula(function, system) has no connection with the building(function, system) has no connection with the building

blocks in the implementation.blocks in the implementation.

 Advantage: Advantage: cost can be simply estimated by the number of logiccost can be simply estimated by the number of logic

symbols (I.e. one literal = one transistor), delay is the length of thesymbols (I.e. one literal = one transistor), delay is the length of the

³critical path´, better for local optimization.³critical path´, better for local optimization.

 A design is A design is technology independenttechnology independent when the formulawhen the formula(function, system) has no connection with the building(function, system) has no connection with the building

blocks in the implementation.blocks in the implementation.

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 9/23

ENEE 644 9

 A design is A design is technologytechnologydependentdependent if the formulaif the formula(function, circuit, system) is(function, circuit, system) isimplemented by one or moreimplemented by one or morelogic gates in a prelogic gates in a pre--designeddesigned

set of gates (calledset of gates (called technologytechnologylibrarylibrary or or cell librarycell library).).

 Advantage: Advantage: gates in the cell librarygates in the cell libraryhave a highly optimized, prehave a highly optimized, pre--defineddefinedpath to silicon, so that the area andpath to silicon, so that the area and

delay parameters are known anddelay parameters are known andaccurateaccurate..

ExampleExample: Full Adder : Full Adder 

Technology Dependent Technology Dependent 

22NOTNOT j¶ j¶ccnewnew

44NORNOR(a+f)¶(a+f)¶ j j

22NOTNOTh¶h¶f f 

44N ANDN AND(dc)¶(dc)¶hh

22NOTNOTb¶b¶dd

88XORXORe¶c+ec¶e¶c+ec¶zz

44NORNOR(a+b)¶(a+b)¶ee

44NORNOR(x+y)¶(x+y)¶bb

22NOTNOTg¶g¶aa

44N ANDN AND(xy)¶(xy)¶gg

transitransistorsstors

gategateformulaformulasignalsignal

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 10/23

ENEE 644 10

Multilevel Logic Synthesis ProblemMultilevel Logic Synthesis Problem

Goal:Goal: Model the multilevel logicModel the multilevel logic

Optimize the logic based on the cost criteriaOptimize the logic based on the cost criteria

Difficulty:Difficulty: Multilevel gives more design freedom and increases the designMultilevel gives more design freedom and increases the design

complexitycomplexity Technology dependent/independent viewsTechnology dependent/independent views

Models:Models:  Algebraic forms Algebraic forms

Boolean networksBoolean networks

Optimization Techniques:Optimization Techniques: HARDHARD Exact method: few, exponential complexity, impracticalExact method: few, exponential complexity, impractical

 Approximation method: heuristic algorithm, rules Approximation method: heuristic algorithm, rules--based methodsbased methods

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 11/23

ENEE 644 11

Sum of Products (SOP)Sum of Products (SOP)

Example:Example: abc¶+a¶bd+b¶d¶+b¶e¶f abc¶+a¶bd+b¶d¶+b¶e¶f 

 Advantages: Advantages: Easy to manipulate and minimize.Easy to manipulate and minimize.

 Algorithms available (e.g. AND, OR, TAUTOLOGY). Algorithms available (e.g. AND, OR, TAUTOLOGY).

TwoTwo--level theory applies.level theory applies.

Disadvantages:Disadvantages: Not representative of logic complexity.Not representative of logic complexity. For exampleFor example

f=ad+ae+bd+be+cd+cef=ad+ae+bd+be+cd+ce f¶=a¶b¶c¶+d¶e¶  f¶=a¶b¶c¶+d¶e¶ 

which differ in their implementation by an inverter.which differ in their implementation by an inverter. Difficult to estimate logic and to estimate progressDifficult to estimate logic and to estimate progress

during logic manipulation.during logic manipulation.

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 12/23

ENEE 644 12

Factored Forms:Factored Forms: Overview Overview 

Example:Example: (ad+b¶c)(c+d¶(e+ac¶))+(d+e)fg (ad+b¶c)(c+d¶(e+ac¶))+(d+e)fg 

 Advantages: Advantages:

Good representative of logic complexityGood representative of logic complexityf=ad+ae+bd+be+cd+cef=ad+ae+bd+be+cd+ce=(a+b+c)(d+e)=(a+b+c)(d+e) f¶=a¶b¶c¶+d¶e¶ f¶=a¶b¶c¶+d¶e¶ 

Good estimator of logic implementation complexityGood estimator of logic implementation complexity

Implicitly Imply MultiImplicitly Imply Multi--Level Computation (ComputationLevel Computation (Computation

using tree)using tree)

Disadvantages:Disadvantages:

Not many algorithms available for manipulationNot many algorithms available for manipulation

Not canonical:Not canonical: ab+c(a+b)=bc+a(b+c)=ac+b(a+c)ab+c(a+b)=bc+a(b+c)=ac+b(a+c)

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 13/23

ENEE 644 13

Factored Forms:Factored Forms: DefinitionDefinition

 A factored form is defined recursively by the rules: A factored form is defined recursively by the rules:1.1. A A productproduct is either a single literal or a product of factored form.is either a single literal or a product of factored form.

2.2. A A sumsum is either a single literal or a sum of factored forms.is either a single literal or a sum of factored forms.

3.3. A A factored formfactored form is either a product or a sumis either a product or a sum

Example:Example: Factored forms: x, y¶, abc¶,Factored forms: x, y¶, abc¶,

ab+c¶, ((a¶+b)cd+e)(a+b¶)+e¶.ab+c¶, ((a¶+b)cd+e)(a+b¶)+e¶.

However, (a¶+b¶)¶c¶ is not,However, (a¶+b¶)¶c¶ is not,

although it equals abc¶. Thisalthough it equals abc¶. Thisis because internalis because internalcomplement in not allowedcomplement in not allowed

 Another point of view: Another point of view: pp ppll (1) (base case)(1) (base case)

pp ppf*f f*f (2)(2)

ss ppll (3) (base case)(3) (base case)

ss ppf+f f+f (4)(4)

f f pppp (5)(5)

f f ppss (6)(6)

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 14/23

ENEE 644 14

Factoring TreeFactoring Tree

Factored forms can be graphically representedFactored forms can be graphically representedas labeled trees, calledas labeled trees, called factoring treesfactoring trees, in which, in which

each internal node including the root is labeledeach internal node including the root is labeled

with either with either ++ or or ··, and each leaf has a label of , and each leaf has a label of 

either a variable or its complement.either a variable or its complement.

Example:Example: ((a¶+b)cd+e)(a+b¶)+e¶ ((a¶+b)cd+e)(a+b¶)+e¶ 

++

··

++ ++

··

++

e¶e¶

b¶b¶aa

bba¶a¶

ee

cc dd

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 15/23

ENEE 644 15

Equivalent FactorizationsEquivalent Factorizations

Two factored forms areTwo factored forms are equivalentequivalent if theyif theyrepresent the same logic function.represent the same logic function. Example:Example: a(b+c)+bca(b+c)+bc andand ab+c(a+b)ab+c(a+b)

Two factored forms areTwo factored forms are syntactically equivalentsyntactically equivalent if if 

their factoring tree are isomorphic. (WHAT IStheir factoring tree are isomorphic. (WHAT ISISOMOSRPHIC?)ISOMOSRPHIC?) Example:Example: (a+b)(c+d)e(a+b)(c+d)e andand (c+d)e(a+b)(c+d)e(a+b)

a(b+c)+bca(b+c)+bc andand ab+c(a+b)ab+c(a+b)

++

ccbb

++

··

ccbbaa

··

bbaa

++

··

ccbbaa

··

++

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 16/23

ENEE 644 16

Maximal FactorizationsMaximal Factorizations

 A factored form is A factored form is maximally factoredmaximally factored if if  For every sum of products, there are no twoFor every sum of products, there are no two

syntactically equivalent factors in the products;syntactically equivalent factors in the products;

For every product of sums, there are no twoFor every product of sums, there are no two

syntactically equivalent factors in the sums.syntactically equivalent factors in the sums.

Example:Example:

ab+ac is not maximally factored,ab+ac is not maximally factored,

a(b+c) is.a(b+c) is.

(a+b)(a+c) is not maximally factored,(a+b)(a+c) is not maximally factored,

a+bc is.a+bc is.

bb

++

··

ccaaaa

··

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 17/23

ENEE 644 17

Optimum Factored FormsOptimum Factored Forms

TheThe sizesize of a factored formof a factored form f,f,  V V(f),(f), is the number is the number of literals in the factored form.of literals in the factored form.

Example:Example:

V V((a+b)ca¶) = 4((a+b)ca¶) = 4

V V((a+b+cd)(a¶+b¶)) = 6 ((a+b+cd)(a¶+b¶)) = 6 

 A factored form is A factored form is optimumoptimum if no other equivalentif no other equivalent

factored form has fewer literals.factored form has fewer literals.

Example:Example: ab+a¶c+bc is not optimum (ab+a¶c+bc = ab+a¶c).ab+a¶c+bc is not optimum (ab+a¶c+bc = ab+a¶c).

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 18/23

ENEE 644 18

U nate Factored FormsU nate Factored Forms

 A factored form A factored form F F isis positive unatepositive unate inin x  x ,, if if  x  x appears inappears in F F , but, but x¶  x¶ does not. A factored form isdoes not. A factored form is

negative unatenegative unate inin x  x ,, if if  x¶  x¶ appears inappears in F F , but, but x  x doesdoes

not. F isnot. F is unateunate in either case, and isin either case, and is binatebinate if it isif it is

not unate.not unate.

Example:Example:

(a+b¶)c+a¶ (a+b¶)c+a¶  is (positive) unate inis (positive) unate in c c , (negative) unate in, (negative) unate inbb, and binate in, and binate in aa..

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 19/23

ENEE 644 19

Cofactor of Factored FormsCofactor of Factored Forms

TheThe cofactor of a factored formcofactor of a factored form F F with respect to a literalwith respect to a literal x  x (or (or  x¶  x¶ ) is the factored form) is the factored form F F  x  x = F = F  x=1 x=1(x)(x) (or (or F F  x¶  x¶ =F =F  x=0  x=0 (x)(x) ))

obtained by:obtained by:

replacing all occurrences of replacing all occurrences of  x  x by 1, andby 1, and x¶  x¶  by 0by 0

simplifying the factored form using the Booleansimplifying the factored form using the Booleanalgebra identitiesalgebra identities

1y=y 1+y=1 0y=0 0+y=y 1y=y 1+y=1 0y=0 0+y=y 

after constant propagation (all constants areafter constant propagation (all constants are

removed), part of the factored form may appear asremoved), part of the factored form may appear asG

 G

 + G+ G. In general,. In general, GG is another factored form, and theis another factored form, and the

GG¶s may have different factored forms.¶s may have different factored forms.

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 20/23

ENEE 644 20

Cofactor of Factored FormsCofactor of Factored Forms

TheThe cofactor of a factored formcofactor of a factored form F F with respect towith respect toa cubea cube c c is a factored form obtained byis a factored form obtained by

successively cofactoringsuccessively cofactoring F F with each literal inwith each literal in c c ..

Example:Example:

F = (x+y¶+z)(x¶u+z¶y¶(v+u¶))F = (x+y¶+z)(x¶u+z¶y¶(v+u¶)) andand c = vz¶ c = vz¶ 

F F z¶ z¶ = (x+y¶)(x¶u+y¶(v+u¶))= (x+y¶)(x¶u+y¶(v+u¶))

F F z¶ v z¶ v = (x+y¶)(x¶u+y¶)= (x+y¶)(x¶u+y¶)

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 21/23

ENEE 644 21

 Algebraic and Boolean E  xpressions Algebraic and Boolean E  xpressions

f f is anis an algebraic expressionalgebraic expression if if f f is a set of cubes (SOP),is a set of cubes (SOP),such that nosuch that no single cubesingle cube contains another (minimal withcontains another (minimal withrespect to single cube containment). Otherwise,respect to single cube containment). Otherwise, f f is calledis calledaa Boolean expressionBoolean expression.. Example: a+bc is algebraic, a+ab is Boolean.Example: a+bc is algebraic, a+ab is Boolean. (ab+a¶c+bc???)(ab+a¶c+bc???)

Special Properties of Boolean Algebra:Special Properties of Boolean Algebra: a+a = aa+a = a·a = a·a = a

a+bc = (a+b)(a+c)a+bc = (a+b)(a+c)

a+ab = aa+ab = a

TheThe supportsupport of an expressionof an expression f, supp(f),f, supp(f), is the set of is the set of 

variables thatvariables that f f explicitlyexplicitly depends on. Two expressions f depends on. Two expressions f and g are said to beand g are said to be orthogonalorthogonal if supp(f)if supp(f)supp(g)=supp(g)=JJ,,denoted bydenoted by ff BBg.g. Example: a+bExample: a+b BB c+dc+d

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 22/23

ENEE 644 22

 Algebraic and Boolean Factored Forms Algebraic and Boolean Factored Forms

 A factored form A factored form f f is said to beis said to be algebraicalgebraic if theif theSOP expression obtained by multiplyingSOP expression obtained by multiplying f f outout

directlydirectly (I.e. without using aa=a+a=a, aa¶=0, a+ab=a)(I.e. without using aa=a+a=a, aa¶=0, a+ab=a)

is algebraic, otherwise it isis algebraic, otherwise it is BooleanBoolean..

Example:Example: abg+acg+adf+aef+afg+bd+ce+be+cdabg+acg+adf+aef+afg+bd+ce+be+cd

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

=(bd+be+cd+ce)+(df+ef+gf+bg+cg)a=(bd+be+cd+ce)+(df+ef+gf+bg+cg)a

= bd+ce+be+cd+abg+acg+adf+aef+afg= bd+ce+be+cd+abg+acg+adf+aef+afg (algebraic)(algebraic)

(b+c)(d+e+ag)+(d+e+g)af (b+c)(d+e+ag)+(d+e+g)af (algebraic)(algebraic)

(af+b+c)(ag+d+e)(af+b+c)(ag+d+e)

==afagafag+afd+afe+bag+bd+be+cag+cd+ce+afd+afe+bag+bd+be+cag+cd+ce

==afgafg+adf+aef+abg+acg+bd+be+cd+ce+adf+aef+abg+acg+bd+be+cd+ce (Boolean)(Boolean)

8/3/2019 Multi Level Intro

http://slidepdf.com/reader/full/multi-level-intro 23/23

ENEE 644 23

V alue of a FactorizationV alue of a Factorization

Given an algebraic factorizationGiven an algebraic factorization F=GF=G11GG2 2 +R +R , its, itsfactorization valuefactorization value is given by:is given by:fact_val(F,Gfact_val(F,G2 2   ) = lits(F)  ) = lits(F)--(lits( G(lits( G11 )+lits( G )+lits( G2 2  )+lits(R)) )+lits(R))

where lits(F) and cubes(F) are the number of literals andwhere lits(F) and cubes(F) are the number of literals andcubes in SOP form of F respectively, Gcubes in SOP form of F respectively, G11,G,G22, and R are, and R arealgebraic expressions.algebraic expressions.

Example:Example: The algebraic expressionThe algebraic expressionF = ae+af+ag+bce+bcf+bcg+bde+bdf+bdg F = ae+af+ag+bce+bcf+bcg+bde+bdf+bdg 

can be expressed in the formcan be expressed in the form F = (a+b(c+d))(e+f+g)F = (a+b(c+d))(e+f+g),, which requires

7 which requires7

 literals, rather than 24, a save of 17 literals.literals, rather than 24, a save of 17 literals.

If If GG11=(a+bc+bd)=(a+bc+bd) andand GG2 2 =(e+f+g)=(e+f+g),, thenthen R=R= andand fact_val(F,Gfact_val(F,G2 2  ) = ) =2 2 vv3+2 3+2 vv5 =16 5 =16 .. Where the extra literal saving comes from?Where the extra literal saving comes from?