Some Course Info Jean-Michel Chabloz. Main idea This is a course on writing efficient testbenches Very lab-centric course: –You are supposed to learn.

Slides:



Advertisements
Similar presentations
ENEL111 Digital Electronics
Advertisements

Xiushan Feng* ASIC Verification Nvidia Corporation Automatic Verification of Dependency 1 TM Jayanta Bhadra
by Adiel Khan Staff CAE Synopsys
February 28 – March 3, 2011 Stepwise Refinement and Reuse: The Key to ESL Ashok B. Mehta Senior Manager (DTP/SJDMP) TSMC Technology, Inc. Mark Glasser.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Evolution and History of Programming Languages Software/Hardware/System.
MS-SoC Best Practices – Advanced Modeling & Verification Techniques for first-pass success By Neyaz Khan Greg Glennon Dan Romaine.
Spring 07, Feb 6 ELEC 7770: Advanced VLSI Design (Agrawal) 1 ELEC 7770 Advanced VLSI Design Spring 2007 Verification Vishwani D. Agrawal James J. Danaher.
Design For Verification Synopsys Inc, April 2003.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 7 - Verification.
1 Assertion Based Verification 2 The Design and Verification Gap  The number of transistors on a chip increases approximately 58% per year, according.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Fundamentals of Simulation-Based Verification 1.Structure of a Testbench - stimulus, checkers, etc. 2.Observation and Assertions - automatic checking of.
2/9/2007EECS150 Lab Lecture #41 Debugging EECS150 Spring2007 – Lab Lecture #4 Laura Pelton Greg Gibeling.
EE694v-Verification-Lect5-1- Lecture 5 - Verification Tools Automation improves the efficiency and reliability of the verification process Some tools,
Principle of Functional Verification Chapter 1~3 Presenter : Fu-Ching Yang.
02/10/06EECS150 Lab Lecture #41 Debugging EECS150 Spring 2006 – Lab Lecture #4 Philip Godoy Greg Gibeling.
Introduction to Software Testing
VerificationTechniques for Macro Blocks (IP) Overview Inspection as Verification Adversarial Testing Testbench Design Timing Verification.
C++ Crash Course Class 1 What is programming?. What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine.
Software Construction. Implementation System Specification Requirements Analysis Architectural Design Detailed Design Coding & Debugging Unit Testing.
Language Evaluation Criteria
ASIC/FPGA design flow. FPGA Design Flow Detailed (RTL) Design Detailed (RTL) Design Ideas (Specifications) Design Ideas (Specifications) Device Programming.
Copyright © 2002 Qualis Design Corporation Industry and Textbook Overview Qualis Design Corporation PO Box 4444 Beaverton, Oregon USA Phone:
Using Formal Verification to Exhaustively Verify SoC Assemblies by Mark Handover Kenny Ranerup Applications Engineer ASIC Consultant Mentor Graphics Corp.
Digital System Verification. VERIFICATION OUTLINE Purpose of Verification –Verification effort and cost Verification Tools –Linting tools –Code Coverage.
SystemVerilog. History Enhancement of Verilog Enhancement of Verilog 2002 – accellera publishes SystemVerilog – accellera publishes SystemVerilog.
1 Hybrid-Formal Coverage Convergence Dan Benua Synopsys Verification Group January 18, 2010.
© 2012 xtUML.org Bill Chown – Mentor Graphics Model Driven Engineering.
Functional Verification Figure 1.1 p 6 Detection of errors in the design Before fab for design errors, after fab for physical errors.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Boost Verification Results by Bridging the Hw/Sw Testbench Gap by Matthew Ballance Verification Technologist Mentor Graphics.
Slide 1 2. Verilog Elements. Slide 2 Why (V)HDL? (VHDL, Verilog etc.), Karen Parnell, Nick Mehta, “Programmable Logic Design Quick Start Handbook”, Xilinx.
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
Assertions Jean-Michel Chabloz. Assertions basic Idea We assert that a certain “thing” should be true. –If it is true, fine –If it is false, then we get.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
An Overview of Hardware Design Methodology Ian Mitchelle De Vera.
Verification – The importance
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics Modeling with hardware description languages (HDLs).
ECE-C662 Lecture 2 Prawat Nagvajara
Modern VLSI Design 3e: Chapter 8 Copyright  1998, 2002 Prentice Hall PTR Topics n Modeling with hardware description languages (HDLs).
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
EE694v-Verification-Lect7-1- Verification Plan & Levels of Verification The Verification Plan Yesterdays and today’s design environment Design specification.
FPGA-Based System Design Copyright  2004 Prentice Hall PTR Topics n Modeling with hardware description languages (HDLs).
Chapter 11 System-Level Verification Issues. The Importance of Verification Verifying at the system level is the last opportunity to find errors before.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Architecture optimization and design verification of the Timepix3 and the Velopix pixel ASICs Tuomas Poikela (TUCS/CERN) SV/UVM Mini workshop.
ASIC/FPGA design flow. Design Flow Detailed Design Detailed Design Ideas Design Ideas Device Programming Device Programming Timing Simulation Timing Simulation.
Problem: design complexity advances in a pace that far exceeds the pace in which verification technology advances. More accurately: (verification complexity)
Introduction to the FPGA and Labs
ASIC Design Methodology
Topics Modeling with hardware description languages (HDLs).
Digital System Verification
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Topics Modeling with hardware description languages (HDLs).
Teaching The Art of Verification
ECE-C662 Introduction to Behavioral Synthesis Knapp Text Ch
SystemVerilog for Verification
Verification Plan & Levels of Verification
EECS150 Fall 2007 – Lab Lecture #4 Shah Bawany
Debugging EECS150 Fall Lab Lecture #4 Sarah Swisher
Lecture 9: Testbench and Division
Debugging EECS150 Fall Lab Lecture #4 Sarah Swisher
SystemVerilog and Verification
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.
CSE 1020:Software Development
Digital Designs – What does it take
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Presentation transcript:

