SVA Encapsulation in UVM enabling phase and configuration aware assertions by Mark Litterick Verification Consultant Verilab GmbH, Munich, Germany.

Slides:



Advertisements
Similar presentations
Determining Test Quality through Dynamic Runtime Monitoring of SystemVerilog Assertions Kelly D. Larson
Advertisements

© Copyright 2013 Xilinx. How to Kill 4 Birds with 1 Stone: Using Formal Verification to Validate Legal Configurations, Find Design Bugs, and Improve Testbench.
VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Hub The Only Co-Simulation Tool of Its Kind on the Market The Only Co-Simulation Tool of Its Kind on the Market.
Chapter 15:Introduction to Verilog Testbenches Objectives In this section,you will learn about designing a testbench: Creating clocks Including files Strategic.
Simulation executable (simv)
Combinational Logic.
Using emulation for RTL performance verification
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 07: Verilog (3/3) Prof. Sherief Reda Division of.
Parag Goel Sr. Corporate Application Engineer Synopsys India Pvt. Ltd.
Verification SV3.1a Assumptions Surrendra Dudani Nov. 14, 2003 Synopsys, Inc.
Xiushan Feng* ASIC Verification Nvidia Corporation Automatic Verification of Dependency 1 TM Jayanta Bhadra
by Adiel Khan Staff CAE Synopsys
Lecture 1 Introduction to the ABAP Workbench
Reporter:PCLee With a significant increase in the design complexity of cores and associated communication among them, post-silicon validation.
Module 20 Troubleshooting Common SQL Server 2008 R2 Administrative Issues.
Universal Verification Methodology (UVM) Benefits Mustafa Khairallah Boost Valley Boost Valley Consulting 1.
Easy Steps Towards Virtual Prototyping using the SystemVerilog DPI
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.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 2 Microcomputer Systems Design (Embedded Systems)
ELEN 468 Lecture 91 ELEN 468 Advanced Logic Design Lecture 9 Behavioral Descriptions III.
Assertions in OpenVera Assertions check for the occurrence of sequences during simulation Sequence is an ordered (maybe timed) series of boolean events.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Design Synopsys System Verilog API Donations to Accellera João Geada.
Gaurav Gupta Freescale Semiconductors Adiel Khan, Parag Goel, Amit Sharma, Varun S, Abhisek Verma Synopsys
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
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.
New and active ways to bind to your design by Kaiming Ho Fraunhofer IIS.
L16 – Testbenches for state machines. VHDL Language Elements  More examples HDL coding of class examples Testbench for example  Testing of examples.
Using Formal Verification to Exhaustively Verify SoC Assemblies by Mark Handover Kenny Ranerup Applications Engineer ASIC Consultant Mentor Graphics Corp.
SoC Verification HW #2 TA: Wei-Ting Tu Assignment: 04/12/06
System Verilog Testbench Language David W. Smith Synopsys Scientist
Assertion Based Testing. Testing and verification Does the design function according to the specifications? Example.
SystemVerilog. History Enhancement of Verilog Enhancement of Verilog 2002 – accellera publishes SystemVerilog – accellera publishes SystemVerilog.
Copyright © Bluespec Inc Bluespec SystemVerilog™ Design Example A DMA Controller with a Socket Interface.
SystemVerilog and UVM for the ABC system verification Francis Anghinolfi 14 Nov 2013 SystemVerilog MiniWorkshop.
Robust Low Power VLSI ECE 7502 S2015 Evaluation of Coverage-Driven Random Verification ECE 7502 – Project Presentation Qing Qin 04/23/2015.
Optimization of Verification Effort using Reusable Sequence Collection Dipesh Handa Gaurav Chugh Gaurav Minda Kumar Rajeev Ranjan.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
1 SystemVerilog Enhancement Requests Daniel Schostak Principal Engineer February 26 th 2010.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
Boost Verification Results by Bridging the Hw/Sw Testbench Gap by Matthew Ballance Verification Technologist Mentor Graphics.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
LHCb Software Week November 2003 Gennady Kuznetsov Production Manager Tools (New Architecture)
Conformance Test Experiments for Distributed Real-Time Systems Rachel Cardell-Oliver Complex Systems Group Department of Computer Science & Software Engineering.
Memory Subsystem verification – Can it be taken for granted ?
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.
Object-Oriented Programming Chapter Chapter
Assignment write a short notes on 1.Manufacturing Testing. 2.Functional Testing. 3.Files and Text I/O. 4.Differentiate the cpld and fpga architecture.
Part A Final Dor Obstbaum Kami Elbaz Advisor: Moshe Porian August 2012 FPGA S ETTING U SING F LASH.
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.
Architecture optimization and design verification of the Timepix3 and the Velopix pixel ASICs Tuomas Poikela (TUCS/CERN) SV/UVM Mini workshop.
The PLA Model: On the Combination of Product-Line Analyses 강태준.
Register This! Experiences Applying UVM Registers
System on Chip Design and Test ECE 715
Verilog Introduction Fall
Inheritance and Polymorphism
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
OVM & UVM Techniques for On-the-fly Reset
UVM-Multi-Language Hands-On
Stitching UVM Test benches into Integration-Level
February 25-28, 2013 DoubleTree, San Jose
Stitching UVM Test benches into Integration-Level
Yet Another Memory Manager
Yet Another Memory Manager
SystemVerilog for Verification
The Verilog Hardware Description Language
SystemVerilog and Verification
Presentation transcript:

