Verification & Synthesis of Arithmetic Datapaths using Finite Ring Algebra Priyank Kalla Priyank Kalla Electrical and Computer Engineering University of.

Slides:



Advertisements
Similar presentations
Mathematics of Cryptography Part II: Algebraic Structures
Advertisements

Cryptography and Network Security, Finite Fields From Third Edition by William Stallings Lecture slides by Mustafa Sakalli so much modified..
Cryptography and Network Security
ECE Synthesis & Verification 1 ECE 667 Synthesis and Verification of Digital Systems Formal Verification Combinational Equivalence Checking.
Number Theory and Cryptography
More about Polynomials
Partial Fractions MATH Precalculus S. Rook.
1 Don´t Care Minimization of *BMDs: Complexity and Algorithms Christoph Scholl Marc Herbstritt Bernd Becker Institute of Computer Science Albert-Ludwigs-University.
Richard Fateman CS 282 Lecture 21 Basic Domains of Interest used in Computer Algebra Systems Lecture 2.
Class Presentation on Binary Moment Diagrams by Krishna Chillara Base Paper: “Verification of Arithmetic Circuits using Binary Moment Diagrams” by.
ECE 667 Student Presentation Gayatri Prabhu [1]. *PHDD: An Efficient Graph Representation for Floating Point Circuit Verification – Y. Chen, R. Bryant,
Department of Electrical and Computer Engineering M.A. Basith, T. Ahmad, A. Rossi *, M. Ciesielski ECE Dept. Univ. Massachusetts, Amherst * Univ. Bretagne.
ENGG2013 Unit 11 Row-Rank Feb,
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.
Common Subexpression Elimination Involving Multiple Variables for Linear DSP Synthesis 15 th IEEE International Conference on Application Specific Architectures.
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.
Taylor Expansion Diagrams (TED): Verification EC667: Synthesis and Verification of Digital Systems Spring 2011 Presented by: Sudhan.
Equivalence Verification of Polynomial Datapaths with Fixed-Size Bit-Vectors using Finite Ring Algebra Namrata Shekhar, Priyank Kalla, Florian Enescu,
Richard Fateman CS 282 Lecture 14b1 Gröbner Basis Reduction Lecture 14b.
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.
Manindra Agrawal NUS / IITK
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.
Information Security and Management 4. Finite Fields 8
Cryptography and Network Security Introduction to Finite Fields.
By: Hector L Contreras SSGT / USMC
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.
Review Topics (Ch R & 1 in College Algebra Book) Exponents & Radical Expressions (P and P ) Complex Numbers (P. 109 – 114) Factoring (p.
Cyclic Codes for Error Detection W. W. Peterson and D. T. Brown by Maheshwar R Geereddy.
Session 1 Stream ciphers 1.
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.
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: 陳炳元.
Exploiting Vanishing Polynomials for Equivalence Verification of Fixed-Size Arithmetic Datapaths GIEE, NTU ALCom Lab Presenter: 陳炳元.
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.
Information and Coding Theory Cyclic codes Juris Viksna, 2015.
Date: 2.4 Real Zeros of Polynomial Functions
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
1 Class Presentation on Binary Moment Diagrams by Krishna Chillara Base Paper: “Verification of Arithmetic Circuits with Binary Moment Diagrams” by Randal.
Cryptography and Network Security Chapter 4 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Test complexity of TED operations Use canonical property of TED for - Software Verification - Algorithm Equivalence check - High Level Synthesis M ac iej.
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.
Mathematical Background: Extension Fields
Polynomials.
ECE 667 Synthesis and Verification of Digital Systems
LPSAT: A Unified Approach to RTL Satisfiability
Cryptography and Network Security
Cryptology Design Fundamentals
Polynomial Functions Unit 5 Algebra 2A.
Mathematical Background: Extension Finite Fields
Presentation transcript:

Verification & Synthesis of Arithmetic Datapaths using Finite Ring Algebra Priyank Kalla Priyank Kalla Electrical and Computer Engineering University of Utah Salt Lake City, UT-84112

Research Group Members  Graduate Students : Namrata Shekhar – PhDNamrata Shekhar – PhD  RTL Verification of Arithmetic Datapaths Sivaram Gopalakrishnan – PhDSivaram Gopalakrishnan – PhD  RTL Synthesis of Arithmetic Datapaths Vijay Durairaj – PhD + Chris Condrat – BS/MSVijay Durairaj – PhD + Chris Condrat – BS/MS  SAT & SAT-based Decision Procedures  Collaborators: Prof. Florian Enescu + BrandonProf. Florian Enescu + Brandon  Mathematics & Statistics, Georgia State Univ.

Outline  Introducing the Problems Equivalence Verification & High-Level SynthesisEquivalence Verification & High-Level Synthesis Applications: Fixed Point Arithmetic, Polynomial Signal Processing, Audio/Video/Multimedia DSPApplications: Fixed Point Arithmetic, Polynomial Signal Processing, Audio/Video/Multimedia DSP  Modeling : Poly-Functions over Finite Integer Rings  Previous Work : CAD & Symbolic Computer Algebra  Contributions Vanishing Polynomials, Canonical Forms for VerificationVanishing Polynomials, Canonical Forms for Verification Polynomial Reduction + Decomposition for SynthesisPolynomial Reduction + Decomposition for Synthesis  Algorithm Design & Experimental Results  Open Problems & Challenges : CAD + Algebra

The Verification & Synthesis Problems

Polynomials over Bit-Vectors?  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

Bit-Vector Arithmetic = %2 m Algebra   Represent integers as a vector of bits   Bit x 0 represents values 0 or 1   Vector X[1:0] = {x 1, x 0 } represents integers   00, 01, 10, 11 (4 values from 0 to 3)   Bit-vector of size m : integer values in 0,…, 2 m -1   Vector X[m-1 : 0] represents integers reduced % 2 m + 2-bit 3-bit * 2-bit 4-bit ADDER MULTIPLIER

Fixed-Size (m) Data-path: Modeling   Control the datapath size: Fixed size bit-vectors ( m ) * * 8-bit 16-bit 32-bit * * 16-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 If( x[7:0] > 255 ) then x[7:0] = 255; 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: 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]; F 1 % 2 16 = F 2 % 2 16   Transform the problem F 1 - F 2 = 57344x x x x x ≡ 0 % 2 16   F 1 - F 2 : Vanishing polynomial

