SystemVerilog and Verification

Slides:



Advertisements
Similar presentations
CS 3850 Lecture 6 Tasks and Functions. 6.1 Tasks and Functions Tasks are like procedures in other programming languages. e. g., tasks may have zero or.
Advertisements

Simulation executable (simv)
Synchronous Sequential Logic
Combinational Logic.
Verilog Intro: Part 1.
Give qualifications of instructors: DAP
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
1 VERILOG Fundamentals Workshop סמסטר א ' תשע " ה מרצה : משה דורון הפקולטה להנדסה Workshop Objectives: Gain basic understanding of the essential concepts.
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
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.
SoC Verification HW #2 TA: Wei-Ting Tu Assignment: 04/12/06
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
SystemVerilog. History Enhancement of Verilog Enhancement of Verilog 2002 – accellera publishes SystemVerilog – accellera publishes SystemVerilog.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
1 SystemVerilog Enhancement Requests Daniel Schostak Principal Engineer February 26 th 2010.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
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.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics VHDL register-transfer modeling: –basics using traffic light controller; –synthesis.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
SVA Encapsulation in UVM enabling phase and configuration aware assertions by Mark Litterick Verification Consultant Verilab GmbH, Munich, Germany.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
Introduction to ASIC flow and Verilog HDL
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
Verification Presentation to SystemVerilog Basic Committee Peter Flake Nov 15, 2002.
1 A hardware description language is a computer language that is used to describe hardware. Two HDLs are widely used Verilog HDL VHDL (Very High Speed.
SUBJECT : DIGITAL ELECTRONICS CLASS : SEM 3(B) TOPIC : INTRODUCTION OF VHDL.
Structural Description
Overview Logistics Last lecture Today HW5 due today
Adapted from Krste Asanovic
IAY 0600 Digitaalsüsteemide disain
Discussion 2: More to discuss
Verilog Introduction Fall
Topics Modeling with hardware description languages (HDLs).
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Digital System Verification
‘if-else’ & ‘case’ Statements
IAY 0600 Digital Systems Design
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Topics Modeling with hardware description languages (HDLs).
Peter J. Ashenden The University of Adelaide
University of Washington EE400/590 Dean Wen Chen
Hardware Description Languages
ECE-C662 Introduction to Behavioral Synthesis Knapp Text Ch
VHDL Discussion Subprograms
SystemVerilog for Verification
VHDL Discussion Subprograms
Lecture 9: Testbench and Division
The Verilog Hardware Description Language
CS 153 Logic Design Lab Professor Ian G. Harris
The Verilog Hardware Description Language
Digital Designs – What does it take
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

SystemVerilog and Verification Cody Rigby

Topics What is SystemVerilog Differences from VHDL Features Constructing a Basic Testbench Topology in SystemVerilog Modules UVM SystemVerilog Verification Concepts Assertions Coverage

SystemVerilog Hardware Description and Verification Language (HDVL) combines features of HDL’s with features from C and C++ Borrows features from Verilog Superlog, VHDL, PSL, C, Vera, Most of the verification functionality is based on the OpenVera language by Synopsys Adopted as IEEE standard in 2005, most current version is IEEE standard 1800-2017 Can be used to describe hardware behavior but typically used for verification SystemVerilog is an Object Oriented language that supports a single-inheritance model Verification features allow for complex testbenching and random stimuli in simulation

SystemVerilog VHDL RTL Assertions Test Bench DPI C-style data types 7 control –enum, struct, typedef, ++ break return Yes Packages Yes Synthesis –friendly “concise” RTL notation No Interfaces No Systemverilog Assertions Yes Clocking Blocks No Object Oriented Programming –Classes No Constrained random stimulus generation No Function Coverage No Dynamic Processes, Dynamic arrays, queues, mailboxes, semaphores No Direct Programming Interface(DPI) –calling C from Systemverilog Yes RTL Assertions Test Bench DPI

SystemVerilog Types wire : acts like real write in circuits reg : holds values until another value is assigned, like register in hardware real, shortreal : single and double precision floating point numbers Time : 64 bit quantity used to hold simulation time Logic : improved version of reg from Verilog to SystemVerilog, can be driven by continuous assignments, gates and modules in addition to being a variable Two State Types : byte, bit, int, shortint, longint : improved performance and memory usage event : event is a handle to a synchronization object that can be passed around to routines, SystemVerilog introduces triggered function that lets you check whether an event has been triggered

SystemVerilog Data Structures Fixed Arrays : collection of variables all the same type bit [7:0] array4 [2:0];        //unpacked array declaration bit [2:0][7:0] array5;         //packed array declaration Vector width/dimensions declared before the object name referenced as packed array, array size/dimensions declared after object name is refereed as unpacked array Dynamic Arrays : one dimension of an unpacked array whose size can be set or changed at run-time data_type  array_name [ ]; data_type is the data type of the array elements. Methods for Dynamic Arrays new[ ]       -->  allocates the storage.  size( )       -->  returns the current size of a dynamic array. delete( )    -->  empties the array, resulting in a zero-sized array.

SystemVerilog Data Structures Queues: variable size, ordered collection of homogeneous elements. Queues can grow and shrink, supports adding and removing elements anywhere Queues are declared using the same syntax as unpacked arrays, but specifying $ as the array size, In queue 0 represents the first and $ represents the last entree Queue Declaration  data_type queue_name[$];  where:        data_type        -  data type of the queue elements.         queue_name    -  name of the queue. Mailboxes: mechanism to exchange messages between processes, data can be sent to a mailbox by one process and retrieved by another. Very effective in testbenches to transfer packets of data between modules

Blocking and Non-Blocking Assignments Executes in series order, uses ‘=’, blocks execution of next statement until completion of current assignment  initial begin     //initializing a and b     a = 10;     b = 15;           x = a + b;     y = a + b + x; Executes in parallel, uses ‘<=’, assignments occur at the same time (during the end of the simulation time stamp)   initial begin     //initializing a and b     a = 10;     b = 15;           x <= a + b;     y <= a + b + x;

SystemVerilog Control Flow Unique if : evaluates all the conditions in parallel Priority if : evaluates all the conditions in sequential order Loops: While/Do While, For Loop/For each break/continue etc., Repeat: executes statements for loop variable number of times Event Control : any change in a variable or net can be detected using the @ event module event_ctrl;   bit clk;   always #2 clk = ~clk;     //always block will be executed at every posedge of clk signal   always @(posedge clk)   begin     $display($time,"\tInside always block");   end

Processes Fork-join : will start all the processes inside it in parallel and wait for the completion of all processes Fork-Join_any will be un-blocked after the completion of any of the Process Fork-Join_none does not wait for the completion of Process inside the fork-join_none before following processes are executed

Tasks and Functions Function : must execute in one simulation time unit, cannot enable a Task, must have at least one input argument, returns a single value Task : can contain time-controlling statements, can enable tasks or functions, can have zero or more arguments, does not return a value (used for performing actions during simulation time)

Classes User defined data type that includes data, functions, and tasks that operate on data. Classes allow objects to be dynamically created, deleted assig and accessed via object handles.

Modules Basic building block that can be used in design or verification. RTL Design: contains synthesizable constructs which represents physical hardware, can be low level (logic gates) or complex (state machines) and can instantiate other design elements. RTL Testbench :contains top-level RTL DUT instance, interfaces, assertions and other components

Constructing a Basic Testbench Topology in SystemVerilog

Transaction Class Field required to generate stimulus are declared in transaction class Transaction class can also be used as placeholder for the activity monitored by monitor on DUT signals Generator sends transactions to be interpreted by the driver to provide stimulus to the DUT through the interface Monitor interprets outputs of the DUT into transactions then pushes them to the scoreboard

Interface Systemverilog construct to encapsulate communication between modules Can contain modports which provides direction information for module interface ports and controls the uses of tasks and functions within certain modules Shared by multiple entities (driver, monitor, etc.)

Driver Driver Class receives the stimulus from a generator in the form of a transaction through a shared mailbox Driver converts transaction level data to signal level activity

Monitor Samples the Interface signals and convert signal level activity to transaction level Sends transaction to scoreboard via mailbox

Score Board Scoreboard receives the sampled transaction from the monitor Used to perform the actual verification, is the output correct?

Generator Generates transactions that will be translated into stimulus for the DUT Sends generated transactions to driver over mailbox

Environment Contains instances of the generator, driver, monitor, and scoreboard, connects generators to drivers and monitors to scoreboard with mailboxes, and provides instance of the interface to all Main task which runs a test

Testbench and Test Test Bench is the top level entity and a module. Instantiates the DUT, interface and the test The test is a module that instantiates the environment and calls its run() procedure.

UVM SystemVerilog Universal Verification Methodology Provides framework for modular and layered verification components Developed and maintained by Accellera Consists of class libraries that allow for robust, reusable verification environments Used widely in industry for RTL verification

UVM Features Sequences : UVM gives comprehensive control on stimulus, can be developed by randomization, layered sequences, virtual sequences etc. (sequences of transactions) Stimulus/sequences are kept separate from actual testbench hierarchy. Uses TLM instead of mailbox Uses modular components, Driver, Sequencers, Agents, Env etc. Configuration class : database where all the parameters for the testbench hierarchy are located

Verification Concepts Simulation Verification : Verify that design meets spec for a given input stimuli Formal Verification : Verify that design meets spec for any valid input stimuli Equivalence Checking Model Checking

Model Checking Given a model of a system, exhaustively and automatically check whether this model meets a given specification as described by assertions Assertions are provided by the user that describe legal or illegal behavior Assertions include coverage properties that help ensure thoroughness of verification How to do this ? SystemVerilog Assertions (SVA)

Why use Assertions ? Reducing verification time Catch errors earlier Pinpointing sources of error

Types of Assertions Concurrent assertions must always be satisfied by a design. Temporal assertions must by satisfied by the design under certain defined (often clock-based) conditions. These conditions can either contain an individual set or a sequence of sets

SVA Immediate Assertion Example

SVA Concurrent Assertions SVA allows for concurrent assertions which detect behaviors over a period of time Evaluation of concurrent assertions are associated with clock edges 4 Layers: Boolean Expression Layer : evaluates a single expression to be true or false Sequence Layer : sequence of Boolean expressions over time Property Layer : defines a behavior of the design defined elsewhere Assertion Layer : asserts the property

Example : sequence seq; a ##2 b; endsequence property p; @(posedge clk) seq; endproperty a_1 : assert property(p);

Coverage: Coverage is used to measure tested and untested portions of the design. Defined by the percentage of objective that have been met Two Types : Code Coverage: How much of the design code is exercised, Number of lines, conditions, States in FSM, paths taken etc. Functional Coverage: User defined metric: Data-oriented : values of inputs and outputs Control-oriented Coverage : checks for sequences of behaviors

SVA Coverage Defined by creating coverage points using the covergroup construct Cover point is an expression or a variable, each associated with a bin Bins increment if the condition given to that cover point is satisfied

References https://www.verificationguide.com/