SVA Encapsulation in UVM enabling phase and configuration aware assertions by Mark Litterick Verification Consultant Verilab GmbH, Munich, Germany

Sponsored By: 2 of 19 Introduction Motivation –inconsistent SVA setup across clients & projects –many protocols where adaptive SVA required SVA encapsulation in UVM –why, what & where? Techniques for making SVA configuration-aware –why & how? Techniques for making SVA phase-aware –automatically self-configuring SVA checks –initial build and dynamic run-time configuration

Sponsored By: 3 of 19 Types of UVC checks: –signal protocol and timing –transaction content and functional correctness –transaction comparison and relationships Each is handled by different component DUT I/F UVC AGENT S D VIF M C SVA SB ENV Distributed UVC Checks TRANSACTION COMPARISONS TRANSACTION CONTENT SIGNAL PROTOCOL All checks belong to UVC Concurrent assertions are not allowed in SystemVerilog classes

Sponsored By: 4 of 19 Check Configuration & Control All checks can be affected by: –control knobs (e.g. checks_enable) –config fields (e.g. cfg.mode) Configuration object fields can be: –constant after build-phase –dynamic during run-phase class my_test... uvm_config_db#(my_config)::set (this,"*","cfg",cfg); uvm_config_db#(bit)::set (this,"*","checks_enable",0); class my_test... uvm_config_db#(my_config)::set (this,"*","cfg",cfg); uvm_config_db#(bit)::set (this,"*","checks_enable",0); class my_monitor... if (checks_enable) trans.check_crc(); class my_monitor... if (checks_enable) trans.check_crc(); class my_monitor... trans.check_parity( cfg.odd_even ); class my_monitor... trans.check_parity( cfg.odd_even ); class my_monitor... if (condition) // update config cfg.speed_mode = FAST; class my_monitor... if (condition) // update config cfg.speed_mode = FAST;

Sponsored By: 5 of 19 SVA Configuration & Control sequence s_fast_transfer; REQ ##1 !REQ[*1:4] ##0 ACK; endsequence sequence s_slow_transfer; REQ ##1 !REQ[*3:10] ##0 ACK; endsequence property CLK) disable iff (!checks_enable) REQ |-> if (cfg_speed_mode == FAST) s_fast_transfer; else s_slow_transfer; endproperty a_transfer: assert property (p_transfer) else $error(“illegal transfer”); sequence s_fast_transfer; REQ ##1 !REQ[*1:4] ##0 ACK; endsequence sequence s_slow_transfer; REQ ##1 !REQ[*3:10] ##0 ACK; endsequence property CLK) disable iff (!checks_enable) REQ |-> if (cfg_speed_mode == FAST) s_fast_transfer; else s_slow_transfer; endproperty a_transfer: assert property (p_transfer) else $error(“illegal transfer”); no class variables in concurrent assertions no class variables in concurrent assertions range operators must be constants range operators must be constants local variables used for SVA cfg copied to local variables cfg.speed_mode is not allowed CONTROL KNOB CONFIG FIELD

Sponsored By: 6 of 19 SVA Interface VIF D M AGENT UVC DU T TESTBENCH MODULE I/F OTHER AGENTS OTHER UVCS ENV OTHER I/F config db +SVA VIF config_db::set config_db::get... but what about SVA? this interface is required for UVC-DUT signals

