Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

31
Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung ALCom Lab Grad. Inst. of Electronics Engineering National Taiwan University 111/06/15 DAC 1 m

description

Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab Grad. Inst. of Electronics Engineering National Taiwan University. Outline. Introduction Prior Work and Preliminaries Main Algorithms Experimental Results Conclusions and Future work. Introduction. - PowerPoint PPT Presentation

Transcript of Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Page 1: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Ruei-Rung Lee, J.-H. Roland Jiang, and Wei-Lun Hung

ALCom LabGrad. Inst. of Electronics EngineeringNational Taiwan University

112/04/22 DAC 1

m

Page 2: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

OutlineIntroductionPrior Work and PreliminariesMain AlgorithmsExperimental ResultsConclusions and Future work

2

Page 3: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

IntroductionBi-decomposition is a special kind of functional

decompositionFunctional decomposition

Break a large function into a network ofsmaller functions

Reduce circuit and communication complexityand thus simplify physical design

Bi-decomposition plays an important role in logic synthesis for restructuring Boolean networks

3

Page 4: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

OutlineIntroductionPrior Work and PreliminariesMain AlgorithmsExperimental ResultsConclusions and Future Work

4

Page 5: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Closest Prior Work[Mishchenko et al., 01]

BDD-based approachTwo main limitations

Memory explosion problem Decomposability is checked under a fixed variable partition

5

Page 6: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Preliminaries: Bi-decomposition

6

ff

A

f B

h

XA XB XC

XBXC

Bi-decompose

XA

Page 7: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Preliminaries:Variable PartitionA set X = {XA|XB|XC} is a partition

meaning XA , XB , XC are pair-wise disjoint and XA∪ XB∪ XC = X

If XC = ψ, we have disjoint

bi-decomposition ; otherwise, non-disjoint

7

f

A

f B

h

XA XBXC

Page 8: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

P

Preliminaries: Craig InterpolationGiven φA and φB are Boolean formulas, if φA ∧ φB

is unsatisfiable, then there exists anotherBoolean formula P with the following properties:φA → PP∧ φB is unsatisfiableP refers only to the common variables of φA and φB

8

φAφB

Page 9: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

OutlineIntroductionPrior Work and PreliminariesMain AlgorithmsExperimental ResultsConclusions and Future Work

9

Page 10: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Bi-decomposition CasesWe consider OR, AND, XOR bi-decompositions

These three cases are enough to generate any other type of bi-decomposition

10

a b a+b ab a⊕b a(¬b)0 0 0 0 0 00 1 1 0 1 01 0 1 0 1 11 1 1 1 0 0

Page 11: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Disjoint OR Bi-decompositionDisjoint: the common

variable set Xc is empty.E.g.

f(a,b,c,d) = (¬a)b+cd

X = {a,b,c,d}={XA|XB}

XA= {a,b}, XB= {c,d}

f(X) = (¬a)b+cd

= fA(a,b)+fB(c,d)

XB\XA00 01 11 10

00 0 1 0 0

01 0 1 0 0

11 1 1 1 1

10 0 1 0 0

fA(XA) 0 1 0 0

fB(XB)0010

f

A

f B

OR

XA XB

11

Page 12: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Bi-decomposabilityUnder what condition can f(X)

be written as fA(XA)∨ fB(XB) ?The necessary and sufficient

condition: For every 1-entry,no 0-entries can appear simultaneously in the corresponding rowand column

f(1101) = 0 = fA(11) +fB(01)

f(0010) = 0 = fA(00) +fB(10)

f(1110) = 1 = fA(11) +fB(10)??

XB\XA00 01 11 10

00 0 1 0 0

01 0 1 0 0

11 1 1 1 1

10 0 1 0 0

12

fB(XB)0010

fA(XA) 0 1 0 0

XB\XA00 01 11 10

00 0 1 0 0

01 0 1 0 0

11 1 1 1 1

10 0 1 1 0

fA(XA) 0

fB(XB)

0

Page 13: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

SAT-based Bi-decomposability ∃ fA, fB such that f(X) = fA(XA) ∨ fB(XB)