Multiple Word-Length Operands Bit-vector operands with different word-lengths Bit-vector operands with different word-lengths Input variables : {x 1,…, x d } Output variables : f, g Input variables : {x 1,…, x d } Output variables : f, g Input bit-widths: {n 1,…, n d } Output width : m Input bit-widths: {n 1,…, n d } Output width : m Model as polynomial function Model as polynomial function * * 8-bit 12-bit 20-bit 32-bit

Example: Digital Image Rejection Unit Y 1 ≠ Y 2 Y 1 ≠ Y 2 Y 1 [15:0] = Y 2 [15:0]Y 1 [15:0] = Y 2 [15:0] Y 1 % 2 16 ≡ Y 2 % 2 16Y 1 % 2 16 ≡ Y 2 % 2 16 input A[11:0], B[7:0]; output Y 1 [15:0], Y 2 [15:0];

Previous Work: Function Representations   Boolean Representations ( f: B → B ) BDDs, MTBDDs, ADDs 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

Previous Work: Others   SAT and MILP-based techniques Suitable for linear/multi-linear forms   Word-level ATPG, congruence closure, co- operative decision procedures Solve linear congruences under modulo arithmetic   Theorem-Proving (HOL), term-rewriting Abstract away the data-path size using data independence, symmetry, other abstractions Here, datapath size ( m ) defines ring cardinality ( Z 2 m )

Previous Work: Symbolic Algebra   Galois Field Decomposition of Boolean Functions: GF(2 m ) [Pradhan, recent work]   Symbolic Algebra Tools : Singular, Macaulay, Maple, Mathematica, ZEN, NTL, CoCoA Polynomial equivalence over R, Q, C, Z p Unique Factorization Domains (UFDs) : Uniquely factorize into irreducibles Match corresponding coefficients to prove equivalence