Sponsored By: 7 of 19 SVA Encapsulation interface my_interface; // local signal definitions // modport declarations // clocking blocks // bus-functional methods // support code for SVA // property definitions // assertion statements endinterface interface my_interface; // local signal definitions // modport declarations // clocking blocks // bus-functional methods // support code for SVA // property definitions // assertion statements endinterface => isolate and encapsulate SVA SVA code is verbose, complex & not related to signal communication SVA checks create clutter in interface construct Lines of Code

Sponsored By: 8 of 19 Interface in Interface I/F interface my_interface; // local signals logic CLK; logic REQ; logic ACK; logic [7:0] DATA; logic OTHER;... // modports, etc.... // protocol checker my_sva_checker sva_checker(.*); endinterface interface my_interface; // local signals logic CLK; logic REQ; logic ACK; logic [7:0] DATA; logic OTHER;... // modports, etc.... // protocol checker my_sva_checker sva_checker(.*); endinterface required signal subset well encapsulated interface my_sva_checker( // signal ports input logic CLK, input logic REQ, input logic ACK, input logic [7:0] DATA ); // support code // properties // assertions endinterface interface my_sva_checker( // signal ports input logic CLK, input logic REQ, input logic ACK, input logic [7:0] DATA ); // support code // properties // assertions endinterface SVA implicit instantiation ports have same name as interface signals (but can be a subset) module not allowed inside interface => use interface

Sponsored By: 9 of 19 VIF MON AGENT UVC DUT TESTBENCH MODULE INTERFACE C SVA C C SVA Configuration interface my_sva_checker(...); // control knobs bit checks_enable = 1; // config object my_config cfg; // local variables for SVA my_speed_enum cfg_speed_mode; int unsigned cfg_max_value; bit cfg_data_en; // properties and assertions... // update local vars from cfg... endinterface interface my_sva_checker(...); // control knobs bit checks_enable = 1; // config object my_config cfg; // local variables for SVA my_speed_enum cfg_speed_mode; int unsigned cfg_max_value; bit cfg_data_en; // properties and assertions... // update local vars from cfg... endinterface C No class variables inside concurrent assertions No class variables inside concurrent assertions class variables are allowed in support code when is config class built? Interface is not a phased component CONTROL KNOBS CONFIG FIELDS

Sponsored By: 10 of 19 Method API VIF MON AGENT UVC DUT TESTBENCH MODULE INTERFACE C SVA C C C push CFG from class environment to SVA interface manual operation and only partially encapsulated by interfaces

Sponsored By: 11 of 19 Interface Methods interface my_sva_checker(...);... function void set_config (my_config cfg); cfg_speed_mode = cfg.speed_mode; cfg_max_value = cfg.max_value; cfg_data_en = cfg.data_en; endfunction function void set_checks_enable (bit en); checks_enable = en; endfunction... endinterface interface my_sva_checker(...);... function void set_config (my_config cfg); cfg_speed_mode = cfg.speed_mode; cfg_max_value = cfg.max_value; cfg_data_en = cfg.data_en; endfunction function void set_checks_enable (bit en); checks_enable = en; endfunction... endinterface required fields well encapsulated interface my_interface;... function void set_config(my_config cfg); sva_checker.set_config(cfg); endfunction function void set_checks_enable(bit en); sva_checker.set_checks_enable(en); endfunction... endinterface interface my_interface;... function void set_config(my_config cfg); sva_checker.set_config(cfg); endfunction function void set_checks_enable(bit en); sva_checker.set_checks_enable(en); endfunction... endinterface user API via VIF methods VIF MON C INTERFACE SVA C internal SVA details well hidden

Sponsored By: 12 of 19 API – Initial Configuration class my_monitor extends uvm_monitor;... function void end_of_elaboration_phase(...);... // set interface config after build vif.set_config(cfg); vif.set_checks_enable(checks_enable); endfunction... endclass class my_monitor extends uvm_monitor;... function void end_of_elaboration_phase(...);... // set interface config after build vif.set_config(cfg); vif.set_checks_enable(checks_enable); endfunction... endclass could be done in agent or monitor must be after VIF assigned call set_* methods via virtual interface after build and connect call set_* methods via virtual interface after build and connect

Sponsored By: 13 of 19 API – Dynamic Configuration class my_monitor extends uvm_monitor;... task run_phase(...); forever begin... if (cfg updated) vif.set_config(cfg); end endtask endclass class my_monitor extends uvm_monitor;... task run_phase(...); forever begin... if (cfg updated) vif.set_config(cfg); end endtask endclass must be PASSIVE component additional work for monitor hard to debug if done wrong call set_config via virtual interface when update required call set_config via virtual interface when update required