Some Course Info Jean-Michel Chabloz

Main idea This is a course on writing efficient testbenches Very lab-centric course: –You are supposed to learn through the labs – best way to understand and fix concepts –Lectures give you the concepts and the tools (SystemVerilog) to run the labs –One complete verification project running through the entire course, designed to be as industry-like as possible –Lectures include discussions about the labs and hands-on tutorials by the teacher –Exam is supposed to be easy if you can do the labs on your own

Verification Basics Jean-Michel Chabloz

ASIC design flow Goes in order through the following steps: –Specifications/System Design –Register Transfer Level –Netlist –Layout –Physical chip

ASIC design flow From specs to RTL: –human translation From RTL to Netlist to Layout to Physical: –mostly automated translation (considered a solved – or mostly solved - problem) –If RTL is bug-free, the physical chip will work The main source of bugs is the specs-to- RTL translation

Software design flow Goes in order through the following steps: –Specifications –High-level language (C,...) –Low-level language (assembly) –Machine language Only the specs-to-high language translation is made mostly by humans If high-level language is correct, the machine language will work

Software implementation flow The high-level language to machine-language flow is: –Fast –Inexpensive Software flow: 1)Write HL language 2)Translate HL language to machine language 3)Run machine language and find bugs 4)Fix HL language 5)Translate HL language to machine language 6)Run machine language and find bugs 7)Repeat from 4 until finished

FPGA implementation flow Can use something similar to software: 1)Write RTL language 2)Translate RTL language to gates and implement in FPGA 3)Run FPGA language and find bugs 4)Fix RTL language 5)Translate RTL language to gates and implement in FPGA 6)Run FPGA and find bugs 7)Repeat from 4 until finished

ASIC implementation flow 1)Write RTL language 2)Simulate RTL and find bugs 3)Fix RTL language 4)Simulate RTL and find bugs 5)Repeat from 3 until finished 6)Synthesize, make layout, implement chip

