39
Output Grouping Method Output Grouping Method Based on a Similarity Based on a Similarity of Boolean Functions of Boolean Functions Petr Fišer, Petr Fišer, Pavel Kubalík, Pavel Kubalík, Hana Kubátová Hana Kubátová Czech Technical University in Prague Czech Technical University in Prague Department of Computer Science and Engineering Department of Computer Science and Engineering

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

Embed Size (px)

Citation preview

Page 1: 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

Output Grouping Method Output Grouping Method Based on a Similarity Based on a Similarity of Boolean Functionsof Boolean Functions

Petr Fišer, Petr Fišer, Pavel Kubalík,Pavel Kubalík, Hana KubátováHana Kubátová

Czech Technical University in PragueCzech Technical University in PragueDepartment of Computer Science and EngineeringDepartment of Computer Science and Engineering

Page 2: 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

IWSBP'06

OutlineOutline

Output GroupingOutput Grouping Similarity-Based MethodSimilarity-Based Method Experimental ResultsExperimental Results ConclusionsConclusions

Page 3: 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

IWSBP'06

Output GroupingOutput Grouping

MotivationMotivation There is a need to decompose the circuit into There is a need to decompose the circuit into

several stand-alone output-disjoint blocksseveral stand-alone output-disjoint blocks Internal signals cannot be sharedInternal signals cannot be shared Inputs can be sharedInputs can be shared E.g., for PLAs, GALs, …E.g., for PLAs, GALs, …

Page 4: 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

IWSBP'06

Output GroupingOutput Grouping

Motivation:Motivation: Divide the circuit into Divide the circuit into

stand-alone blocksstand-alone blocks Each block produces Each block produces

several outputsseveral outputs

Task:Task: What outputs should be grouped What outputs should be grouped

together into one block, so that together into one block, so that the overall logic is minimized?the overall logic is minimized?

Page 5: 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

IWSBP'06

Similarity-Based Output Similarity-Based Output Grouping MethodGrouping Method

Main principles:Main principles: Based on joining functions (outputs), that are Based on joining functions (outputs), that are

“somehow similar”“somehow similar” Then there should be a big chance that the Then there should be a big chance that the

two functions will share a lot of logicstwo functions will share a lot of logics

The Task:The Task: How to determine the measure of “similarity”?How to determine the measure of “similarity”?

Page 6: 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

IWSBP'06

Similarity-Based Output Similarity-Based Output Grouping MethodGrouping Method

Based on these straightforward observations:Based on these straightforward observations:Two equal functions are “very” similarTwo equal functions are “very” similarTwo inverse functions are very similar too, since they Two inverse functions are very similar too, since they could differ at most by one inverter in the final could differ at most by one inverter in the final (multilevel) design(multilevel) design

Two functions are similar, if a change of a value of Two functions are similar, if a change of a value of one input variable induces a change of values of one input variable induces a change of values of bothboth the functions, or the values of the functions, or the values of bothboth functions do not functions do not change. This should be checked for all possible input change. This should be checked for all possible input variable changes.variable changes.

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

IWSBP'06

MethodMethod

““Two functions are similar, if a change of a value of one Two functions are similar, if a change of a value of one input variable induces a change of values of input variable induces a change of values of bothboth the the functions, or the values of functions, or the values of bothboth functions do not change. functions do not change. This should be checked for all possible input variable This should be checked for all possible input variable changes”changes”

Let us have a completely specified Boolean function Let us have a completely specified Boolean function given by a truth table (by minterms)given by a truth table (by minterms)

For each minterm and each input variable change, For each minterm and each input variable change, observe the change of the two functionsobserve the change of the two functions

If values of both the functions are changed, or the values If values of both the functions are changed, or the values of both the functions unchanged, add 1 to the scoreof both the functions unchanged, add 1 to the score

The complexity can be halved, when only 0->1 changes The complexity can be halved, when only 0->1 changes are consideredare considered

Page 8: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

