algebraic approach to arithmetic design verification

32
artment of Electrical and Computer Engineering M.A. Basith, T. Ahmad, A. Rossi *, M. Ciesielski ECE Dept. Univ. Massachusetts, Amherst * Univ. Bretagne Sud, Lorient France ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

Upload: kane

Post on 21-Jan-2016

34 views

Category:

Documents


0 download

DESCRIPTION

ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION. M.A. Basith, T. Ahmad, A. Rossi *, M. Ciesielski ECE Dept. Univ. Massachusetts, Amherst * Univ. Bretagne Sud, Lorient France. Introduction. Design Verification A dominating factor in design flow Formal Verification - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

Department of Electrical and Computer Engineering

M.A. Basith, T. Ahmad, A. Rossi *, M. CiesielskiECE Dept. Univ. Massachusetts, Amherst

* Univ. Bretagne Sud, Lorient France

ALGEBRAIC APPROACH TO ARITHMETIC DESIGN

VERIFICATION

Page 2: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

2Department of Electrical and Computer Engineering

Introduction Design Verification

• A dominating factor in design flow

Formal Verification• Equivalence checking, model checking, property checking, etc.• Verification of combinational designs – a solved problem• Remains challenging for sequential circuits, but big progress

Verification of Arithmetic Designs and Data-paths• Difficult, bit blasting makes it not scalable

This Work• Verifying functionality of arithmetic designs

• Not exactly EC, but comparing design to a “golden model” (reference signature)

• Using algebraic rather than Boolean or symbolic approach

Page 3: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

3Department of Electrical and Computer Engineering

Related Work

4

10

x0

x1

x2

12

4

y0

y1

y2

21

Canonical representations• BDD, too fine-grained [Bryant’85]• BMD [Bryant’95] and TED [Ciesielski’06], too-low grained

• cannot express output bits as a function of word-level inputs

ILP based Data-path Verification [Brinkmann’02]• Transforms bit-vector expressions into ILP constraints• Cannot handle large designs, variable width limitation

Term rewriting for RTL equivalence checking [Vasudevan’07]• Database of rewrite rules for typical multiplier implementation schemes• Cannot be automated for non-standard implementations

Symbolic Algebra Methods [Shekhar’05]• Solving vanishing polynomial (modulo 2m) using finite ring algebra • Uses Grobner basis, scripting with Maple tools• Cannot handle complex arithmetic designs

Page 4: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

4Department of Electrical and Computer Engineering

Related Work, cont’d.

Arithmetic Bit-Level (ABL) [Wienand CAV’08, Pavlenko DATE’11]

• Represents design as network of HA (ABL)• Creates algebraic expression of Boolean-level information• Requires structural similarity• Complex math, Grobner basis• Can it handle very large designs ?

ABL provided main motivation for our approach• No need for Grobner basis• No need for deriving and manipulating large polynomials• Use only linear expressions

Page 5: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

5Department of Electrical and Computer Engineering

Our Approach

Represent arithmetic design on ABL• Network of gates, HAs and FAs

Write linear equations to represent data flow

Compute algebraic signature of the network

Prove functionality by matching signature with reference signature (specification)

Page 6: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

6Department of Electrical and Computer Engineering

Arithmetic Network Model Half-Adder

• Binary inputs ( a, b) • Binary outputs ( S, C)

Full-Adder• Binary inputs ( a, b , cin)

• Binary outputs ( S, C)

Page 7: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

7Department of Electrical and Computer Engineering

Gate Level Models

x + y = 1

Page 8: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

8Department of Electrical and Computer Engineering

Mathematical Representation

xI - Inputs

xO - Outputs

xS - Internal signals

Network Equations:

Page 9: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

9Department of Electrical and Computer Engineering

Mathematical Representation

xI - Inputs

xO - Outputs

xS - Internal signals

Network Equations:

In matrix form:

A x = bA – m x n constraint matrix (network)

x – n-vector representing signals

b – constant vector

