Equivalence Verification of Polynomial Datapaths with Fixed-Size Bit-Vectors using Finite Ring Algebra Namrata Shekhar, Priyank Kalla, Florian Enescu,

Slides:



Advertisements
Similar presentations
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
Advertisements

Mathematics of Cryptography Part II: Algebraic Structures
Cryptography and Network Security
ECE Synthesis & Verification 1 ECE 667 Synthesis and Verification of Digital Systems Formal Verification Combinational Equivalence Checking.
FPGA Latency Optimization Using System-level Transformations and DFG Restructuring Daniel Gomez-Prado, Maciej Ciesielski, and Russell Tessier Department.
1 Don´t Care Minimization of *BMDs: Complexity and Algorithms Christoph Scholl Marc Herbstritt Bernd Becker Institute of Computer Science Albert-Ludwigs-University.
Weizmann Institute Deciding equality formulas by small domain instantiations O. Shtrichman The Weizmann Institute Joint work with A.Pnueli, Y.Rodeh, M.Siegel.
Class Presentation on Binary Moment Diagrams by Krishna Chillara Base Paper: “Verification of Arithmetic Circuits using Binary Moment Diagrams” by.
Department of Electrical and Computer Engineering M.A. Basith, T. Ahmad, A. Rossi *, M. Ciesielski ECE Dept. Univ. Massachusetts, Amherst * Univ. Bretagne.
Cryptography and Network Security Chapter 4
DATE-2002TED1 Taylor Expansion Diagrams: A Compact Canonical Representation for Symbolic Verification M. Ciesielski, P. Kalla, Z. Zeng B. Rouzeyre Electrical.
Cryptography and Network Security Chapter 4 Fourth Edition by William Stallings.
Research Interests, Projects, Collaborations & Opportunities Priyank Kalla Electrical & Computer Engineering University of Utah.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
ECE Synthesis & Verification - Lecture 18 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Word-level.
Introduction to Gröbner Bases for Geometric Modeling Geometric & Solid Modeling 1989 Christoph M. Hoffmann.
Algebraic numbers I Based on Burnikel, Fleischer, Mehlhorn, Schirra article: A Strong and Easily Computable Separation Bound for Arithmetic Expressions.
Taylor Expansion Diagrams (TED): Verification EC667: Synthesis and Verification of Digital Systems Spring 2011 Presented by: Sudhan.
Richard Fateman CS 282 Lecture 2c1 Basic Extensions for Computer Algebra System Domains Lecture 2c.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
1 High-Level Design Verification using Taylor Expansion Diagrams: First Results Priyank Kalla ECE Department University of Utah Maciej Ciesielski ECE Department.
By Tariq Bashir Ahmad Taylor Expansion Diagrams (TED) Adapted from the paper M. Ciesielski, P. Kalla, Z. Zeng, B. Rouzeyre,”Taylor Expansion Diagrams:
Gröbner Bases Bernd Sturmfels Mathematics and Computer Science University of California at Berkeley.
A POLYNOMIAL is a monomial or a sum of monomials.
FINITE FIELDS 7/30 陳柏誠.
CPSC 3730 Cryptography and Network Security
Polynomial Datapaths Optimization Using Finite Abstract Algebra(I) Presenter: 陳炳元 Graduate Institute of Electronics Engineering Graduate Institute of Electronics.
The Common Core Comes to Arkansas or Teaching the New Algebra I Saturday January 29, :15-11:45 a.m. - Room 2506 David A. Young T 3 National Instructor.
Cryptography and Network Security Introduction to Finite Fields.
MATH – High School Common Core Vs Tested Kansas Standards Please note: For informational purposes, all Common Core standards are listed, and the tested.
Slide Chapter 2 Polynomial, Power, and Rational Functions.
Copyright © 2014, 2010 Pearson Education, Inc. Chapter 2 Polynomials and Rational Functions Copyright © 2014, 2010 Pearson Education, Inc.
Electrical and Computer Engineering Muhammad Noman Ashraf Optimization of Data-Flow Computations Using Canonical TED Representation M. Ciesielski, D. Gomez-Prado,Q.
Cyclic Codes for Error Detection W. W. Peterson and D. T. Brown by Maheshwar R Geereddy.
Key Concept 1. Example 1 Leading Coefficient Equal to 1 A. List all possible rational zeros of f (x) = x 3 – 3x 2 – 2x + 4. Then determine which, if any,
Chapter 3 Section 3.3 Real Zeros of Polynomial Functions.
Algebraic Techniques To Enhance Common Sub-expression Extraction for Polynomial System Synthesis Sivaram Gopalakrishnan Synopsys Inc., Hillsboro, OR –
Chapter 4 – Finite Fields
Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths Namrata Shekhar, Priyank Kalla, Florian Enescu, Sivaram.
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
Verification & Synthesis of Arithmetic Datapaths using Finite Ring Algebra Priyank Kalla Priyank Kalla Electrical and Computer Engineering University of.
SIMULATION BOUNDS FOR EQUIVALENCE VERIFICATION OF ARITHMETIC DATAPATHS WITH FINITE WORD-LENGTH OPERANDS Namrata Shekhar, Priyank Kalla, M. Brandon Meredith.
Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths GIEE, NTU ALCom Lab Presenter: 陳炳元.
Warm Up Simplify the following x + 2x x + 2 – 3x Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 1.
Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths GIEE, NTU ALCom Lab Presenter: 陳炳元.
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
Copyright © 2011 Pearson Education, Inc. Slide Partial Fractions Partial Fraction Decomposition of Step 1If is not a proper fraction (a fraction.
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Date: 2.4 Real Zeros of Polynomial Functions
A Decomposition Algorithm to Structure Arithmetic Circuits Ajay K. Verma, Philip Brisk, Paolo Ienne Ecole Polytechnique Fédérale de Lausanne (EPFL) International.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Verifying Programs with BDDs Topics Representing Boolean functions with Binary Decision Diagrams Application to program verification class-bdd.ppt
Test complexity of TED operations Use canonical property of TED for - Software Verification - Algorithm Equivalence check - High Level Synthesis M ac iej.
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Polynomial, Power, and Rational Functions.
Real Zeros of Polynomial Functions
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Page : 1 bfolieq.drw Technical University of Braunschweig IDA: Institute of Computer and Network Engineering  W. Adi 2011 Lecture-5 Mathematical Background:
3.3 Dividing Polynomials.
Algebra Vocabulary.
Mathematical Background: Extension Fields
Polynomials.
Created by Mr. Lafferty Maths Dept.
ECE 667 Synthesis and Verification of Digital Systems
LPSAT: A Unified Approach to RTL Satisfiability
Spectral Approach to Verifying Nonlinear Arithmetic Circuits
Cryptology Design Fundamentals
Mathematical Background: Extension Finite Fields
Presentation transcript:

Equivalence Verification of Polynomial Datapaths with Fixed-Size Bit-Vectors using Finite Ring Algebra Namrata Shekhar, Priyank Kalla, Florian Enescu, Sivaram Gopalakrishnan Namrata Shekhar 1, Priyank Kalla 1, Florian Enescu 2, Sivaram Gopalakrishnan 1 1 Department of Electrical and Computer Engineering, University of Utah, Salt Lake City, UT Department of Mathematics and Statistics, Georgia State University, Atlanta, GA-30303

Outline  Overall Verification Problem Our Focus: Equivalence Verification of Fixed-size Arithmetic DatapathsOur Focus: Equivalence Verification of Fixed-size Arithmetic Datapaths  Problem Modeling Polynomial Functions over Finite Integer RingsPolynomial Functions over Finite Integer Rings  Limitations of Previous Work  Approach and Contributions Canonical form for Polynomials over Finite RingsCanonical form for Polynomials over Finite Rings  Algorithm Design and Experimental Verification Runs  Results, Conclusions & Future Work

The Equivalence Verification Problem

Motivation  Quadratic filter design for polynomial signal processing  y = a 0. x a 1. x 1 + b 0. x b 1. x 0 + c. x 0. x 1

Fixed-Size (m) Data-path: Modeling   Control the datapath size: Fixed size bit-vectors ( m ) * * 8-bit 16-bit 32-bit * * 8-bit  Bit-vector of size m : integer values in 0,…, 2 m -1 Fixed-size (m) bit-vector arithmetic Polynomials reduced %2 m Algebra over the ring Z 2 m

Fixed-Size Data-path: Implementation   Signal Truncation Keep lower order m-bits, ignore higher bits f % 2 m ≡ g % 2 m   Fractional Arithmetic with rounding Keep higher order m-bits, round lower order bits f - f %2 m ≡ g - g%2 m 2 m 2 m   Saturation Arithmetic Saturate at overflow Used in image-processing applications

Example: Anti-Aliasing Function   F = 1 = 1 = 2√a 2 + b 2 2√x [Peymandoust et al, TCAD‘03]   Expand into Taylor series F ≈ 1 x 6 – 9 x x – 75 x x 2 – 81 x   Scale coefficients; Implement as bit-vectors MAC x = a 2 + b 2 coefficients ab x F DFF

Example 1: Anti-Aliasing Function   F 1 [15:0], F 2 [15:0], x[15:0]   F 1 = 156x x x x x x   F 2 = 156x x x x x x   F 1 ≠ F 2 ; F 1 [15:0] = F 2 [15:0]   To Prove: F 1 % 2 16 ≡ F 2 % 2 16 F 1 ≡ F 2 in Z 2 m [x 1, …, x d ]

Previous Work: Function Representations   Boolean Representations ( f: B → B ): BDDs, ZBDDs etc.   Moment Diagrams ( f: B → Z ): BMDs, K*BMDs, HDDs etc.   Canonical DAGs for Polynomials ( f: Z → Z ) Taylor Expansion Diagrams (TEDs)   Required: Representation for f: Z 2 m → Z 2 m   SAT, MILP, Word-level ATPG, …   Theorem-Proving (HOL), term-rewriting Works when datapath size can be abstracted away

Previous Work: Symbolic Algebra   Symbolic Algebra Tools: Singular, Macaulay, Maple, Mathematica, Zen, Dagwood etc. Polynomial representations: Sparse, Dense, Recursive, Straight-line programs, DAGs, etc. Polynomial equivalence over R, Q, C, Z p Unique Factorization Domains (UFDs) : Uniquely factorize into irreducibles Match corresponding irreducibles to prove equivalence

Why is the Problem Difficult?   Z 2 m is a non-UFD f = x 2 + 6x in Z 8 can be factorized as  Atypical approach required to prove equivalence f x+6 f x+4x+2x

Proposed Solution   f (x 1, …, x d ) % n ≡ g(x 1, …, x d ) % n Proving equivalence is NP-hard   Vanishing polynomials [ICCD ‘05] f(x) – g(x) ≡ 0 % 2 m : Zero Equivalence An instance of Ideal Membership Testing Efficient solutions over fields (Groebner’s bases): Z 2 m [x 1,…, x d ] ?   Canonical forms: Current focus Unique representations for polyfunctions over Z 2 m Equivalence by coefficient matching Concepts from Hungerbuhler et al. [To appear J. Sm. Not., ‘06 ]

Polyfunctions over Z 2 m   Polynomials over Z 2 m [x 1, …, x d ] Represented by polyfunctions from Z 2 m [x 1, …, x d ] to Z 2 m   F 1 % 2 m ≡ F 2 % 2 m => they have the same underlying polyfunction ( f )   Use equivalence classes of polynomials Derive representative for each class: Canonical form f g Equivalence classes Z 2 m [x 1, …, x d ] Z2mZ2m F2F2 F1F1 G2G2 G1G1

Motivating our Approach module fixed_bit_width (x, f, g); input [2:0] x; output [2:0] f, g; assign f[2:0] = 5x 2 + 6x - 3; assign g[2:0] = x 2 + 2x + 5;  f (x) = 5x 2 + 6x - 3 = (x 2 + 2x + 5) + (4x 2 + 4x) f (x) = g(x) + V (x) in Z 2 3  V (x) = 4x 2 + 4x ≡ 0 % 2 3 ; for x in {0,…,7} f (x) = g (x) + 0 in Z 2 3  Required: To identify and eliminate such redundant sub-expressions (vanishing)

Vanishing polynomials: Requirement  Generate vanishing expressions V(x) Test if f (x) = g (x) + V(x) f (x) = f (x) – V(x)  Challenge: Infinite number of vanishing polynomials  Required: To generate V(x) specific to given f (x) Z2mZ2m Set of all Vanishing polynomials f g Z 2 m [x 1, …, x d ] 0 h: % 2 m

Vanishing Polynomials for Reducibility  In Z 2 3, say f (x) = 4x 2 f (x) = f (x) - V(x) Generate V(x) of degree 2 V(x) = 4x 2 + 4x ≡ 0 % 2 3  Reduce by subtraction: 4x 2 f (x) – 4x 2 + 4x V(x) = - 4x = - 4x % 8 = 4x 4x 2 can be reduced to 4x Degree reduction

Coefficient Reduction: Example  Degree is not always reducible  In Z 2 3, f (x) = 6x 2 a = 6 k = 2  Divide and subtract 6x 2 = 2x 2 + 4x 2 % 2 3 4x 2 can be reduced to 4x  f (x) = 2x 2 + 4x : Lower Coefficient

Our Approach  Say f (x) = a k x k + a k-1 x k-1 + …+ a 0 In decreasing lexicographic order  Required: f (x) in reduced, minimal, unique form Check if degree can be reduced Check if coefficient can be reduced Perform corresponding reductions Repeat for all monomials …

Degree Reduction: Requirement  Generate appropriate vanishing polynomial, V(x)  f (x) = ax k + a 1 x k-1 + … V(x) = ax k + a 2 x k-1 + … f (x) – V(x) = bx k-1 + …  V(x): ax k is the leading term  Identify constraints on Degree : k Coefficient : a  Use concepts from number theory

Results From Number Theory   n! divides a product of n consecutive numbers 4! divides 99 X 100 X 101 X 102   Find least n such that 2 m |n! Smarandache Function (SF) of 2 m = n SF(2 3 ) = 4, since 2 3 |4!   2 m divides the product of n = SF(2 m ) consecutive numbers   Use SF(2 m ) to generate vanishing polynomial V(x)

Results From Number Theory   V (x) ≡ 0 % | V (x) in Z | 4!, since SF(2 3 ) = 4 4! divides the product of 4 consecutive numbers  A polynomial as a product of 4 consecutive numbers? (x+1)(x+2)(x+3)(x+4) = 4! x + 4 ≡ 0 % Write V(x) as a product of SF(2 3 ) = 4 consecutive numbers

Constraints on the Coefficient   In Z 2 3, SF(2 3 ) = 4. Product of 4 consecutive numbers: (x+1) (x+2) missing factors   V (x) = 4x 2 + 4x = (x+1)(x+2) ≡ 0 % 2 3 compensated by constant   4(x+1)(x+2) = 4·2!· x  f (x) = ax k + … Rule 1: If 2 m |ak!, then V(x) = ak! x + k ≡ 0 % 2 m k = ax k + a 1 x k-1 ….. (x+3) (x+4) 4

Example: Vanishing Polynomial  Consider f (x) = 4x 2 in Z 2 3 a = 4 k = 2 V (x) = ?  Rule 1: 2 m |a·k! => 2 3 | 4 · 2! V (x) = a · k! x + k = 4. 2! x + 2 = 4. 2! (x+2) (x+1) k 2 2! = 4x 2 + 4x ≡ 0 % 2 3 f (x) = 4x 2 V(x) = - 4x 2 + 4x = - 4x = - 4x % 8 = 4x

Coefficient Reduction: Requirement  Define v 2 (k!) = {max x Є N: 2 x | k!} number-of-factors-2 in k! v 2 (4!) = v 2 (4 * 3 * 2* 1) = 3  Rule 1: 2 m | a · k! Number-of-factors-2 in a·k! ≥ m or v 2 (a·k!) ≥ m  If 2 m does not divide a · k! v 2 (a·k!) < m v 2 (k!) < m and a < 2 m- v 2 (k!) Rule 2: Coefficient ( a ) has to be in the range {0, …, 2 m- v 2 (k!) -1} Constraint on coefficient Constraint on degree

Notation: Multivariate Polynomials  Given d variables x = with degrees k =  Replace in Rule 1 and Rule 2 x k = ∏ d i=1 x i k i k! = ∏ d i=1 k i ! x = ∏ d i=1 x i k k i v 2 (k!) = ∏ d v 2 (k i !)  Use lexicographic term ordering for variables

Uniqueness  Theorem: Any polynomial F in Z 2 m can be uniquely written as F = Σ kЄN d α k x k  d is the number of variables  α k Є {0, …, 2 m- v2(k!) -1} is the coefficient  v 2 (k!) < m

Reduction Procedure  Given a monomial f (x) = a·x k  Degree reduction: Determine if 2 m | a·k! If yes, generate V(x) of with a·x k as the leading term f (x) = f (x) – V(x)  If 2 m | a·k!, check if coefficient ( a ) is in {0, …, 2 m- v 2 (k!) -1} If not, perform division according to a·x k = q. 2 m- v2(k!) ·x k + r·x k Degree reducibleReduced form r < 2 m- v 2 (k!)

1. 1.Reducing 6x 2 y 2. 2.Degree Reduction: a = 6; k! = k x !.k y ! = 2!1! = does not divide (a ·k! ) = 12; Degree reduction not possible Perform coefficient reduction Example: Reduction Given poly = 6x 2 y + 4xy in Z 2 3

3. 3.Coefficient Reduction: v 2 (k!) = v 2 (2! · 1!) = 1 Range = {0, …, 2 m- v 2 (k!) – 1} = {0,…, 3} a = 6 > 3; Can reduce coefficient 6x 2 y = 4x 2 y + 2x 2 y Degree reduction for 4x 2 y : Rule 1 : 2 3 | (4· 2! ·1!) 4x 2 y – 4. 2!·1! x + 2 y + 1 = 4xy poly = (4xy + 2x 2 y) + 4xy ≡ 2x 2 y in Z 2 3 Example: Reduction Given poly = 6x 2 y + 4xy in Z 2 3

Experimental Setup   Distinct RTL designs are input to GAUT [ U. de LESTER, ‘04]   Extract data-flow graphs for RTL designs   Construct the corresponding polynomial representations ( f, g ) Extract bit-vector size   Reduce f and g to canonical form Equivalence check by coefficient matching   Algorithm implemented in MAPLE Complexity: O(k d ); where k is the total degree and d is the number of variables   Compare with BDD, BMD and SAT

Results

Conclusions & Future Work   Technique to verify equivalence of multivariate polynomial RTL computations   Fixed-size bit-vector arithmetic is polynomial algebra over the finite integer ring, Z 2 m   f (x 1,…, x d ) % 2 m ≡ g (x 1, …, x d ) % 2 m is proved by reduction to canonical form   Efficient algorithm to determine unique representations   Future Work involves extensions for - Multiple Word-length Implementations [DATE ‘06] Verification of Rounding and Saturation Arithmetic

Questions?

Comparison