Symbolic Algebra in CAD   MODD: DAG representation of polynomials over GF(2 m ) [Pradhan, IWLS 05, DATE 04]   Guiding Synthesis engines using Groebner’s basis [De Micheli, TCAD 02] Given polynomial F and Library elements F = h 1 I 1 + …… + h n I n Again, works over UFDs Approximate RTL as polynomials over Reals   Theorem Proving [Clarke et al.] HOL + Mathematica = Analytica

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 xx+6 f x+2x+4

Problem Formulations + Solutions   f (x 1, …, x d ) % n ≡ g(x 1, …, x d ) % n Proving equivalence is NP-hard [Ibarra, J. ACM ’83]   Vanishing polynomials [ICCD ’05, DATE’06] 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 [ICCAD ’05] Unique representations for polyfunctions over Z 2 m Equivalence by coefficient matching Concepts from Hungerbuhler et al. [J. Sm. Not., ‘06 ]

Ideal Membership Testing   ( f – g ) % 2 m = 0 or ( f – g ) vanishes % 2 m   Membership in the Ideal of all Vanishing Polynomials in Z 2 m   Grobner's basis? Buchberger's algorithm?   Generate the Ideal! Z 2 m [x 1, …, x d ] Z2mZ2m Ideal x x % 2 m h: % 2 m 0 f g f – g ?

Ideal Membership Testing in Z p   Fermat’s Little Theorem: x p ≡ x (mod p) or x p – x ≡ 0 (mod p) x p –x generates the vanishing ideal in Z p [x]   f(x) = 0 % p iff f(x) = (x p -x)g(x)   Z p : Principal Ideal Domain   This does not follow in Z 2 m   Generalize the result from:   %p to %p m to % (any integer) n

Ideal Membership Testing   Generate the ideal of vanishing polynomials % 2 m ? Vanishing Ideal is finitely generated [Niven et al, Am. Math. Soc., ‘57]   Need an algorithm for membership testing Representative expression for members of this ideal [ Singmaster, J. Num. Th ‘74] P Q Ideal x x % 2 m h: % 2 m 0 f g f – g ?

Results From Number Theory   (f-g) % 2 m = 0 means that 2 m | (f-g)   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). SF(2 3 ) = 4, since 2 3 |4!   2 m divides the product of n = SF(2 m ) consecutive numbers

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

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

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

Results From Number Theory   f ≡ g in Z 2 3 or (f - g) ≡ 0 % |(f - g) in Z |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) Write (f-g) as a product of SF(2 3 ) = 4 consecutive numbers

Basis for factorization   S 0 (x) = 1   S 1 (x) = (x + 1)   S 2 (x) = (x + 1)(x + 2) = Product of 2 consecutive numbers   S 3 (x) = (x + 1)(x + 2)(x + 3) = Product of 3 consecutive numbers   …   S n (x) = (x + n) S n-1 (x) = Product of n consecutive numbers Rule 1: Factorize into atleast S n (x) to vanish, where n = SF(2 m ).

Example: Vanishing polynomial   4 th degree polynomial p in Z 2 3 ; SF(2 3 ) = 4   p = x 4 +2x 3 + 3x 2 + 2x   p can be written as a product of 4 consecutive numbers. or p = (x+1)(x+2)(x+3)(x+4) = S 4 (x) in Z 2 3.   p is a vanishing polynomial.

Example: Vanishing polynomial module fixed_bit_width (x, f, g); input [2:0] x; output [2:0] f, g; assign f[2:0] = x 2 + 6x – 3; assign g[2:0] = 5x 2 + 2x + 5;  h(x) = f(x) – g(x) = 4x 2 + 4x  h(x) ≡ 0 for all values of x in {0,…,7}  4x 2 +4x not equal to (x+1)(x+2)(x+3)(x+4)  Required: To show that h(x) is a vanishing polynomial in Z 2 3

Constraints on the Coefficient   h(x) = 4x 2 + 4x = 4(x+1)(x+2)   In Z 2 3, SF(2 3 ) = 4. Product of 4 consecutive numbers: S 4 (x) = (x+1) (x+2) (x+3) (x+4) Rule 2: Coefficient has to be a multiple of b k = 2 m /gcd(k!, 2 m )  Here, Coefficient of h(x) = 4, Degree of h(x) = 2  b 2 = 2 3 /gcd(2!, 2 3 ) = 4 is a multiple of the coefficient

