taylor expansion diagrams: a compact canonical representation for symbolic verification
DESCRIPTION
Taylor Expansion Diagrams: A Compact Canonical Representation for Symbolic Verification. M. Ciesielski, P. Kalla, Z. Zeng B. Rouzeyre Electrical & Computer Engineering LIRMM University of Massachusetts, Amherst, USAMontpellier, France [email protected]@lirmm.fr. - PowerPoint PPT PresentationTRANSCRIPT
DATE-2002 TED 1
Taylor Expansion Diagrams:A Compact Canonical Representation
for Symbolic Verification
M. Ciesielski, P. Kalla, Z. Zeng B. RouzeyreElectrical & Computer Engineering LIRMMUniversity of Massachusetts, Amherst, USA Montpellier, [email protected] [email protected]
DATE-2002 TED 2
Outline
• Motivation – RTL verification• Background
– BDD (binary), BMD (word-level)• New canonical representation: TED
– Construction and manipulation– Properties – Applications
• Conclusions– Limitations, future work
DATE-2002 TED 3
Motivation – RTL Verification
• Complex RTL designs– Data flow and control– Arithmetic and Boolean
BA
s
10
F
Dak
bk
>
+*-
BA
s
01
F
Dak
bk
<=
+*-
• Equivalence verification– Need representation that can
handle arithmetic/Boolean• Efficient, compact• Canonical
DATE-2002 TED 4
Common Representations
• Boolean functions ( f : B B )– Truth table, Karnaugh map– SoP, PoS, ESoP, Reed-Muller, etc.– Binary Decision diagrams (BDD, ZDD, KFDD, …)
• Arithmetic functions ( f : B Int )– Binary Moment Diagrams (*BMD, K*BMD, …)– Multi-terminal, Algebraic Decision Diagrams (ADD)
• Need more abstract representation for arithmetic functions (f : Int Int )
DATE-2002 TED 5
Binary Decision Diagrams (BDD)
• Based on recursive Shannon expansion: f = x fx + x’ fx’
where: fx = f(x=1), fx’=f(x=0)
• Compact data structure for Boolean logic• Canonical representation
– reduced ordered BDDs (ROBDD)• Essential for verification
– equivalence checking, satisfiability (SAT)
fxfx’
f x
DATE-2002 TED 6
Application to Verification• Canonicity: equivalence checking of logic circuits
10
a
b
c
F = a’bc + abc +ab’c G = (a+b)c
10
a
b
c
• Limitations– Require bit-level expansion of word-level variables– Size explosion for some functions (arithmetic)
DATE-2002 TED 7
Binary Moment Diagrams (BMD)
• Devised for word-level, arithmetic operations• Based on modified Shannon expansion (pos. Davio)
f = x fx + x’ fx’ = x fx + (1-x) fx’ = fx’ + x (fx - fx’ ) = fx’ + x fx
where fx’ = fx=0 is zero moment
f x = (fx - fx’ ) is first moment (derivative)
DATE-2002 TED 8
BMD – Example• Unsigned integer: X = 8x3 + 4x2 + 2x1 + x0
10
x0
x1
x2
1
2
4
x3
8
*BMDx3
8
x2
x1
x0
4210
BMD
DATE-2002 TED 9
*BMD• Efficiently models word-level operators
4
10
x0
x1
x2
12
4
y0
y1
y2
21
X YX + Y
10
x0
x1
x2
y0
y1
y2
12
4
24
1
• Limitation: requires bit-level representation of a word
DATE-2002 TED 10
Symbolic Representation• Why expand words into bits? Can we do better?
– Abstract words into symbolic variables
Word level
4
10
x0
x1
x2
12
4
y0
y1
y2
21
X + Y
10
X
Y
Symbolic
X Y
10
X
Y
Symbolic10
x0
x1
x2
y0
y1
y2
12
4
24
1
Word level
DATE-2002 TED 11
Taylor Expansion Diagram (TED)• F = arithmetic function (F : Int Int )
– Treat F as a continuous function
– Taylor Expansion (around x=0):
F(x) = F(0) + x F’(0) + ½ x2 F’’(0) + …• Notation
– F0(x) = F(x=0) 0-child - - - - - -
– F1(x) = F’(x=0) 1-child ----------– F2(x) = ½ F’’(x=0) 2-child ======– etc.
x
F0(x) F1(x) F2(x) …
F(x)
F(x) = F0(x) + x F1(x) + x2 F2(x) + …
DATE-2002 TED 12
Construction - Your First TEDF = A2B + 2C + 3A F0(A) = F|A=0 = 2C + 3
F1(A) = F’|A=0 = 2AB|A=0 = 0
F2(A) = ½ F’’|A=0 = B
B
1
A
G= 2C + 3
0
B0 = B(0) = 0
B1=B’ = 1
C G0(C) = (2C+3)|C=0 = 3
G1(C) = (2C+3)’ = 2
C
23
BB
(without normalization)
DATE-2002 TED 13
TED – a few Examples
(A+B)C +1
10
B
C
A
1
(A+B)(A+2C)
10
B
C
A
B
1
2
1
x0
x1
x2
x3
2
4
1
0
1x0
x1
x2
1
1
1
44
816
16
64
11
X2 = (8x3 + 4x2 + 2x1 + x0)2
DATE-2002 TED 14
TED - Reduction Rules
a
b 0
f
gb g
1. Eliminate redundant nodes:– Nodes with all edges 0– Nodes with only constant term
A
B
C
10 0 11
BB
CC
6 51
A
B
C
01
6 5 12. Merge isomorphic subgraphs
(A2 + 5A + 6)(B + C)
f = 0 a2 + 0 a + g(b) = g(b)
DATE-2002 TED 15
TED Normalization• TED can be normalized
– weights of edges of a given node must be relatively prime (to allow sharing isomorphic graphs)
26
B
A
2
2A + 2B + 6
3
0
B
A
1
2
2
1 3
B
A
1
2
11
2(A + B + 3)
DATE-2002 TED 16
TED: Composition
• Operation depends on relative order of variables x, y – if x = y, then z = x, and
h(x) = f(x) OP g(x) = f0(x) OP g0(y) + x [f1(x) OP g1(y)] + x2 [f2(x) OP g2], …
– if x > y, then z = x, and h(x) = f0(x) OP g(y) + x [f1(x) OP g(y)] + x2 [f2(x) OP g], …
– else ….
u
f
x v
g
yOP =
• Recursive composition of nodes, starting at the top
h = f OP gqz
OP = (+, - , •)
DATE-2002 TED 17
COMPOSE Operator – ADD/SUB• Nodes indexed by same variable
• Nodes indexed by different variable (x > y)
u
u0 u1
x v
v0 v1
x+ =
u
u0 u1
x v
v0 v1
y+ =
u + v
u0+v0 u1+v1
x
u + v
u0+ v
x
u1
DATE-2002 TED 18
COMPOSE Operator – MULT• Nodes indexed by same variable
• Nodes indexed by different variable (x > y)
u
u0 u1
x v
v0 v1
x• =
u
u0 u1
x v
v0 v1
y• = u • v
u0 • v u1 • v
x
u • v
u0•v0
x
u0•v1+u1•v0
u1•v1
DATE-2002 TED 19
COMPOSE Operation - Example
*
A+B
0 1
4
3
A
B = 3•5
4•6A
0•5
C
A+2C
0 1
6
5
A
21•5
B
0•0 0•2 1•0 1•2
C C1•5
1•0 1•2
+
1•1
B3•1
0•1 1•1
C
0
7
2
B
0
8
1
+=0+7
8+7B
0+0 0+2 1
C
(A+B)(A+2C)
20 1
C
A
B B
2
DATE-2002 TED 20
Properties of TED
• Canonical• Compact• Linear for polynomials of
arbitrary degree– TED for Xk, k = const, with
n bits, has k(n-1)+1 nodes.
• Can contain symbolic, word-level, and Boolean variables
• It is not a Decision Diagram 1
x0
x1
x2
x3
2
4
1
0
1x0
x1
x2
1
1
1
44
816
16
64
11
X2=(8x3+4x2+2x1+x0)2
n = 4, k = 2
DATE-2002 TED 21
TED for Boolean logic
AND
10
x
y
x y = x y
10
x1 -1
x’ = (1-x)
NOTOR
x y = (x + y – x y)
10
x
yy-1
1
XOR
x
10
yy-2
1
x y = (x + y – 2 x y)
• Needed to model arithmetic-Boolean interface
DATE-2002 TED 22
TED for Arithmetic Circuits• Arithmetic circuits contain related word-level (A, B) and
Boolean (ak, bk) variables
A = [ an-1, …, ak , …,a0 ] = 2(k+1)Ahi + 2k ak + Alo
BA
s1
10
F1
Dak
bk
>
+*-
s1 = ak (1-bk)
Ahi Alo
0 1
2k
2(k+1)
Ahi
ak
Alo
DATE-2002 TED 23
Applications to RTL Verification
• Equivalence checking with TEDs– interacting word-level and Boolean variables
A
B
s2
01
F2
bk
ak
*
*-
D
BA
s1
10
F1
Dak
bk
>
+*-
F1 = s1(A+B)(A-B) + (1-s1)Ds1 = (ak > bk) = ak (1-bk)
F2 = (1-s2) (A2-B2) + s2 Ds2 = ak’ bk = 1 - ak + ak bk
A = [Ahi,ak,Alo], B = [Bhi,bk,Blo]
DATE-2002 TED 24
RTL Verification – Result
• Related word-level and Boolean variables F1 = s1(A+B)(A-B) + (1-s1)D s1 = (ak > bk) = ak (1-bk)
F1 = (ak-akbk){ (2k+1Ahi + 2kak +Alo)2
- (2k+1Bhi + 2k bk + Blo)2 } + (1–ak + akbk) D
1
ak
1
Ahi
D
ak
bk bk
Bhi
Alo
Blo
1
122k+2
2k+2
-2k+
2
2k
-2 2k+2
-1-1
F1 = F2
Alo
2k
2 k+10
DATE-2002 TED 25
Conclusions• TED representation, features
– Canonical– Compact (linear for polynomials)– Represents arithmetic (word-level) operators + Boolean logic
• Applications– Equivalence checking, symbolic simulation
• Limitations– TED still needs to be implemented: efficiency, robustness?– How to represent relations (X < Y) without bit expansion?– Normalization: more complicated than in *BMD– Infinite series for some functions (ax)
• Open problems– Application to satisfiability (SAT), functional test generation