A

x

b

Page 10: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

10Department of Electrical and Computer Engineering

Reference Signature

Functionality provided by userSigI (N) = x1 + x2 + x3 + x4 + x5 + x6 + x7

(input signature)

SigO(N) = 4x8 + 2x9 + x10

(output signature)

Reference SignatureRef(N) = SigO(N) – SigI(N)

= 4x8 + 2x9 + x10 - x1 - x2 - x3 - x4 - x5 - x6 - x7

Page 11: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

11Department of Electrical and Computer Engineering

Reference Signature - definition

Reference Signature, Ref(N) • Provides relationship between input and output variables• Difference between the output signature and input signature

Ref(N) = SigO − SigI

Mathematically

rO – output signature vector xO – primary output vector

rI – input signature vector xI – primary input vector

Page 12: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

12Department of Electrical and Computer Engineering

Reference Signature - exampleReference Signature for a 7-3 counter:

or, equivalently

Output Signature = 3-bit encoding of the output word

Input Signature = sum of the input bits

T

Page 13: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

13Department of Electrical and Computer Engineering

Algebraic SignatureThe network is similarly represented by its Algebraic Signature Algebraic signature, Sig(N)

• Defines relationship between input, output and internal signal variables

(xI xO xS)

• It is a linear combination of x = [xI xO xS]T

where rT = [rI rO rS]

It can be computed directly from matrix A

AT α = rby choosing a linear combination α of rows of matrix A

Goal: • compute α that will eliminate internal variables xS (rS = 0)

• the resulting signature should match the reference signature

Page 14: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

14Department of Electrical and Computer Engineering

Verification Goal Prove that the network (implementation) matches the

specification given by the reference signature.

That is: Given the reference signature Ref(N) (specification) Compute algebraic signature Sig(N) (implementation) Check if Sig(N) = Ref(N) ?

For the network to be correct the two signatures should match

Page 15: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

15Department of Electrical and Computer Engineering

Computing Algebraic Signature

n – total number of signals in the network

m – number of linear equations in the system

A x = b

AI xI + AO xO + AS xS = b

AI – columns associated with xI xI - primary input variables

AO – columns associated with xO xO - primary output variables

AS - columns associated with xS xS - internal signal variables

Page 16: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

16Department of Electrical and Computer Engineering

Computing Algebraic Signature

Algebraic signature Sig(N) relates I/O and internal signals

Sig(N) can be obtained as a linear combination of rows of A that matches Ref(N)

α – vector of integer coefficients that reduces matrix A to signature vector r

Ideally, want rs = 0 (eliminate all internal signals)

0 (ideally)

Page 17: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

17Department of Electrical and Computer Engineering

Completing the Signature If the system is infeasible, relax rS and solve for α

If there is no solution: design is incorrect Otherwise compute rS

If rS = 0, design is correct

What oif rS ≠ 0, is the design incorrect?

Page 18: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

18Department of Electrical and Computer Engineering

Computing Algebraic Signature – example (rs=0)

xI= {x1, x2, x3 ,x4, x5 ,x6, x7}

xO = {x8, x9, x10}

xS = {x11, x12, x13, x14, x15}

A α

r

*

-x1 –x2 –x3 –x4 –x5 –x6 –x7 +4x8 +2x9 +x10

=

α

r

A α

r

Page 19: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

19Department of Electrical and Computer Engineering

Computing Algebraic Signature – example (rs0)

Ref(N)

Sig(N)Network equations:

Residual Expression• rS set to 0, system is infeasible• rS relaxed, gives residual expression

Page 20: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

20Department of Electrical and Computer Engineering

Residual Expression

Residual Expression, RE(N) = Sig(N) − Ref(N) = rST xS

• An expression associated with the internal signals xS

RE(N) should evaluate to zero for the design to be correct• Need additional Boolean constraints

To prove RE = 0, we need additional constraints to impose on N• Structural Constraints

• Caused by fanout of internal signals, equality constraints