Constraints on the Coefficient   h(x) = 4x 2 + 4x = 4(x+1)(x+2) compensated by constant   In Z 2 3, SF(2 3 ) = 4. Product of 4 consecutive numbers: S 4 (x) = (x+1) (x+2) (x+3) (x+4) missing factors Rule 2: Coefficient has to be a multiple of b k = 2 m /gcd(k!, 2 m )  Here, Coefficient of h(x) = 4, Degree of h(x) = k = 2  b 2 = 2 3 /gcd(2!, 2 3 ) = 4 is a multiple of the coefficient

Deciding Vanishing Polynomials   n = SF(2 m ), i.e. the least n such that 2 m |n!   F n is an arbitrary polynomial in Z 2 m [x]   a k is an arbitrary integer   b k = 2 m /gcd(k!,2 m )  Polynomial F in Z 2 m vanishes if F = F n S n + Σ n-1 a k b k S k k=0 Rule 1 Rule 2

Algorithm Input: poly, 2 m Calculate n = SF(2 m ) k = n: Reduce according to Rule 1 Divide by S n If remainder is zero, F = F n S n, else Continue poly = 4x 2 + 4x in Z n = SF(2 3 ) = k = 4: Divide by S 4 Degree (poly) = 2 < degree(S 4 ) = 4 quo = 0, rem = 4x 2 + 4x F 4 = 0; Continue Example 1 F = F n S n + Σ n-1 a k b k S k k=0

Algorithm Input: poly, 2 m Calculate n = SF(2 m ) k = n: Reduce according to Rule 1 Divide by S n If remainder is zero, F = F n S n, else Continue poly = 4x 2 + 4x in Z n = SF(2 3 ) = k = 4: Divide by S 4 Degree (poly) = 2 < degree(S 4 ) = 4 quo = 0, rem = 4x 2 + 4x F 4 = 0; Continue Example 1 F = F n S n + Σ n-1 a k b k S k k=0

Algorithm Reduce according to Rule 2. Divide by S n-1 to S 0 Check if quotient is a multiple of b k = 2 m /gcd(k!,2 m ) If remainder is zero, stop. Else, continue k = 3: Divide by S 3 degree (poly) = 2 < degree(S 3 ) = 3 quo= 0, rem = 4x 2 + 4x continue k = 2: Divide by S 2 quo = 4; rem = 0 b 2 = 2 3 /gcd(2!,2 3 ) = 4 a 2 = quo/ b 2 = 1 Є Z Example 1 poly = a 2.b 2.S 2 = 1.4.(x+1)(x+2) ≡ 0 in Z 2 3 F = F n S n + Σ n-1 a k b k S k k=0

Algorithm Reduce according to Rule 2. Divide by S n-1 to S 0 Check if quotient is a multiple of b k = 2 m /gcd(k!,2 m ) If remainder is zero, stop. Else, continue k = 3: Divide by S 3 degree (poly) = 2 < degree(S 3 ) = 3 quo= 0, rem = 4x 2 + 4x continue k = 2: Divide by S 2 quo = 4; rem = 0 b 2 = 2 3 /gcd(2!,2 3 ) = 4 a 2 = quo/ b 2 = 1 Є Z Example 1 poly = a 2.b 2.S 2 = 1.4.(x+1)(x+2) ≡ 0 in Z 2 3 F = F n S n + Σ n-1 a k b k S k k=0

Example 2   poly = 5x 2 + 3x + 7 in Z 2 3   n = SF(2 3 ) = 4   degree (poly) = 2 < n. Skip Rule 1, try Rule 2   Divide by S 2 quo = 5; rem = 5 + 4x b 2 = 2 3 /gcd(2!,2 3 ) = 4 a 2 = quo/ b 2 = 5/4 is not in Z   poly does not satisfy Rule 2   poly is not a vanishing polynomial in Z 2 3

Status of our Work - Extensions Multiple Variables: Multiple Variables: Z 2 m [x 1, …, x d ] Given polynomials (f, g) d variablesGiven polynomials (f, g) d variables x = over Z 2 m x = over Z 2 m  Prove that (f-g) = 0 % 2 m  What if word-lengths are different too?  x 1  Z 2 n 1, ……, x d  Z 2 n d  No problems!  Straight-forward extensions of previous concepts  Other approach: Canonical forms of poly- functions

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

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  f (x) = ax k + … If 2 m |ak!, then V(x) = ak! x + k ≡ 0 % 2 m k = ax k + a 1 x k-1 …..