Validation vs Verification Validation: –are we making the right thing, that will answer to the needs of the user? –are the specs right? Verification: –are we making what we wanted to make? –is the model equivalent to the specs? We consider only verification

Verification plan Plan of all what should be verified in a DUT Should include all possible features and potential sources of bugs When all tests in the verification plan have been tested and no bugs were found, then the verification work is over

Checking RTL to spec equivalence The person (team) who wrote the RTL must not be the one who checks it correctness Else, bugs might not be found due to double-mistake in interpreting the specs In case of error, the mistake in interpreting the specs might be due to both the designer and the verifier

Formal vs simulation-based verification Formal verification is a new paradigm: –Tools prove that the RTL is equivalent to a high-level model or that it satisfies certain properties –No need for simulation –Might one day totally substitute simulation- based verification We consider only simulation-based verification

Verification models Basic model: give inputs, check outputs - black box verification We might use white-box verification (give inputs, check internal signals) Or grey-box verification (give inputs, check some internal signals specifically inserted for debug purpose)

Verification ~70% of effort when developing RTL – trend: growing Testbenches are more complex than RTL models Growth of testbench complexity is more than linear with RTL complexity. –example: 10 state machines with 4 states: 4^10 total states 20 state machines with 4 states: 4^20 total states 10 state machines with 8 states: 8^10 total states Have to test the RTL model under situations similar to those that the manufactured chip will encounter during use (have to develop a “model of the universe”)

Needs of verification language very different needs from RTL –RTL: language must be simple enough for the “stupid” synthesis tools to understand them and know how to synthesize them ex – fifo: put a RAM, use pointer A, pointer B, increment pointers when reading or writing –Verification: language must be super-powerful to be able to implement quickly and efficiently the “model of the universe”, no need to be understood by synthesis tools ex – fifo: virtual storage with push and pop

Hardware description languages VHDL/Verilog developed in the 1980s good languages for RTL design – synthesizable code very few non-synthesizable constructs for writing testbenches

Hardware verification languages e/Vera Developed in the 1990s Only high-level constructs, impossible to write RTL code People had to mix VHDL/Verilog RTL models with e/Vera testbenches HVL cover three main features lacking in HDLs: –Random constrained stimuli generation –Assertions –Functional coverage

Random Constrained Stimuli Generation Not to be confused with the “random” construct in Verilog/VHDL Main idea: –define random variables and constraints –ask the “random solver” to find a random set of variables that satisfies the constraints –constraints can be added, disabled to create different tests

Random Constrained Stimuli Generation example: –random bit a –random integers b, c between 0 and 255 –constraint CA: if a=1 then (b+c)!=256 –constraint CB: b>c It would be hard to make a routine to randomly generate one of the legal combinations using only direct randomization of variables

Assertions Tools for automatic checking of properties “automated waveform checker” Example: –when req goes at one grant must be 1 between 2 and 3 cycles later –req must never be at one for more than two consecutive cycles Can be used in testbenches or “bundled” with the RTL to check input correctness

Functional Coverage Testing if the testbench is good enough Did we do all the tests that we wanted to do based on our verification plan? Example: –A crossbar can put in correspondence all inputs with all outputs –Did we try all combination of input/outputs? –With functional coverage we can record how many times all combinations of input/outputs were tested, and see the results in a report

Code Coverage Except functional coverage, there are other coverage metrics that are tool features and can be used independently on the language These do not require to write code to enable coverage Statement coverage: has every statement in the DUT be executed? Path coverage: have all paths been followed? Expression coverage: have all causes for control-flow change been tried? FSM coverage: has every state in an FSM be visited?

Code coverage – Statement coverage y if (a>1 || b>1) begin y c <= d; y d <= d+1; y end y else begin y if (a==2) begin n d <= d-1; y end y else y d <= d-2; y end

Code coverage – Path coverage if (a>1 && b>1) begin c <= d; d <= d+1; end if (a>2) begin if (a==3) begin d <= d-1; end else d <= d-2; end Run 1

