Multilevel Logic Synthesis -- Introduction. ENEE 6442 Multilevel Logic Synthesis: Outline >...

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

Transcript of Multilevel Logic Synthesis -- Introduction. ENEE 6442 Multilevel Logic Synthesis: Outline >...

Multilevel Logic SynthesisMultilevel Logic Synthesis-- Introduction-- Introduction

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 (*)

ENEE 644 3

Multilevel Logic vs. Two-Level LogicMultilevel Logic vs. Two-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).

cc

dda’a’

d’d’

ff

bb

FFF’F’

ee

GG

Multi-Level Implementation:Multi-Level Implementation:

G=F(cd+a’d’)+F’e(f+b)G=F(cd+a’d’)+F’e(f+b) 4-level4-level

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) 5-level5-level

ENEE 644 4

Multilevel Logic vs. Two-Level LogicMultilevel Logic vs. Two-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

ENEE 644 5

Multilevel Logic vs. Two-Level LogicMultilevel Logic vs. Two-Level Logic

Two-level:Two-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: well-developed, feasible.Exact optimization methods: well-developed, feasible. Heuristics.Heuristics.

Multi-level:Multi-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.

ENEE 644 6

Optimization ObjectivesOptimization Objectives

1.1. AreaArea: 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 technology measured 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 simultaneously Optimization is performed while simultaneously satisfying upper/lower bound constraints placed on satisfying upper/lower bound constraints placed on these physical quantities.these physical quantities.

ENEE 644 7