Coefficient Reduction: Example  Degree is not always reducible  In Z 2 3, f (x) = 6x 2 a = 6, k = 2 8 does not divide 6 × 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 …

Experimental Setup   Distinct RTL designs are input to GAUT [ U. de LESTER]   Extract data-flow graphs for RTL designs   Construct the corresponding polynomial representations ( f, g ) Extract bit-vector size   Find the difference ( f-g ) and invoke the zero-testing algorithm   Reduce f, g to canonical forms….   Algorithm implemented in MAPLE   Compare with BMD, SAT and MILP   Complexity: O(k d )

Results

Limitations: Mathematics versus CAD   Finite Ring Algebra = Cannot DIVIDE!   Right shift breaks the model   Overflow arithmetic versus Saturation   Comparators = non-polynomial?   Internal bit-vectors of arbitrary word-lengths   Only Yes/No Equivalence? Find bugs too!   Couple Verification with Simulation!   Arithmetic interfaced with Boolean……

Intermediate Signal Truncation a = 127 b = 1 f 1 = 383 c = 255 ≠ a = 127 b = 1 f 2 = 127 c = 255 a [7:0] b [7:0] t 1 [7:0] + c [7:0] + f 1 [8:0] a [7:0] b [7:0] t 2 [7:0] + c [7:0] + f 2 [8:0]

Proposed Solution ≠ a [7:0] b [7:0] t 1 [7:0] + c [7:0] + f 1 [8:0] a [7:0] b [7:0] t 2 [7:0] + c [7:0] + f 2 [8:0] Canonize Required: Algorithm for reduction to canonical form over

Polynomial Abstraction from RTL If (x > 2b’10) then y = x * x * x Else y = x*x Traditional modeling. Proposed modeling: y as a polyfunction from : Unique representation Issues with the proposed abstraction: Scalability

Verification via Simulation?

Simulation Vector Generation Simulation Vector Generation f = x 4 + x 2 (specification) f = x 4 + x 2 (specification) x=0, f=0x=0, f=0 x=1, f=2x=1, f=2 x=2, f=4x=2, f=4 x=3, f=2x=3, f=2 x=4, f=0x=4, f=0 x=5, f=2x=5, f=2 x=6, f=4x=6, f=4 x=7, f=2x=7, f=2 Prove f = g over Z 8 via Simulation Prove f = g over Z 8 via Simulation How many vectors to Simulate? Exhaustive Simulation? NO! Simulate only n = SF(2 3 ) = 4 CONSECUTIVE vectors g = 2x 2 (implementation) g = 2x 2 (implementation) x=0, g=0x=0, g=0 x=1, g=2x=1, g=2 x=2, g=0x=2, g=0 x=3, g=2x=3, g=2 x=4, g=0x=4, g=0 x=5, g=2x=5, g=2 x=6, g=0x=6, g=0 x=7, g=2x=7, g=2

Applications to Synthesis  Datapath size ( m ): 8 bits  SF(2 8 ) = 10  Polynomial can be factorized into S 10 (x) F[7:0] = (x+1)(x+2)...(x+10)

Polynomial Decomposition F = 8xy y 3 + 9y F = 8xy y 3 + 9y X, Y [3:0] are 4-bit vectors (%16) X, Y [3:0] are 4-bit vectors (%16) Synthesize: Area = 320 Synthesize: Area = 320 U = 8x + 3y U = 8x + 3y F = U 3 + U F = U 3 + U Synthesize: Area = = 201 Synthesize: Area = = 201

Conclusions   Finite Word-Length Bit-Vector Arithmetic is Finite Ring Algebra   Computations reduced % integer power of 2   NON-UFDs! Number Theory, Commutative Algebra   Mathematicians should help us here…….   Techniques to verify equivalence of polynomial RTL computations   f(x) % 2 m ≡ g(x) % 2 m is transformed into f(x) - g(x) ≡ 0 % 2 m   Ideal Membership Testing, Canonical Forms….   Tremendous scope in high-level synthesis….

Questions?