⇔ For every 1-entry, no 0-entries can appear simultaneously in the corresponding row and column ⇔ f(XA,XB) ¬∧ f(XA’,XB) ¬∧ f(XA,XB’) is unsatisfiable

XB\XA00 01 11 10

00 0 1 0 0

01 0 1 0 0

11 1 1 1 1

10 0 1 1 0

fA(XA) ? ? ? ?

fB(XB)????

XA

XB

XA’

XB’

13

Page 14: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Non-disjoint Bi-decomposition ∃ fA, fB such that f(X) = fA(XA,XC) ∨ fB(XB,XC)

⇔ Under every valuation of XC, for every 1-entry, no 0-entries can appear simultaneously in the corresponding row and column ⇔ f(XA,XB,XC) ¬∧ f(XA’ ,XB,XC) ¬∧ f(XA,XB’ ,XC)is unsatisfiable

XC=00 XAXB XC=01 XA

XB XC=10 XAXB XC=11 XA

XB

14

Page 15: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

OR Bi-decomposition ∃ fA, fB such that f(X) = fA(XA,XC) ∨ fB(XB,XC)

⇔ f(XA,XB,XC) ¬∧ f(XA’ ,XB,XC) ¬∧ f(XA,XB’ ,XC)

is unsatisfiable Two problems remain to be solved

How to derive fA and fB? How to partition X into XA, XB, XC?

15

Page 16: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

How to derive fA?

f(XA,XB,XC) ¬∧ f(XA’ ,XB,XC) ¬∧ f(XA,XB’ ,XC) is UNSAT

16

f ff

XA XB

XA’ XB’

XC

1 00Onset of fA

Offset of fA

φA φB

•φA ∧ φB is UNSAT1.φA → P2.P∧ φB is UNSAT3.P refers only to the common variables of φA,φB

φA φB

Page 17: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

How to derive fB?Let ¬fA be the care condition of fB

f(XA,XB,XC) ¬∧ fA(XA,XC) ¬∧ f(XA’ ,XB,XC) is UNSAT

17

fA ff

XA XB XA’ XC

1 00Onset of fB

Offset of fB

φAφB

Page 18: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

How to partition X into XA,XB,XC?

φA =

φB =

18

f ff

XA XB

XA’ XB’

XC

1 00

f’ f”fX”

1 00

X X’

(αxi,βxi

) =(0,1) (αxi,βxi

) =(1,0) (αxi,βxi

) =(0,0)

(αxi,

βxi)

xi belongs to

(0,0) XC

(0,1) XB

(1,0) XA

(1,1) either XA or XB

Page 19: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

How to partition X into XA,XB,XC?

We make unit assumption of MiniSat on the control variablesAssume all the control variables are 0SAT solver will return a conflict clause consisting of only the

control variablesThe conflict clause corresponds to a variable partition

E.g.

Conflict clause (αx1+βx1

+αx2+βx3

) indicates the unit assumption αx1

=0,βx1=0,αx2

=0,andβx3=0 causes

unsatisfiability. So x1∈XC, x2∈XB, and x3∈XA

19

Page 20: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Avoid Trivial Variable Partition Bi-decomposition trivially holds if XC, XA∪ XC, or

XB∪ XC equals X SAT solver may return a conflict clause that consists of

all the control variables ⇒ XC = X

To avoid these trivial partitions, as unit assumption we specify two distinct variables xa and xb to be in XA and XB, respectively, and all other variables in XC To check if a function is bi-decomposable, we have to

try at most C(n,2) iterations

20

Page 21: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

AND Bi-decomposition∃ fA, fB such that f=fA ∧ fB ⇔ ∃ fA, fB such that ¬f=¬fA ∨

¬fB

E.g.

f (a,b,c,d) = (a+¬b+c)(b+¬c+d)

¬f (a,b,c,d) = (¬a)b(¬c) ∨ (¬b)c(¬d)

= ¬fA(a,b,c) ∨ ¬fB (b,c,d)