Optimization Cost CriteriaOptimization Cost Criteria

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

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 logic cost can be simply estimated by the number of logic symbols (I.e. one literal = one transistor), delay is the length of the symbols (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) = xy+(x+y)c(x,y,c) = Majority(x,y,c) = xy+(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: xx+yx+y(x+y)c(x+y)cccnewnew

Technology IndependentTechnology 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 logic cost can be simply estimated by the number of logic symbols (I.e. one literal = one transistor), delay is the length of the symbols (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 formula 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.

ENEE 644 9

A design is A design is technology technology dependentdependent if the formula if the formula (function, circuit, system) is (function, circuit, system) is implemented by one or more implemented by one or more logic gates in a pre-designed logic gates in a pre-designed set of gates (called set of gates (called technology technology librarylibrary or or cell librarycell library).).

Advantage: Advantage: gates in the cell library gates in the cell library have a highly optimized, pre-defined have a highly optimized, pre-defined path to silicon, so that the area and path to silicon, so that the area and delay parameters are known and delay parameters are known and accurateaccurate..

ExampleExample: Full Adder: Full Adder

Technology DependentTechnology Dependent

22NOTNOTj’j’ccnewnew

44NORNOR(a+f)’(a+f)’jj

22NOTNOTh’h’ff

44NANDNAND(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

44NANDNAND(xy)’(xy)’gg

transitransistorsstors

gategateformulaformulasignalsignal

ENEE 644 10

Multilevel Logic Synthesis ProblemMultilevel Logic Synthesis Problem

Goal: Goal: Model the multilevel logic Model 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 design Multilevel gives more design freedom and increases the design

complexitycomplexity Technology dependent/independent viewsTechnology dependent/independent views

Models:Models: Algebraic formsAlgebraic 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-based methodsApproximation method: heuristic algorithm, rules-based methods

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). Two-level theory applies.Two-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 progress Difficult to estimate logic and to estimate progress during logic manipulation.during logic manipulation.

ENEE 644 12

Factored Forms: Factored Forms: OverviewOverview

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 complexity

f=ad+ae+bd+be+cd+ce=(a+b+c)(d+e) f=ad+ae+bd+be+cd+ce=(a+b+c)(d+e) f’=a’b’c’+d’e’f’=a’b’c’+d’e’

Good estimator of logic implementation complexity Good estimator of logic implementation complexity Implicitly Imply Multi-Level Computation (Computation Implicitly Imply Multi-Level 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)

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 sum is 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’. This although it equals abc’. This is because internal is because internal complement in not allowedcomplement in not allowed

Another point of view:Another point of view: p p l l (1) (base case)(1) (base case) p p f*ff*f (2)(2) s s ll (3) (base case)(3) (base case) s s f+ff+f (4)(4) f f pp (5)(5) f f ss (6)(6)

ENEE 644 14

Factoring TreeFactoring Tree

Factored forms can be graphically represented Factored forms can be graphically represented as labeled trees, called as labeled trees, called factoring treesfactoring trees, in which , in which each internal node including the root is labeled each internal node including the root is labeled with either with either ++ oror ··, 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

ENEE 644 15

Equivalent FactorizationsEquivalent Factorizations

Two factored forms are Two factored forms are equivalentequivalent if they if they represent 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 are Two factored forms are syntactically equivalentsyntactically equivalent if if their factoring tree are isomorphic. (WHAT IS their factoring tree are isomorphic. (WHAT IS ISOMOSRPHIC?)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

··++

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 two For 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 two For 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

··

ENEE 644 17

Optimum Factored FormsOptimum Factored Forms

The The sizesize of a factored form of a factored form f, f, (f),(f), is the number is the number of literals in the factored form.of literals in the factored form.

Example:Example: ((a+b)ca’) = 4((a+b)ca’) = 4 ((a+b+cd)(a’+b’)) = 6((a+b+cd)(a’+b’)) = 6

A factored form is A factored form is optimumoptimum if no other equivalent if 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).

ENEE 644 18

Unate Factored FormsUnate Factored Forms

A factored form A factored form FF is is positive unatepositive unate in in xx,, if if x x appears in appears in FF, but , but x’x’ does not. A factored form is does not. A factored form is negative unatenegative unate in in xx,, if if x’ x’ appears in appears in FF, but , but x x does does not. F is not. F is unateunate in either case, and is in either case, and is binatebinate if it is if it is not unate.not unate.

Example:Example: (a+b’)c+a’(a+b’)c+a’ is (positive) unate in is (positive) unate in cc, (negative) unate in , (negative) unate in

bb, and binate in , and binate in aa..

ENEE 644 19

Cofactor of Factored FormsCofactor of Factored Forms

The The cofactor of a factored form cofactor of a factored form FF with respect to a literal with respect to a literal xx (or (or x’ x’ ) is the factored form ) is the factored form FFxx= F= Fx=1x=1(x) (x) (or (or FFx’x’=F=Fx=0x=0(x) (x) ) )

obtained by:obtained by: replacing all occurrences of replacing all occurrences of x x by 1, and by 1, and x’ x’ by 0by 0 simplifying the factored form using the Boolean simplifying the factored form using the Boolean

algebra identitiesalgebra identities

1y=y 1+y=1 0y=0 0+y=y1y=y 1+y=1 0y=0 0+y=y after constant propagation (all constants are after constant propagation (all constants are

removed), part of the factored form may appear as removed), part of the factored form may appear as G G + G+ G. In general, . In general, GG is another factored form, and the is another factored form, and the GG’s may have different factored forms.’s may have different factored forms.

ENEE 644 20

Cofactor of Factored FormsCofactor of Factored Forms

The The cofactor of a factored form cofactor of a factored form FF with respect to with respect to a cube a cube cc is a factored form obtained by is a factored form obtained by successively cofactoring successively cofactoring FF with each literal in with each literal in cc..

Example: Example: F = (x+y’+z)(x’u+z’y’(v+u’))F = (x+y’+z)(x’u+z’y’(v+u’)) and and c = vz’c = vz’

FFz’ z’ = (x+y’)(x’u+y’(v+u’))= (x+y’)(x’u+y’(v+u’))

FFz’ v z’ v = (x+y’)(x’u+y’)= (x+y’)(x’u+y’)

ENEE 644 21

Algebraic and Boolean ExpressionsAlgebraic and Boolean Expressions

ff is an is an algebraic expressionalgebraic expression if if f f is a set of cubes (SOP), is a set of cubes (SOP), such that no such that no single cubesingle cube contains another (minimal with contains another (minimal with respect to single cube containment). Otherwise, respect to single cube containment). Otherwise, ff is called is called a a 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

The The supportsupport of an expression of an expression f, supp(f),f, supp(f), is the set of is the set of variables that variables that ff explicitlyexplicitly depends on. Two expressions f depends on. Two expressions f and g are said to be and g are said to be orthogonal orthogonal if supp(f)if supp(f)supp(g)=supp(g)=, , denoted by denoted by ffg.g. Example: a+b Example: a+b c+d c+d

ENEE 644 22

Algebraic and Boolean Factored FormsAlgebraic and Boolean Factored Forms

A factored form A factored form f f is said to be is said to be algebraicalgebraic if the SOP if the SOP expression obtained by multiplying expression obtained by multiplying ff out out directlydirectly (I.e. (I.e.

without using aa=a+a=a, aa’=0, a+ab=a)without using aa=a+a=a, aa’=0, a+ab=a) is algebraic, is algebraic, otherwise it is 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)

ENEE 644 23

Value of a FactorizationValue of a Factorization

Given an algebraic factorization Given an algebraic factorization F=GF=G11GG22+R+R, its , its factorization valuefactorization value is given by: is given by: fact_val(F,Gfact_val(F,G22) = lits(F)-(lits(G) = lits(F)-(lits(G11)+lits(G)+lits(G22)+lits(R)) )+lits(R))

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

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

can be expressed in the form can be expressed in the form F = (a+b(c+d))(e+f+g)F = (a+b(c+d))(e+f+g),, which requires which requires 7 literals, rather than 24, a save of 17 literals.7 literals, rather than 24, a save of 17 literals.

If If GG11=(a+bc+bd)=(a+bc+bd) and and GG22=(e+f+g)=(e+f+g),, then then R=R= and and fact_val(F,Gfact_val(F,G22) = ) = 223+23+25=165=16.. Where the extra literal saving comes from?Where the extra literal saving comes from?