• Boolean Constraints• Internal signals of FA, can be propagated in the network

Page 21: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

21Department of Electrical and Computer Engineering

Proving RE = 0 with Boolean constraints

Reference Signature:

Computation of Signature:

Algebraic Signature:

Residual Expression:

Boolean Constraints:

RE(N) = 0

Now Ref(N) = Sig(N): design is correct

Page 22: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

22Department of Electrical and Computer Engineering

Functional Verification Flow

Page 23: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

23Department of Electrical and Computer Engineering

Comparison with SMT Solvers

• Without Boolean constraints, RE ≠ Φ. (MO = out of memory 4GB, TO = timeout after 1800 sec)

• With Boolean constraints, RE = Φ.

Problem can be modeled as SAT Need to show that is unSAT

Page 24: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

24Department of Electrical and Computer Engineering

Results – Large Multipliers

CPU runtime for computing algebraic signature for n-bit integer multipliers with additional constraints propagated in the network.

Page 25: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

25Department of Electrical and Computer Engineering

Results – Booth-encoded Multipliers

CPU runtime for computing algebraic signature for n-bit integer Booth-encoded multipliers with additional constraints propagated in the network.

Complexity: O(N2) in number of gates

Page 26: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

26Department of Electrical and Computer Engineering

Conclusions Developed a new technique for functional verification of

arithmetic circuits based on computing algebraic signature Application

• RTL and gate-level Verification• Given reference signature, system tries to match the signatures

• Equivalence Checking• Comparing two networks on the basis of their signatures

• Property Checking• Represent property P by its algebraic signature, SigP(N) = rT xP

• Check for consistency with reference signature APT α = rP

• Extracting circuit behavior• Use SigO(N) to compute SigI(N)

Limitations: limited to linear networks (Wallace trees, etc.)

Page 27: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

27Department of Electrical and Computer Engineering

Thank You

Page 28: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

28Department of Electrical and Computer Engineering

Outline Introduction and Motivation Related Work Algebraic Modeling of Arithmetic Networks Mathematical Formulation

• Computing the signature• Residual expression and Boolean constraints

Relation to SMT Techniques Results Conclusion and Future Work

Page 29: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

29Department of Electrical and Computer Engineering

Verification Methods Boolean methods

• Good for gate-level designs • Inefficient for arithmetic designs

Decision diagrams and SAT solvers • Requires “bit-blasting” (too low-level for arithmetic)

Symbolic Algebra • Too high level: limited to polynomial expressions or infinite precision

SMT• Generalization of Boolean SAT• Lack of adequate models to handle arithmetic designs

This Work• Functional verification of arithmetic circuits by computing algebraic signature

Page 30: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

30Department of Electrical and Computer Engineering

Related Work - Summary Decision diagrams and Boolean SAT

• Not able to handle arithmetic functions efficiently

ILP Methods• Computationally prohibitive for large designs

Symbolic Algebra• Limited to small designs that can be represented as polynomials

ABL Methods• Assumes structural similarity, which is often absent• Uses Grobner basis (overkill ?)

Our Method• No assumption about structural similarity• Handles arithmetic on bit-level using algebra• Fast and scalable (but limited to linear networks)

Page 31: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

31Department of Electrical and Computer Engineering

Complexity Graph

Computational complexity of our approach

Complexity:O(N2)

Page 32: ALGEBRAIC APPROACH TO ARITHMETIC DESIGN VERIFICATION

32Department of Electrical and Computer Engineering

Future Work Need to learn additional Boolean Constraints

• Is this problem as difficult as the original one? Data-Path Verification

• Obtain a reference signature for the entire data-path• Partition design into smaller blocks

Debugging• Identify bugs in the circuit• Analyze Simplex phase I (pre-solver) of the LP solver

• If LP is infeasible, non-zero values of variables provide information which equations prevent the LP from being feasible

• If LP is feasible, but RE cannot be reduced to zero, content of RE will be used to reason about bugs