Sponsored By: 14 of 19 Phase-Aware Interface VIF MON AGENT UVC DUT TESTBENCH MODULE INTERFACE C SVA C C C reference CFG from class environment inside SVA interface automatic and fully encapsulated in interface

Sponsored By: 15 of 19 Class Inside SVA Interface UVC INTERFACE SVA C CLASS interface my_sva_checker(...); // declare local variables (cfg, checks_enabled, etc.)... class checker_phaser extends uvm_component; // use local variables (cfg, checks_enabled, etc.) // use UVM phases (build, connect, run, etc.) endclass // construct unique instance of phaser class // (at the top-level under uvm_top) checker_phaser m_phase = new($psprintf("%m.m_phase")); endinterface interface my_sva_checker(...); // declare local variables (cfg, checks_enabled, etc.)... class checker_phaser extends uvm_component; // use local variables (cfg, checks_enabled, etc.) // use UVM phases (build, connect, run, etc.) endclass // construct unique instance of phaser class // (at the top-level under uvm_top) checker_phaser m_phase = new($psprintf("%m.m_phase")); endinterface unique name provides better debug messages class is UVM phased component locally declared class can see all local variables in interface unique name required for multiple instances

Sponsored By: 16 of 19 Parallel Phases SVA interface class in parallel with main env under uvm_top UVM_TOP SVA CLASS ENV CLASS build connect elaboration run UVM phase potential race scenario UVM phases run in parallel... but order of build phase completion cannot be predicted! both build phases complete before either connect phase starts

Sponsored By: 17 of 19 SVA Class – Initial Configuration class checker_phaser extends uvm_component;... function void end_of_elaboration_phase(...);... if (!uvm_config_db#(my_config)::get(this,"”,"cfg”,cfg)) `uvm_fatal(“CFGERR”,”no my_config cfg in db”) void'(uvm_config_db#(bit)::get (this,"”,"checks_enable”,checks_enable)); cfg_speed_mode = cfg.speed_mode; cfg_max_value = cfg.max_value; cfg_data_en = cfg.data_en; endfunction endclass class checker_phaser extends uvm_component;... function void end_of_elaboration_phase(...);... if (!uvm_config_db#(my_config)::get(this,"”,"cfg”,cfg)) `uvm_fatal(“CFGERR”,”no my_config cfg in db”) void'(uvm_config_db#(bit)::get (this,"”,"checks_enable”,checks_enable)); cfg_speed_mode = cfg.speed_mode; cfg_max_value = cfg.max_value; cfg_data_en = cfg.data_en; endfunction endclass copy required cfg fields to local variables for use in SVA checks_enable may be overloaded by db cfg must be provided by db use end_of_elaboration_phase to avoid race condition required cfg fully encapsulated no demands on monitor class

Sponsored By: 18 of 19 Class – Dynamic Configuration interface my_sva_checker(...);... or cfg.data_en) begin cfg_speed_mode = cfg.speed_mode; cfg_data_en = cfg.data_en; end endinterface interface my_sva_checker(...);... or cfg.data_en) begin cfg_speed_mode = cfg.speed_mode; cfg_data_en = cfg.data_en; end endinterface class checker_phaser...;... task run_phase(...);... forever or cfg.data_en) begin cfg_speed_mode = cfg.speed_mode; cfg_data_en = cfg.data_en; end `uvm_info(“CFG”,”cfg updated”,UVM_LOW) end endtask endclass class checker_phaser...;... task run_phase(...);... forever or cfg.data_en) begin cfg_speed_mode = cfg.speed_mode; cfg_data_en = cfg.data_en; end `uvm_info(“CFG”,”cfg updated”,UVM_LOW) end endtask endclass use run_phase to check for dynamic cfg changes and always_comb in do not work since cfg is null at start of simulation only required dynamic cfg fields do not work (cfg object does not change only fields inside the object) detect change in cfg object

Sponsored By: 19 of 19 Conclusion Practical suggestions for SVA encapsulation –basic encapsulation inside interface Demonstrated solutions for configuration-aware SVA –API with demands on UVC class –phase-aware SVA checker with embedded class Successfully used in both OVM and UVM projects Validated with multiple tools in different clients