Spectral Approach to Verifying Nonlinear Arithmetic Circuits

Slides:



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

Modular Combinational Logic
Chapter 2 Logic Circuits.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 9 Programmable Configurations Read Only Memory (ROM) – –a fixed array of AND gates.
ECE Synthesis & Verification 1 ECE 667 Synthesis and Verification of Digital Systems Formal Verification Combinational Equivalence Checking.
1 Don´t Care Minimization of *BMDs: Complexity and Algorithms Christoph Scholl Marc Herbstritt Bernd Becker Institute of Computer Science Albert-Ludwigs-University.
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.
CSE-221 Digital Logic Design (DLD)
DATE-2002TED1 Taylor Expansion Diagrams: A Compact Canonical Representation for Symbolic Verification M. Ciesielski, P. Kalla, Z. Zeng B. Rouzeyre Electrical.
Optimizing high speed arithmetic circuits using three-term extraction Anup Hosangadi Ryan Kastner Farzan Fallah ECE Department Fujitsu Laboratories University.
ECE Synthesis & Verification - Lecture 18 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Word-level.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Taylor Expansion Diagrams (TED): Verification EC667: Synthesis and Verification of Digital Systems Spring 2011 Presented by: Sudhan.
ECE Synthesis & Verification - Lecture 10 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Binary.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
 2000 M. CiesielskiPTL Synthesis1 Synthesis for Pass Transistor Logic Maciej Ciesielski Dept. of Electrical & Computer Engineering University of Massachusetts,
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Electrical and Computer Engineering Archana Rengaraj ABC Logic Synthesis basics ECE 667 Synthesis and Verification of Digital Systems Spring 2011.
EE5393, Circuits, Computation, and Biology Computing with Probabilities 1,1,0,0,0,0,1,0 1,1,0,1,0,1,1,1 1,1,0,0,1,0,1,0 a = 6/8 c = 3/8 b = 4/8.
Computer Science 101 Circuit Design - Examples. Sum of Products Algorithm Identify each row of the output that has a 1. Identify each row of the output.
CSE 140, Lecture 2 Combinational Logic
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
1 Class Presentation on Binary Moment Diagrams by Krishna Chillara Base Paper: “Verification of Arithmetic Circuits with Binary Moment Diagrams” by Randal.
CSE 8351 Computer Arithmetic Fall 2005 Instructors: Peter-Michael Seidel.
Test complexity of TED operations Use canonical property of TED for - Software Verification - Algorithm Equivalence check - High Level Synthesis M ac iej.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
Automatic Test Generation
Prof. Sin-Min Lee Department of Computer Science
Combinational Circuits
VLSI Testing Lecture 5: Logic Simulation
The Analysis of Cyclic Circuits with Boolean Satisfiability
VLSI Testing Lecture 5: Logic Simulation
Synthesis for Verification
Vishwani D. Agrawal Department of ECE, Auburn University
Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates,
Boolean Algebra and Combinational Logic
Solving Linear Arithmetic with SAT-based MC
Fundamentals & Ethics of Information Systems IS 201
CHAPTER 2 Boolean Algebra
ECE 667 Synthesis and Verification of Digital Systems
LPSAT: A Unified Approach to RTL Satisfiability
Arithmetic Circuits (Part I) Randy H
SAT-Based Area Recovery in Technology Mapping
Polynomial Construction for Arithmetic Circuits
Boolean Algebra.
Programmable Configurations
Scalable and Scalably-Verifiable Sequential Synthesis
Logic Gates.
Chapter 2 Introduction to Logic Circuits
Research Status of Equivalence Checking at Zhejiang University
Digital System Design Combinational Logic
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Logic Circuits I Lecture 3.
UNIVERSITY OF MASSACHUSETTS Dept
UNIVERSITY OF MASSACHUSETTS Dept
ECE 352 Digital System Fundamentals
UNIVERSITY OF MASSACHUSETTS Dept
Description and Analysis of MULTIPLIERS using LAVA
Overview of Digital Electronics
A Practical Approach to Arithmetic Circuit Verification
Robert Brayton Alan Mishchenko Niklas Een
Robert Brayton Alan Mishchenko Niklas Een
UNIVERSITY OF MASSACHUSETTS Dept
Presentation transcript:

Spectral Approach to Verifying Nonlinear Arithmetic Circuits Cunxi Yu, Tiankai Su, Atif Yasin Maciej Ciesielski University of Massachusetts Amherst, MA / USA

ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification Introduction Hardware verification Checking if the design meets specification Equivalence checking Property, model checking Functional verification (arithmetic) Integer, Galois Field – function specified by polynomial Formal methods (OK for logic and ~arithmetic circuits) Canonical diagrams (BDD), SAT, SMT Require “bit-blasting”, memory explosion Theorem proving Requires knowledge of the design, interactive Computer Algebra Complex math, theory of Groebner basis Computationally expensive, order dependent; can be engineered … ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Computer Algebra Approach Represents circuit in algebraic domain Circuit specification and its implementation represented by polynomials Input signature Sigin: function expressed as polynomial in primary inputs (PI) Output signature Sigout: polynomial, encoding of primary outputs (PO) Sigout = 4r2 + 2r1 + r0 2- bit adder ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification Algebraic Model Algebraic model of circuit components Logic gates Example: OR gate equation: z = a + b - a b polynomial : z - a - b + a b = 0 Single-bit adders, etc. a b z polynomial: (a + b - 2C - S) equation: a + b = 2C + S ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Computer Algebra Approach Algebraic model of circuit components Implementation B: set of polynomials representing logic gates B Sigout = 4r2 + 2r1 + r0 2- bit adder Fspec = Sigout - Sigin R Functional Verification: ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Computer Algebra Approach Functional Verification Does the implementation B satisfy specification Fspec ? Reduce Fspec modulo B If R= 0, the circuit is correct Otherwise, circuit may still be correct, but … need canonical Groebner basis (GB) to check if R = 0 Polynomials (ideals) < x2 – x > are needed for each binary signal x In general the problem is complex Fspec = Sigout - Sigin R ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Computer Algebra Approaches Verification methods differ in how they accomplish reduction Arithmetic Bit-Level (ABL) representation [Wienand’08, Pavlenko’11] Circuit represented as network of HA, FA, linear Computer algebra algorithms Column-wise polynomial reduction [Ritirc’17, ’18] Combining Groebner basis with logic reduction [S-Ahm’16, Mahzoon’18] Galois Field multipliers, debugging [Kalla’14, ’16] Algebraic rewriting [Ciesielski, Yu et al, ’16 - ‘18] Function extraction, bit-flow model ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification Algebraic Rewriting Backward rewriting (PO  PI) (function extraction) Start with polynomial expression of output vector, Sigout Iteratively replace gate output by expression of its inputs, e.g., r2 = e + f - e f Check the polynomial at the primary inputs, Sigin 𝑆𝑖𝑔 𝑓2 = 𝑟 0 +2 𝑟 1 +4 (𝑒+𝑓−𝑒𝑓) Sigout = 4 𝑟2 + 2 𝑟1 + r0 2- bit adder ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Algebraic Rewriting Methods Rewriting a full adder (FA) Gate-level, structural rewritng Functional rewriting On an AIG structure Extraction XOR and Majority functions Structural rewriting AIG rewriting ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Algebraic (Backward) Rewriting - Demo Replace variables in reverse topological order F = Sigout = 4r2+2r1+r0 1 2 4 F/r2= 4e+4f-4ef +2r1+ r0 F/r1 = 4e+4f-4ef +2c+2d-4cd + r0 F/r0 = 4e+4f-4ef +2c+2d-4cd -2a0 b0 +a0 +b0 F/f = 4e+4cd-4ecd +2c+2d-4cd -2a0 b0 +a0 +b0 F/e = 4a1b1+4cd-4a1b1cd +2c+2d-4cd -2a0 b0 +a0 +b0 F/c = 4a1b1+4a0b0d-4a1b1a0b0d+2a0b0+2d -4a0b0d -2a0 b0 +a0 +b0 = 4a1b1 - 4a1b1a0b0d +2d +a0 +b0 F/d = 4a1b1 - 4a1b1a0b0(a1+b1-2a1b1) +2a1 +2b1 -4a1b1 +a0 +b0 4a0b0 (a21b1 + a1b21 -2a21b21) = 0 = 2a1 + 2b1 + a0 + b0 2-bit adder ! Simplification: a2 = a, b2 = b (binary) ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Algebraic Rewriting - Summary Two types of simplification during rewriting Cancelation of monomials with opposite coefficient signs Example: Half Adder, HA (a,b), with outputs C, S 2C + S = 2ab + (a + b – 2ab) = a + b Signals are Boolean, i.e., x2 = x In polynomial reduction: ideal <x2 – x> is needed (Groebner basis) In rewriting: simply replace x2 by x ( a2 = a, b2 = b in previous example) Polynomials can be large in heavily optimized circuits Fat belly effect A better rewriting: use And-Inverter-Graph (AIG) structure Detect adder trees HA: XOR and AND pairs with common inputs FA: XOR3 and MAJ3 pairs with common inputs ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Functional Abstraction – Spectral Method Extract arithmetic functions from sea of gates Assume: PO boundary is known No boundary for PIs needed Apply backward rewriting Where to stop ? Spectral Method Examine distribution of weights (coefficients) of polynomial terms Defines the spectrum Determine arithmetic function based on its spectrum ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Algebraic Spectrum – Multiplier 𝐴= 𝑎 0 +2 𝑎 1 +4 𝑎 2 +8 𝑎 3 𝐵= 𝑏 0 +2 𝑏 1 +4 𝑏 2 +8 𝑏 3 𝐹= 𝐴⋅𝐵 Multiplier F = A·B F = A·B·C ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Arithmetic Spectrum – n-bit Adder i = bit position of result C(i) = 2i, coefficient a bit i N(i) = # terms with coeff C(i) ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Algebraic Spectrum – MAC Multiply-Accumulator (MAC) F = A*B + C A = a0+2a1 + 4a2, B = b0+2b1 +4b2, C = c0+2c1+4c2 +8c3 +16c4 +32c5 1-variable spectrum + 2-variable spectrum 1-var: addition 2-var: multiplication ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Computing the Spectrum Step 1: Create AIG; detect XOR & Majority functions XOR3 = <14,12,13><17,16,18> MAJ3 = <12,11,10><16,12,15> Step 2: Detect HA, FA and extract adder tree Step 3: Propagate constants and create spectrum ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Computing the Spectrum - Demo Algebraic Spectrum construction on DAG – 3-bit Multiplier 20 21 22 23 24 25 Detected 3-bit multiplication ! 20 21 22 23 24 24 24 20 21 22 23 23 23 24 24 20 21 22 22 23 23 24 20 21 21 22 22 22 23 23 24 ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Demo – Booth and CSA Multiplier Applications of Spectrum Equivalence checking of arithmetic functions Word-level abstraction Example: 3-bit Booth-Multiplier vs. CSA-Multiplier Single-, two-, three-variable terms 1-var 2-vars 3-vars Initial step Expression with: 1-variable terms 2-variable terms and 3-variable terms Sigout = 32z5 + 16z4 + 8z3 + 4z2 + 2𝑧1 + z0 ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Demo – Booth and CSA Multiplier 1-var 2-vars 3-vars 3-bit Multiplier Rewriting progress 20 % 40 % ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Demo – Booth and CSA Multiplier 1-var 2-vars 3-vars Rewriting progress 80 % Multiplier detected ! 100 % ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Verification Results – CSA Multipliers Varication tool built on top of ABC, command: &aspec CSA Multipliers Pre-synthesized and post-synthesized TO = time out 3600 sec; MO = memory out of 8 GB, ES = error state (Singular) # bits Pre-synthesized Post-synthesized Yu’16 Ahmed’16 Ritirc’17 Ritirc’18 This work 64 1.9 TO 801 4.0 0.1 5.5 1073 418 128 8.1 ES 0.8 50 0.9 256 33 7.8 285 8.4 512 130 30 MO 42 1024 9638 9817 Tool available at: https://github.com/ycunxi/abc ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Results – Complex Multipliers Six types of multipliers, including Booth multipliers btor : generated by Boolector; abc: generated by abc; AOKI mults: sp – standard partial products; bp - booth partial products ar - array based adder chain; rc - ripple carry based adder chain # bits Designs Yu’16 Ahmed’16 Ritirc’17 Ritirc’18 This work (sec) 128 btor; btor-resyn3; abc; abc-resyn3; CSA; CSA-resyn3; MO TO ES 1.5 abc-booth; abc-booth-resyn3 0.5 sp-ar-rc [AOKI] - bp-ar-rc-dc2; bp-ar-rc-resyn3; sp-ar-rc-dc2; sp-ar-rc-resyn3; UAT 256 14 3.5 1024 9482 139 UAT = Unstructured adder trees; TO = time out of 3 hours; MO = memory out of 8 GB; ES = error state