?How much similar

are these two

Page 9: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 000- Variable: a (0->1)

f1: 0 -> 1f2: 0 -> 0

No score point

Score: 0

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 10: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 000- Variable: b (0->1)

f1: 0 -> 0f2: 0 -> 0

+ 1 score point

Score: 1

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 11: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 000- Variable: c (0->1)

f1: 0 -> 0f2: 0 -> 1

No score point

Score: 1

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 12: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 001- Variable: a (0->1)

f1: 0 -> 1f2: 1 -> 1

No score point

Score: 1

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 13: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 001- Variable: b (0->1)

f1: 0 -> 1f2: 1 -> 1

No score point

Score: 1

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 14: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 010- Variable: a (0->1)

f1: 0 -> 1f2: 0 -> 1

+1 score point

Score: 2

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 15: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 010- Variable: c (0->1)

f1: 0 -> 1f2: 0 -> 1

+1 score point

Score: 3

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 16: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 011- Variable: a (0->1)

f1: 1 -> 1f2: 1 -> 0

No score point

Score: 3

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 17: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 100- Variable: b (0->1)

f1: 1 -> 1f2: 0 -> 1

No score point

Score: 3

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 18: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 100- Variable: c (0->1)

f1: 1 -> 1f2: 0 -> 1

No score point

Score: 3

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 19: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 101- Variable: b (0->1)

f1: 1 -> 1f2: 1 -> 0

No score point

Score: 3

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 20: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1 - Minterm: 110- Variable: c (0->1)

f1: 1 -> 1f2: 1 -> 0

No score point

Score: 3

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 21: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1

Score = 3

abc f1 f2

000 0 0

001 0 1

010 0 0

011 1 1

100 1 0

101 1 1

110 1 1

111 1 0

Page 22: 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

IWSBP'06

MethodMethod

ComplexityComplexity O(O(nn.2.2nn)) Not that good…Not that good…

Page 23: 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

IWSBP'06

Generalization of the MethodGeneralization of the Method

OK, we are counting differences and OK, we are counting differences and indifferences of the function value, when indifferences of the function value, when the input variable value is changedthe input variable value is changed

Boolean differential calculus does exactly Boolean differential calculus does exactly the same work!the same work!

Page 24: 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

IWSBP'06

Generalization of the MethodGeneralization of the Method