fA (a,b,c)= (a+¬b+c), fB (b,c,d) = (b+¬c+d)

f (a,b,c,d) = fA(a,b,c) ∧ fB (b,c,d)

21

Page 22: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

XOR Bi-decomposition(1)=(5)⊕ (7), (2)=(5)⊕ (8),(3)=(6)⊕ (7), (4)=(6)⊕ (8)

⇒ (1)⊕ (4)=(2)⊕ (3)⇒ (1)⊕ (2)=(3)⊕ (4)⇒ [(1)≡(2)]∧ [(3)≠(4)] UNSAT

22

XA’ XA

XB\XA 00 01 11 10

00

XB’ 01 (1) (3)

11

XB 10 (2) (4)

fA f B

XOR

XA XBXC

fB(XB

)

(7)

(8)fA(XA) (5) (6)

Page 23: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

XOR Bi-decomposability [(1)≡(2)]∧ [(3)≠(4)] UNSAT ∃ fA, fB such that f(X) = fA(XA,XC)⊕ fB(XB,XC) ⇔

(f(XA,XB,XC)≡f(XA,XB’,XC))∧ (f(XA’,XB,XC)≠f(XA’,XB’,XC) ) UNSAT

For every pair of columns (rows), their patterns are either complementary or identical to each other

23

XA,X

c

XA’,Xc

XB\XA 00 01 11 10

00

XB,Xc 01 (1) (3)

11

XB’,Xc 10 (2) (4)

≡ ≠

XB\XA 00

00 1

01 0

11 0

10 1

11

1

0

0

1

01

0

1

1

0

10

1

0

0

1

Page 24: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

How to derive fA and fB?fA = f(XA,0,XC)fB = f(0,XB,XC) f(0,0,⊕ XC)

24

Xc

XB\XA00 01 11 10 fB(XB,Xc)

00 1 0 1 1 1

01 0 1 0 0 0

11 0 1 0 0 0

10 1 0 1 1 1

fA(XA,Xc) 1 0 1 1

Xc

XB\XA00 01 11 10 fB(XB,Xc)

00 1 0 1 1 0

01 0 1 0 0 111 0 1 0 0 110 1 0 1 1 0

fA(XA,Xc) 1 0 1 1

Page 25: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

How to partition X into XA,XB,XC?

Similar to that in OR bi-decomposition (f(X)≡f(X’))∧ (f(X”)≠f(X”’))∧

(((xi≡xi”)∧ (xi’≡xi”’))∨ αxi)

∧ (((xi≡xi’)∧ (xi”≡xi”’))∨ βxi)

25

(αxi, βxi

) Xi belongs to

(0,0) XC

(0,1) XB

(1,0) XA

(1,1) either XA or XB

Page 26: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Outline Introduction Prior Work and Preliminaries Main Algorithms Experimental Results Conclusions and Future Work

26

Page 27: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Experimental Results

OR2-decomposition XOR-decomposition

circuit #in #max #out #dev #slv Time(sec)

Mem(Mb)

#dev #slv Time(sec)

Mem(Mb)

i2 201 201 1 1 1 1.07 18.6 1 34 2.16 18.59

s6669c 322 49 294 101 24423 198.14 29.13 176 3120 279.03 22.87

Dalu 75 75 16 1 26848 352.87 24.14 16 210 26.59 19.68

C880 60 45 26 16 222 8.36 20.72 11 4192 83.08 18.72

27

Page 28: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Experimental Results

28

Variable partition

OR2-decomposition XOR-decomposition

Page 29: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Outline Introduction Prior Work and Preliminaries Main Algorithms Experimental Results Conclusions and Future Work

29

Page 30: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Conclusions and Future WorkConclusions

We formulated OR, AND, XOR bi-decomposition in terms of SAT solving

We automated the process of variable partitioningExperimental results showed we can bi-decompose

large Boolean functionsFuture Work

We will study how to effectively enumerate better variable partition

30

Page 31: Ruei-Rung Lee , J.-H. Roland Jiang, and Wei-Lun Hung A L C om Lab

Thank You

31