Using Mathematica for modeling, simulation and property checking of hardware systems Ghiath AL SAMMANE VDS group : Verification & Modeling of Digital systems.

Slides:



Advertisements
Similar presentations
Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Advertisements

Digital System Design Subject Name : Digital System Design Course Code : IT-314.
CMSC 611: Advanced Computer Architecture
ECOE 560 Design Methodologies and Tools for Software/Hardware Systems Spring 2004 Serdar Taşıran.
ECE Synthesis & Verification - Lecture 2 1 ECE 667 Spring 2011 ECE 667 Spring 2011 Synthesis and Verification of Digital Circuits High-Level (Architectural)
Automated Refinement Checking of Concurrent Systems Sudipta Kundu, Sorin Lerner, Rajesh Gupta Department of Computer Science and Engineering, University.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
VHDL Structural Architecture ENG241 Week #5 1. Fall 2012ENG241/Digital Design2 VHDL Design Styles Components and interconnects structural VHDL Design.
Combining Symbolic Simulation and Interval Arithmetic for the Verification of AMS Designs Mohamed Zaki, Ghiath Al Sammane, Sofiene Tahar, Guy Bois FMCAD'07.
Presenter: PCLee – This paper outlines the MBAC tool for the generation of assertion checkers in hardware. We begin with a high-level presentation.
ISBN Chapter 3 Describing Syntax and Semantics.
CSE241 Formal Verification.1Cichy, UCSD ©2003 CSE241A VLSI Digital Circuits Winter 2003 Recitation 6: Formal Verification.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
Behavioral Design Outline –Design Specification –Behavioral Design –Behavioral Specification –Hardware Description Languages –Behavioral Simulation –Behavioral.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Validating High-Level Synthesis Sudipta Kundu, Sorin Lerner, Rajesh Gupta Department of Computer Science and Engineering, University of California, San.
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Describing Syntax and Semantics
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts,
Digital System Design Verilog ® HDL Maziar Goudarzi.
1 Chapter 7 Design Implementation. 2 Overview 3 Main Steps of an FPGA Design ’ s Implementation Design architecture Defining the structure, interface.
Timing control in verilog Module 3.1 Delays in Verilog.
(1) Introduction © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
VHDL Structured Logic Design School of Electrical Engineering University of Belgrade Department of Computer Engineering Ivan Dugic Veljko.
ECE 2372 Modern Digital System Design
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
VHDL Symbolic simulator in OCaml Florent Ouchet TIMA Labs – GINP – UJF – CNRS – VDS group OCaml Meeting 2009.
1 H ardware D escription L anguages Modeling Digital Systems.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
Array Synthesis in SystemC Hardware Compilation Authors: J. Ditmar and S. McKeever Oxford University Computing Laboratory, UK Conference: Field Programmable.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
George Mason University Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code ECE 448 Lecture 6.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics VHDL register-transfer modeling: –basics using traffic light controller; –synthesis.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Introduction to VLSI Design – Lec01. Chapter 1 Introduction to VLSI Design Lecture # 11 High Desecration Language- Based Design.
Kazi ECE 6811 ECE 681 VLSI Design Automation Khurram Kazi Thanks to Automation press THE button outcomes the Chip !!! Reality or Myth.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
ECE-C662 Lecture 2 Prawat Nagvajara
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
5-1 Logic System Design I VHDL Design Principles ECGR2181 Reading: Chapter 5.0, 5.1, 5.3 port ( I: in STD_LOGIC_VECTOR (1 to 9); EVEN, ODD: out STD_LOGIC.
EE121 John Wakerly Lecture #17
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
On the Relation Between Simulation-based and SAT-based Diagnosis CMPE 58Q Giray Kömürcü Boğaziçi University.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
EMT 351/4 DIGITAL IC DESIGN Week # 1 EDA & HDL.
ASIC Design Methodology
Hardware Verification
B e h a v i o r a l to R T L Coding
Topics Modeling with hardware description languages (HDLs).
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Topics Modeling with hardware description languages (HDLs).
Assertions An assertion is a statement about the design’s intended behavior Assertions can be written in a hardware description language (HDL) Assertions.
Topics HDL coding for synthesis. Verilog. VHDL..
Hardware Description Languages
ECE-C662 Introduction to Behavioral Synthesis Knapp Text Ch
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Introduction.
THE ECE 554 XILINX DESIGN PROCESS
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
Digital Designs – What does it take
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
THE ECE 554 XILINX DESIGN PROCESS
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Using Mathematica for modeling, simulation and property checking of hardware systems Ghiath AL SAMMANE VDS group : Verification & Modeling of Digital systems TIMA Laboratory Techniques of Informatics and Microelectronics for computer Architecture

© Ghiath AL SAMMANE 2 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 3 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 4 What is TIMA ? (1)  Public research lab of the university of Grenoble and CNRS, located in the European equivalent to Silicon Valley  Carrying out research in the field of –Hardware design, architecture, test. –Verification & CAD tools. –Quality of integrated circuits and by means of data processing and microelectronics technology.  Transferring research results to industry  Contributing to knowledge dissemination by organizing conferences and editing journals

© Ghiath AL SAMMANE 5 What is TIMA ? (2)  120 members including interns and staff  67 PhD candidates  17 patents since 1993 and 3 start ups since 1999  7 conferences organized in 2004 and 6 conferences to be organized in 2005  100 publications/year since 1993 and 57 PhD theses since 1999

© Ghiath AL SAMMANE 6 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 7 Digital Hardware Design Process Design Specifications Functional Design RTL Design In English Given by managers, customers… In Matlab, C, Java …. Property checking Done by R&D department In standard description Language, VHDL, Verilog. Done by HW designers

© Ghiath AL SAMMANE 8 Digital Hardware Design Process Functional Design RTL Design In Matlab, C, Java …. Property checking Done by R&D department In standard description Language, VHDL, Verilog. Done by HW designers RTL Verification By simulation, logical modeling & automatic reasoning Property checking Done by HW designers & verification experts

© Ghiath AL SAMMANE 9 By simulation, logical modeling & automatic reasoning Property checking Equivalence checking Done by HW designers & verification experts up to 75 % of design time ! Digital Hardware Design Process RTL Verification Synthesis & Optimization Post-Synthesis Verification Tech. mapping Place & route Fabrication Test & Packaging Post design process

© Ghiath AL SAMMANE 10 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 11 Designing Hardware in Mathematica Functional Design RTL Design In Mathematica, Matlab, C, Java …. Property checking Done by R&D department In standard description Language, VHDL, Verilog. Done by HW designers RTL Verification By simulation, logical modeling & automatic reasoning in Mathematica Property checking Done by HW designers & verification experts

© Ghiath AL SAMMANE 12 Designing HW in Mathematica  Functional Design –Writing the early algorithms, formulas & equations directly in Mathematica –Checking property by numerical & symbolic computation  RTL (register transfer level) design –Writing in standard VHDL –Simulating VHDL in Mathematica numerically & symbolically –Checking properties

© Ghiath AL SAMMANE 13 Designing HW in Mathematica  Functional Design –Writing the early algorithms, formulas & equations directly in Mathematica –Checking property by numerical & symbolic computation  RTL (register transfer level) design –Writing in standard VHDL –Simulating VHDL in Mathematica numerically & symbolically –Checking properties

© Ghiath AL SAMMANE 14 Designing HW in Mathematica  Functional Design –Writing the early algorithms, formulas & equations directly in Mathematica –Checking property by numerical & symbolic computation  RTL (register transfer level) design –Writing in standard VHDL –Simulating VHDL in Mathematica numerically & symbolically –Checking properties

© Ghiath AL SAMMANE 15 Designing HW in Mathematica  Functional Design –Writing the early algorithms, formulas & equations directly in Mathematica –Checking property by numerical & symbolic computation  RTL (register transfer level) design –Writing in standard VHDL –Simulating VHDL in Mathematica numerically & symbolically –Checking properties Finding bugs earlier  Less verification effort

© Ghiath AL SAMMANE 16 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 17 First step :VHDL in Mathematica  Modeling the semantic of a VHDL subset –The model must meet the VHDL synthesizable standard –Accept numeric & symbolic inputs –A hierarchical functional model  Simulating the VHDL descriptions –The same results in numeric cases as within standard simulators –Optimized for symbolic simulation  Checking properties about the symbolic results –Pattern matching, sat solving, BDD, theorem proving…

© Ghiath AL SAMMANE 18 Mathematica symbolic simulatior Results M-Code Simulation Constraints + Assertions Event-based Symbolic Simulator Constraints Resolution + symbolic Verification of assertions Simulation Rules VHDL File n simulation cycles Symbolic test cases Translator In Mathematica

© Ghiath AL SAMMANE 19 Mathematica symbolic simulatior Results M-Code Simulation Constraints + Assertions Event-based Symbolic Simulator Constraints Resolution + symbolic Verification of assertions Simulation Rules VHDL File n simulation cycles Symbolic test cases Translator In Mathematica

© Ghiath AL SAMMANE 20 A VHDL example A VHDL example : entity two_arbiter is port ( Clock : in bit; Reset : in bit; Req1 : in bit; Req2 : in bit; Ack1 : out bit; Ack2 : out bit); end two_arbiter ; Two requests arbiter Clock Reset Req1 Req2 Ack1 Ack2 Priority is given to the request Req2

© Ghiath AL SAMMANE 21 A VHDL example A VHDL example : architecture behavior of two_arbiter is begin -- behavior synchronous: process (clock, reset) begin -- process synchronous if reset = '0' then ack1<='0'; ack2<='0'; elsif clock'event and clock = '1' then -- rising clock edge if req1='1' and req2='0' then ack1<='1'; ack2<='0'; elsif req2='1' then ack2<='1'; ack1<='0'; else ack1<='0'; ack2<='0'; end if; end process synchronous; end behavior;

© Ghiath AL SAMMANE 22 The M-code  The Mathematica function that models the execution of the VHDL entity-architecture for one clock cycle  M-code (Mathematica COnditional DEscription)  Extracted automatically from the VHDL description  Hierarchy is supported

© Ghiath AL SAMMANE 23 The M-code of the example The Mathematica equivalent : Clear[two$arbiter$behavior]; SetAttributes[two$arbiter$behavior, HoldAll]; two$arbiter$behavior[ack1_, ack1$1_, ack2_, ack2$1_, clock_, clock$0_, req1_, req2_, reset_, reset$0_]:= A VHDL example : entity two_arbiter is port ( Clock : in bit; Reset : in bit; Req1 : in bit; Req2 : in bit; Ack1 : out bit; Ack2 : out bit); end two_arbiter ;

© Ghiath AL SAMMANE 24 The M-code of the example The Mathematica equivalent : Clear[two$arbiter$behavior]; SetAttributes[two$arbiter$behavior, HoldAll]; two$arbiter$behavior[ack1_, ack1$1_, ack2_, ack2$1_, clock_, clock$0_, req1_, req2_, reset_, reset$0_]:= A VHDL example : entity two_arbiter is port ( Clock : in bit; Reset : in bit; Req1 : in bit; Req2 : in bit; Ack1 : out bit; Ack2 : out bit); end two_arbiter ;

© Ghiath AL SAMMANE 25 The M-code of the example The Mathematica equivalent : Clear[two$arbiter$behavior]; SetAttributes[two$arbiter$behavior, HoldAll]; two$arbiter$behavior[ack1_, ack1$1_, ack2_, ack2$1_, clock_, clock$0_, req1_, req2_, reset_, reset$0_]:= A VHDL example : entity two_arbiter is port ( Clock : in bit; Reset : in bit; Req1 : in bit; Req2 : in bit; Ack1 : out bit; Ack2 : out bit); end two_arbiter ;

© Ghiath AL SAMMANE 26 The M-code of the example The Mathematica equivalent : Clear[two$arbiter$behavior]; SetAttributes[two$arbiter$behavior, HoldAll]; two$arbiter$behavior[ack1_, ack1$1_, ack2_, ack2$1_, clock_, clock$0_, req1_, req2_, reset_, reset$0_]:= A VHDL example : entity two_arbiter is port ( Clock : in bit; Reset : in bit; Req1 : in bit; Req2 : in bit; Ack1 : out bit; Ack2 : out bit); end two_arbiter ;

© Ghiath AL SAMMANE 27 Signal modeling  Three values are needed  The current value at time t, (S)  The old value at time (t-1), (S$0)  The next value at time (t+1), (S$1)  Old values are used only for detecting events (Sig(t)  Sig (t-1))

© Ghiath AL SAMMANE 28 The M-code body  Each concurrent statement in the architecture is rewritten as a sequential process  From these processes we extract automatically a list of assignments  One assignment for each object in the design :the transfer function of the object (signal or variable)  Simulates the behavior of the circuit for an abstract time unit called cycle

© Ghiath AL SAMMANE 29 Modeling assignments  The signal assignment function : NextSig[ S, F(S1,S2,…,Sn)]]  It gives the next value of S knowing the current and the old values of design objects (S1,S2,…,Sn)  F is an if-then-else expression (Ife)