““Two functions are similar, if a change of a value of one Two functions are similar, if a change of a value of one input variable induces a change of values of input variable induces a change of values of bothboth the the functionsfunctions, or the values of , or the values of bothboth functions do not change. functions do not change. This should be checked for all possible input variable This should be checked for all possible input variable changeschanges””

),...,0,...,(),...,1,...,(),...,(

000

ninii

n xxxfxxxfx

xxf

Page 25: 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

IWSBP'06

Generalization of the MethodGeneralization of the Method

““Two functions are similar, if a change of a value of one Two functions are similar, if a change of a value of one input variable induces a change of values of input variable induces a change of values of bothboth the the functions, functions, or the values of or the values of bothboth functions do not change. functions do not change. This should be checked for all possible input variable This should be checked for all possible input variable changes”changes”

),...,0,...,(),...,1,...,(),...,(

000

ninii

n xxxfxxxfx

xxf

Page 26: 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

IWSBP'06

Generalization of the MethodGeneralization of the Method Thus, we compute Boolean differences wrt. all input variables for the two functionsThus, we compute Boolean differences wrt. all input variables for the two functions Then their product is computed. This represents cubes, where the change of an input Then their product is computed. This represents cubes, where the change of an input

variable induces a change of values of both functionsvariable induces a change of values of both functions Then we compute Boolean indifferences wrt. all input variables for the two functionsThen we compute Boolean indifferences wrt. all input variables for the two functions Then their product is computed. This represents cubes, where the change of an input Then their product is computed. This represents cubes, where the change of an input

variable induces no change of values of both functionsvariable induces no change of values of both functions The sizes of both these products are computed and summed togetherThe sizes of both these products are computed and summed together

1

0

02010201 ),...,(),...,(),...,(),...,(n

i i

n

i

n

i

n

i

n

x

xxf

x

xxf

x

xxf

x

xxfs

Page 27: 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

IWSBP'06

Generalization of the MethodGeneralization of the Method

AdvantagesAdvantages Since Boolean algebra is involved, any Since Boolean algebra is involved, any

algebraic representation of functions can be algebraic representation of functions can be usedused

Computing the product cubes takes linear Computing the product cubes takes linear time with the number of inputstime with the number of inputs

DisadvantageDisadvantage Well, computing their size is not that easy. Well, computing their size is not that easy.

Exponential time, in fact.Exponential time, in fact.But it’s not that bad in practiceBut it’s not that bad in practice

Page 28: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1

2

..

1

21

2

1

cb

cbbcba

f

a

f

bccbcba

f

cbbcbca

f

00

0. 21

2

1

b

f

b

f

aaccacacab

f

caacab

f

2

.

1

21

2

1

ba

bac

f

c

f

abbaac

f

baabac

f

Boolean differences:

Total size = 4

Page 29: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1

Boolean indifferences:

Total size = 2

00

0..

1

21

2

1

bbca

f

a

f

bccbcba

f

bcbcbca

f

2

. 21

2

1

ca

cab

f

b

f

aaccacacab

f

caacab

f

00

0.

0

21

2

1

c

f

c

f

abbaac

f

baabac

f

Page 30: 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

IWSBP'06

ExampleExample

cbacacabf

bcaf

2

1

Total score = 4 + 2 = 6

Recall that the truth-table based result was 3.

But without considering 1->0 changes, i.e., 6 in fact.

Page 31: 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

IWSBP'06

Scoring MatrixScoring Matrix

When score for all function pairs is computed, the When score for all function pairs is computed, the scoring matrix is constructedscoring matrix is constructed

Symmetric matrix of dimensions (Symmetric matrix of dimensions (mm, , mm), ), where where mm is the number of output variables is the number of output variables

The value in a cell [The value in a cell [ii, , jj] represents the ] represents the scoring function value for outputs scoring function value for outputs ii and and jj

The multi-output function’s outputs are The multi-output function’s outputs are grouped together according the scoring grouped together according the scoring matrix valuesmatrix values

Page 32: 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

IWSBP'06

Scoring MatrixScoring MatrixAlgorithm:Algorithm:

Assign the first output variable to the first block. Since there is no Assign the first output variable to the first block. Since there is no relationship between outputs and blocks yet, it can be freely relationship between outputs and blocks yet, it can be freely done.done.

Find the maximum scoring matrix value, corresponding to Find the maximum scoring matrix value, corresponding to outputs outputs ii and and jj. These outputs should be grouped together, since . These outputs should be grouped together, since their “similarity value” is the highest onetheir “similarity value” is the highest one

If one of these outputs is already assigned to a block, append If one of these outputs is already assigned to a block, append the second one, if possible (maximum number of block’s outputs the second one, if possible (maximum number of block’s outputs is not exceeded)is not exceeded)

If none of them is assigned, try to find an empty block and If none of them is assigned, try to find an empty block and assign both outputs to this blockassign both outputs to this block

If no free block is available, try to put them both into some block.If no free block is available, try to put them both into some block. If there is not enough place to put both the outputs into one If there is not enough place to put both the outputs into one

block, assign them randomlyblock, assign them randomly

Page 33: 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

IWSBP'06

Experimental Results (1)Experimental Results (1)

Decomposition of MCNC benchmark circuitsDecomposition of MCNC benchmark circuits

First, the benchmark circuit has been minimized by First, the benchmark circuit has been minimized by BOOM. This experiment has been done to estimate the BOOM. This experiment has been done to estimate the circuit size when no partitioning is used.circuit size when no partitioning is used.

Then we have divided the circuit into several blocks (Then we have divided the circuit into several blocks (bb), ), while all the output variables were assigned to blocks while all the output variables were assigned to blocks purely at randompurely at random. Then the circuit has been minimized . Then the circuit has been minimized by BOOM. 100 experiments were performed and an by BOOM. 100 experiments were performed and an average value was taken, to ensure good statistical average value was taken, to ensure good statistical values.values.

Finally the our method was used. We have made an Finally the our method was used. We have made an experiment similar to the previously described one, but experiment similar to the previously described one, but the output variables were assigned to the blocks using the output variables were assigned to the blocks using the proposed method.the proposed method.

Page 34: 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

IWSBP'06

Experimental Results (1)Experimental Results (1)

Decomposition of MCNC benchmark circuitsDecomposition of MCNC benchmark circuits

No decomp.

Random output grouping

Similarity-based output grouping

bench i o GEs blocks GEs GEs impr.

al2 16 47 206.5 5 244.0 218.0 10.7%

amd 14 24 334.5 3 460.0 429.0 6.7%

b2 16 17 989.5 4 2018.5 1807.5 10.5%

b7 8 31 81.0 4 105.0 88.5 15.7%

b11 8 31 81.0 4 105.5 87.5 17%

br1 12 8 130.0 3 215.0 186.5 13%

dk17 10 11 70.5 3 84.0 72.5 13.7%

exps 8 38 910.0 4 1473.0 1256.0 14.7%

luc 8 27 162.5 3 244.0 228.0 6.6.%

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

IWSBP'06

Experimental Results (2)Experimental Results (2)

Application to on-line BISTApplication to on-line BIST

C om binationalc ircuit

Inputs

}P arity