Results – Word-level Abstraction Experimental results of abstractions Multiplier is implemented using CSA-multiplier Error = fail to correctly detect the function of F TO = 36,000 s MO = 8 GB 256-bit Yu’15 Seoken’17 This work F=AB+C 23,760 s error 45 s F=A(B+C) TO F=A*B*C 69 s Tool available at: https://github.com/ycunxi/abc ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Summary and Conclusions Algebraic rewriting Conceptually simple, but may explode Useful for function extraction Computed signature gives functional specification Applicable to adders, multipliers Solving the problem for highly bit-optimized circuits Implemented in ABC, AIG rewriting AIG is more effective than structural rewriting Spectral method most effective, can handle Booth multipliers Open problems Debugging Combining backward and forward rewriting Verifying dividers, SQRT, etc. ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Thank You !

Algebraic (Backward) Rewriting - Demo Replace gate output by its equation Backward symbolic simulation Polynomials may explode (fat belly effect) f2 = 4(f + e - ef)+2r1+r0 = 4f + 4e – 4ef + 2r1 + r0 = 4f + 4e – 4ef + 2r1 + r0 f1 f0 f2 f3 f1 = 4e + 4(cd) – 4e(cd) + 2(c+d-2cd) + r0 = 4e + 2c + 2d + r0 – 4ecd = 4e + 2c + 2d + r0 – 4ecd f0 = 4(a1b1) + 2(a0b0) + 2(a1+ b1 - 2a1b1) + (a0 + b0 - 2a0b0) - 4(a1b1)(a0b0)(a1 + b1 -2a1b1) = 2a1+ 2b1 + a0 + b0 Matches the specification:  circuit is correct 2- bit adder ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification

Rewriting Demo – MAC Multiply Accumulator (F = A * B + C) Can we identify the adder and the multiplier ? They may be merged after synthesis We can tell that there is an addition and a multiplication Identify the upper boundary of function F What we cannot do: identify the adder or multiplier Structural level Example : MAC 2-bit multiplier with a 4-bit adder 1-var 2-vars 3-vars Initial step

Rewriting Demo – MAC MAC 1-var 3-vars 2-vars Addition detected Addition and multiplication detected

Functional Abstraction - Results Using Spectral method 8- to 128-bit MAC Limitations Need to know output bits ASPDAC 2019 - Spectral Approach to Arithmetic Circuit Verification