© Ghiath AL SAMMANE 30 A VHDL example A VHDL example : architecture behavior of two_arbiter is begin -- behavior synchronous: process (clock, reset) begin -- process synchronous if reset = '0' then ack1<='0'; ack2<='0'; elsif clock'event and clock = '1' then -- rising clock edge if req1='1' and req2='0' then ack1<='1'; ack2<='0'; elsif req2='1' then ack2<='1'; ack1<='0'; else ack1<='0'; ack2<='0'; end if; end process synchronous; end behavior;

© Ghiath AL SAMMANE 31 The M-code of the architecture  The process is a set of signal assignments : {NextSig[ack1$1, Ife[equal[reset, 0], 0, Ife[and[event[clock], equal[clock, 1]], Ife[and[equal[req1, 1], equal[req2, 0]], 1, 0], ack1] ], NextSig[ack2$1, Ife[equal[reset, 0], 0, Ife[and[event[clock], equal[clock, 1]], Ife[and[equal[req1, 1], equal[req2, 0]], 0, Ife[equal[req2, 1], 1, 0] ], ack2]] ] }

© Ghiath AL SAMMANE 32 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 33 Second step : simulation VHDL Results M-Code Simulation Constraints + Assertions Event-based Symbolic Simulator Constraints Resolution + symbolic Verification of assertions Simulation Rules VHDL File n simulation cycles Symbolic test cases Translator In Mathematica Executing the M-code function for n cycle (clock cycle for synchronous circuits)

© Ghiath AL SAMMANE 34 Results M-Code Simulation Constraints + Assertions Event-based Symbolic Simulator Constraints Resolution + symbolic Verification of assertions Simulation Rules VHDL File n simulation cycles Symbolic test cases Translator In Mathematica Mathematica symbolic simulator During simulation : applying test cases and simulation rules

© Ghiath AL SAMMANE 35 Simulation algorithm Initialize(DesignObject) For cycle := 1 to n do Apply-test-vectors(inputs)Mcode(DesignObject) Verify(Assertion) Update(DesignObject) Print(SelectedResults) End for

© Ghiath AL SAMMANE 36 Simulation Rules  Used during the execution of M-code  Simplification rules –Ife[True,x_,_]  x; –Ife[False,_,y_]  y; –Ife[_,y_,y_]  y;  Normalization rules –Ife[Ife[a_,b_,c_],x_,y_]  Ife[a,Ife[b,x,y],Ife[c,x,y]];  Evaluation rules –Ife[cond_,x_,y_]  IFE[cond,Assuming[cond,simplify[x]],Assuming[Not[cond], simplify[y]]];

© Ghiath AL SAMMANE 37 The M-code of the architecture  The process is a set of signal assignments : {NextSig[ack1$1, Ife[equal[reset, 0], 0, Ife[and[event[clock], equal[clock, 1]], Ife[and[equal[req1, 1], equal[req2, 0]], 1, 0], ack1] ], NextSig[ack2$1, Ife[equal[reset, 0], 0, Ife[and[event[clock], equal[clock, 1]], Ife[and[equal[req1, 1], equal[req2, 0]], 0, Ife[equal[req2, 1], 1, 0] ], ack2]] ] }

© Ghiath AL SAMMANE 38 Simulation of the example  Most inputs are symbols, one simulation test case is equivalent to a lot of numeric ones  The symbolic expression of Ack1 –IFE[RESET == 0, 0, IFE[REQ1 == 1 && REQ2 == 0, 1, 0]]  The symbolic expression of Ack2 –IFE[RESET == 0, 0, IFE[REQ1 == 1 && REQ2 == 0, 0, IFE[REQ2 == 1, 1, 0]]]

© Ghiath AL SAMMANE 39 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 40 Checking properties  What can we do with huge If-then-else expressions? –The designer writes a property that the circuit should satisfy –After the simulation, the symbolic expression of the assertion should be evaluated to true or false  Property are checked by –Using comparison to direct specifications written in Mathematica –Using a Boolean prover in Mathematica –Using an external theorem prover

© Ghiath AL SAMMANE 41 Boolean prover in Mathematica  A prototype is under test  Take a normalized if-then-else and gives a counter example if the theorem is wrong and prove it otherwise  Built by the association of : –an implementation of the shared-BDD rewriting in Mathematica –Make use of the FindInstance function in Mathematica

© Ghiath AL SAMMANE 42 Checking properties of the example  mutex : assert not (Ack1 and Ack2)  serve : assert Req1 or Req2  Ack1 or Ack2  waste : assert Ack1  req1  waste : assert Ack2  req2  All these properties are proved by by our Boolean prover in Mathematica and by ACL2

© Ghiath AL SAMMANE 43 SatBit : checking the arbiter SatBit : Gives an example that the expression is satisfaisable, False other wise. In[24]:= SatBit[ack2] Sat, example: Out[24]= {{REQ1 -> 1, REQ2 -> 1, RESET -> 1}} In[25]:= SatBit[ack1&&ack2] Out[25]= False

© Ghiath AL SAMMANE 44 Proving properties by ACL2  An inductive theorem prover  An automatic link with Mathematica  The main function is ImpliesAcl2[p,q] –Prove by Acl2 that p  q Example: –ImpliesAcl2[ And[ bitp[REQ1, REQ2, RESET], RESET == 1,ack1 == 1 ], REQ1 == 1] True

© Ghiath AL SAMMANE 45 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 46 Successful applications  Validation on research and academic cases  Symbolic simulation and a verification of a network on chip (a university circuit)  Symbolic simulation of an industrial cryptographic component implementation  Symbolic simulation and property verification of a DRAM specification that comes from STMicroelectronics

© Ghiath AL SAMMANE 47 Outline  What is TIMA?  Digital hardware design process  Modeling Hardware in Mathematica  VHDL simulation in Mathematica  Verification & symbolic simulation  Property checking  Successful applications  Conclusion

© Ghiath AL SAMMANE 48 Conclusion : achievements  A VHDL to Mathematica compiler is built  A hardware simulator in Mathematica is implemented  We prove properties about results –A Boolean prover is implemented in Mathematica (automatic) –A link to an external theorem prover is achieved (expert in proof may be needed when proof fails)  Application on various industrial circuits

© Ghiath AL SAMMANE 49 Conclusion : What is next ?  Writing a user manual  Building an interface  Supporting Property Specification Language (PSL)  A Demo at DATE 2005 (Design Automation & Test in Europe)

© Ghiath AL SAMMANE 50 Thank you

© Ghiath AL SAMMANE 51 If-then-else expression (Ife) Ife_expr ::= Symbol | Number | True | False | Boolean_Expression | Arithmetic_Expression | Ife[Ife_expr, Ife_expr, Ife_expr]