predictor

C hecker

circuit

O utputs

codew ord

C heckb its

Page 36: 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

IWSBP'06

Experimental Results (2)Experimental Results (2)

Application to on-line BISTApplication to on-line BIST

The circuit outputs are gradually XORed (by 2), until the The circuit outputs are gradually XORed (by 2), until the required number of parity bits is obtainedrequired number of parity bits is obtained

Synthesis process is conducted after every output XORingSynthesis process is conducted after every output XORing Scoring matrix is recomputed in each step (number of Scoring matrix is recomputed in each step (number of

outputs is decreased by 1)outputs is decreased by 1) The choice of the outputs to be XORed is essential, to The choice of the outputs to be XORed is essential, to

reduce the overall logicsreduce the overall logics

Page 37: 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

IWSBP'06

Experimental Results (2)Experimental Results (2)

Application to on-line BISTApplication to on-line BIST

Main ideas, similar to Similarity-based grouping: When two equal functions XORed, the result will be ‘0’ for all

minterms. If the values of two functions will differ in a couple of minterms only, there will be only several ‘1’ values in the resulting XORed function. That’s good for minimization.That’s good for minimization.

Two inverse functions, when XORed, yield a ‘1’ value for all minterms. If the values of two functions are inverse but a few minterms, there will be only few ‘0’ values in the result. That’s That’s good for minimization.good for minimization.

And, consequently, if two functions are “similar”, there is a big probability that they will share a lot of logic in the implemented design.

Page 38: 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

IWSBP'06

Experimental Results (2)Experimental Results (2)

Circuit Random [GEs] Similarity [GEs] Red.

alu1 967 156 83.9 %

apla 128 76 40.6 %

b11 36 21 41.7 %

br1 80 68 15 %

alu2 418 40 90.4 %

alu3 433 320 26.1 %

s1488 364 241 33.8 %

s386 87 73 16.1 %

Page 39: 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

IWSBP'06

ConclusionsConclusions

A new circuit decomposition and output A new circuit decomposition and output grouping method based on a similarity of grouping method based on a similarity of functions is proposedfunctions is proposed

Its generalization based on Boolean Its generalization based on Boolean difference is showndifference is shown

Experimental results confirm its efficiencyExperimental results confirm its efficiency