Code coverage – Path coverage if (a>1 && b>1) begin c <= d; d <= d+1; end if (a>2) begin if (a==3) begin d <= d-1; end else d <= d-2; end Run 2

Code coverage – Path coverage if (a>1 && b>1) begin c <= d; d <= d+1; end if (a>2) begin if (a==3) begin d <= d-1; end else d <= d-2; end At the end of all the runs, we find out this legal path was not exercised

Code coverage – expression coverage if ((a>1 && b>1) || (a<0) || (b<0)) begin c <= d; d <= d+1; end All statements were executed (100% statement coverage), but not all values for the expressions became true

Code coverage - FSM coverage Checks if all states in a state machine were exercised

Directed tests Testbenches without randomness, targeting a specific item in the verification plan. Example: –write in the fifo for 16 cycles after each other, check that the fifo is full, then read all 16 elements, check that it is empty If the design is complex enough, it is impossible to cover all features with directed testbenches

Random verification 1)Generate random tests using random constrained stimuli generation 2)Check for bugs and correct them if there are 3)Check for the coverage values. If not satisfying, add constraints and repeat from 1 Note: some directed testbenches might be necessary to cover the corner cases

SystemVerilog Hardware description and verification language Superset of Verilog – all Verilog systems work in SystemVerilog First standardized by IEEE in : IEEE standard –Download the standard –“Holy book of SystemVerilog” –Answer to all of your questions are inside –Good for reference, not for learning SystemVerilog “is” the standard IEEE –Simulators/Synthesizers implementations might be incomplete

SystemVerilog RTL subset of the language: –small superset of the Verilog RTL subset – some constructs have been inserted to simplify different things Verification subset of the language: –very very very big superset of Verilog Object-oriented constructs Random constrained stimuli generation Assertions Functional Coverage

SystemVerilog SystemVerilog testbenches can be used to test SystemVerilog RTL models, but can also be used to test VHDL/Verilog RTL models – mixed-language simulation

Testbenches Basic model: give inputs, read outputs The element to test is called DUT (Design Under Test) or DUV (Design Under Verification) Inputs generatorRTL modelOutputs checker

Testbench structuring It is important to conceptually divide testbenches into blocks, depending on the function: –Generator of high-level input data (example: we decide to send out 4 packets of 1024 bytes followed by 2 packets of 64 bytes) –Driver: read the high-level input data and drive the DUT input ports. –Output monitor: read data from the DUT’s output ports. –Output checking: check correctness of the output This allows easier readability and reuse. If the DUT input protocol change, only the driver must change. This requirement is most important for big systems, with a lot of reuse and many people working on it.

Structured testbenches Inputs driver Gives the inputs to The DUT RTL model Outputs monitor Reads the outputs and Translates into HL Outputs checker Checks outputs with Expected HL outputs Generator of High-level inputs

Testbenches Often a golden model can be used: Golden model and RTL must be developed by different teams, errors might be in both Inputs driver Gives the inputs to The DUT RTL model Outputs monitor Reads the outputs and Translates into HL Outputs checker Checks outputs with Expected HL outputs Generator of High-level inputs Golden model (matlab, TLM, Timed, untimed, …)

Collection of IPs Each IP must first be verified at block-level Then top-level verification follows Verification systems for IPs are packaged into VIPs (Verification IPs), with drivers, monitors, assertions to check input correctness, high-level models, etc. A scoreboard keeps track of which tests have been run and coverage Possible to build a chip in which only some components are RTL, the others are golden models Using VIPs it is easy to build fast complex models of what is around a block or a chip SoC Verification

UVM Universal Verification Methodology Methodology on top of SystemVerilog that automates all this Key focus: reuse Components are enclosed into agents, containing checkers, monitors, drivers, etc. A chip can be built connecting together the different VIPs We do not consider UVM, it is only adapted to complex systems – for the testbench complexity level used in the course labs, some form of “conceptual” division between testbench blocks is considered sufficient.