SystemVerilog Assertions in the Design Process 213

Similar documents
7.3 Case Study - FV of a traffic light controller

Operating in a Mixed-language Environment Using HDL, C/C++, SystemC and SystemVerilog

Leveraging Formal Verification Throughout the Entire Design Cycle

INTROSPECTION INTO SYSTEMVERILOG WITHOUT TURNING IT INSIDE OUT. Dave Rich

7.3.3 Same Inputs in Antecedent and Consequent

Focussing Assertion Based Verification Effort for Best Results

Simulation-Based FlexRay TM Conformance Testing an OVM success story

Efficient Failure Triage with Automated Debug: a Case Study by Sean Safarpour, Evean Qin, and Mustafa Abbas, Vennsa Technologies Inc.

CREATIVE ASSERTION AND CONSTRAINT METHODS FOR FORMAL DESIGN VERIFICATION

Pragmatic Simulation-Based Verification of Clock Domain Crossing Signals and Jitter using SystemVerilog Assertions

An Evaluation of the Advantages of Moving from a VHDL to a UVM Testbench by Shaela Rahman, Baker Hughes

SVA in a UVM Class-based Environment by Ben Cohen, author, consultant, and trainer

When addressing VLSI design most books start from a welldefined

Administrivia. ECE/CS 5780/6780: Embedded System Design. Acknowledgements. What is verification?

Sunburst Design - Advanced SystemVerilog for Design & Verification by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

CS/ECE 5780/6780: Embedded System Design

For a long time, programming languages such as FORTRAN, PASCAL, and C Were being used to describe computer programs that were

Verifying a low power design

Sunburst Design - Comprehensive SystemVerilog Design & Synthesis by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

166 SystemVerilog Assertions Handbook, 4th Edition

Lab #1: Introduction to Design Methodology with FPGAs part 1 (80 pts)

SystemVerilog Essentials Simulation & Synthesis

Hardware/Software Co-Verification Using the SystemVerilog DPI

8/22/2003. Proposal for VPI model PSL assertion extensions

Unifying Design and Verification

Module- or Class-Based URM? A Pragmatic Guide to Creating Verification Environments in SystemVerilog. Paradigm Works, Inc. Dr.

Integrate Ethernet QVIP in a Few Hours: an A-to-Z Guide by Prashant Dixit, Questa VIP Product Team, Mentor Graphics

Boost Verification Results by Bridging the Hardware/Software Testbench Gap

218 SystemVerilog Assertions Handbook, 4th Edition

Modular SystemVerilog

EECS 4340: Computer Hardware Design Unit 4: Validation

Design Process. Design : specify and enter the design intent. Verify: Implement: verify the correctness of design and implementation

ASIC world. Start Specification Design Verification Layout Validation Finish

Definitions. Key Objectives

PG DIPLOMA COURSE IN VERIFICATION USING SYSTEMVERILOG & UVM NEOSCHIP TECHNOLOGIES

Certitude Functional Qualification with Formal Verification. Jean-Marc Forey November 2012

Hardware Design Verification: Simulation and Formal Method-Based Approaches William K Lam Prentice Hall Modern Semiconductor Design Series

Subject: Scheduling Region Questions and Problems of new SystemVerilog commands

Assertive Verification: A Ten-Minute Primer

Modeling Usable & Reusable Transactors in SystemVerilog Janick Bergeron, Scientist

Optimizing Emulator Utilization by Russ Klein, Program Director, Mentor Graphics

Cypress Adopts Questa Formal Apps to Create Pristine IP

Data Structure Series

Complex Signal Processing Verification under DO-254 Constraints by François Cerisier, AEDVICES Consulting

Course Profile Assertions in UVM

Bibliography. Measuring Software Reuse, Jeffrey S. Poulin, Addison-Wesley, Practical Software Reuse, Donald J. Reifer, Wiley, 1997.

ZeBu : A Unified Verification Approach for Hardware Designers and Embedded Software Developers

Module 4. Design of Embedded Processors. Version 2 EE IIT, Kharagpur 1

Bulletproofing FSM Verification Automated Approach to Detect Corner Case Issues in an FSM Design

Using PLI 2.0 (VPI) with VCS Yes, it really works! (or does it?)

Assertions: Too good to be reserved for verification only.

Design for Verification in System-level Models and RTL

Verifying the Correctness of the PA 7300LC Processor

The Facts and Fallacies of Verilog Event Scheduling: Is the IEEE 1364 Standard Right or Wrong?

Simplified UVM for FPGA Reliability UVM for Sufficient Elemental Analysis in DO-254 Flows by Shashi Bhutada, Mentor Graphics

AN INTRODUCTION TO UNIT TESTING

Augmenting a C++/PLI/VCS Based Verification Environment with SystemC

RTL Coding General Concepts

Combining Algebraic Constraints with Graph-based Intelligent Testbench Automation by Mike Andrews, Verification Technologist, Mentor Graphics

JL Gray July 30, 2008

Comprehensive CDC Verification with Advanced Hierarchical Data Models

Top-Down Transaction-Level Design with TL-Verilog

OpenVera Assertions. March Synopsys, Inc.

Software Design and Analysis for Engineers

Last time. Reasoning about programs. Coming up. Project Final Presentations. This Thursday, Nov 30: 4 th in-class exercise

Reasoning about programs

BEYOND UVM REGISTERS BETTER, FASTER, SMARTER RICH EDELMAN AND BHUSHAN SAFI, MENTOR GRAPHICS

Transaction-Based Acceleration Strong Ammunition In Any Verification Arsenal

Stuart Sutherland, Sutherland HDL, Inc.

Contents 1 Introduction 2 Functional Verification: Challenges and Solutions 3 SystemVerilog Paradigm 4 UVM (Universal Verification Methodology)

System-Level Verification Platform using SystemVerilog Layered Testbench & SystemC OOP

Advanced Verification Topics. Bishnupriya Bhattacharya John Decker Gary Hall Nick Heaton Yaron Kashai Neyaz Khan Zeev Kirshenbaum Efrat Shneydor

List of Examples List of Figures List of Tables. Acknowledgments 1. VERIFICATION GUIDELINES 1

Reuse MATLAB Functions and Simulink Models in UVM Environments with Automatic SystemVerilog DPI Component Generation

SystemC Synthesis Standard: Which Topics for Next Round? Frederic Doucet Qualcomm Atheros, Inc

UVM for VHDL. Fast-track Verilog for VHDL Users. Cont.

Graph-Based IP Verification in an ARM SoC Environment by Andreas Meyer, Verification Technologist, Mentor Graphics Corporation

HECTOR: Formal System-Level to RTL Equivalence Checking

Java Software Solutions for AP Computer Science 3rd Edition, Lewis et al. 2011

Course Profile SystemVerilog Design

Best Practices for Incremental Compilation Partitions and Floorplan Assignments

System Verilog Assertions Language and Methodology. Comprehensive 1 Day Training Class. DefineView Consulting

Part 5. Verification and Validation

Ten Reasons to Optimize a Processor

Next-generation Power Aware CDC Verification What have we learned?

DDR SDRAM Bus Monitoring using Mentor Verification IP by Nikhil Jain, Mentor Graphics

Mentor Graphics Solutions Enable Fast, Efficient Designs for Altera s FPGAs. Fall 2004

SVA Alternative for Complex Assertions

Verification and Validation

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

VERIFICATION OF RISC-V PROCESSOR USING UVM TESTBENCH

The Embedded computing platform. Four-cycle handshake. Bus protocol. Typical bus signals. Four-cycle example. CPU bus.

Post processing techniques to accelerate assertion development Ajay Sharma

Assertion-Based Verification

System-On-Chip Architecture Modeling Style Guide

DO-254 Testing of High Speed FPGA Interfaces by Nir Weintroub, CEO, and Sani Jabsheh, Verisense

Verification of Clock Domain Crossing Jitter and Metastability Tolerance using Emulation

Test Scenarios and Coverage

Incisive Enterprise Verifier

Debugging Inconclusive Assertions and a Case Study

Transcription:

SystemVerilog Assertions in the Design Process 213 6.6 RTL Design Assertions, generated during the architectural planning phases, greatly facilitate the writing of the RTL implementation because they help the designers to fully understand the architectural and interface requirements. The assertion statements do contain rules and restrictions that can easily be translated into RTL. Assertions also cause the designers to think about corner cases upfront in the process. For instance, in a FIFO controller design, a potential corner case is simultaneous Read-and-Write of an empty FIFO in which a bypass mode is required. The designer can make sure that the verification team exercises the corner cases through assertions. During the coding of the RTL, it is recommended that designers add assertions and assumptions as executable documentation to be checked during the verification process. Note that assertions are not an equivalent representation of RTL code. They define a higher level of abstraction of the design. Assertions represent the expected behavior per requirements, as opposed to RTL that deals with detailed FSM architecture and timing. Thus, assertions cross-correlate implementation and provide another level of design verification. It is recommended that assertions be written in checkers (See Section 5 for guidelines and rationals). Such assertions significantly help in debugging failures because embedded assertions are very close to the source of error. 6.7 Testbench design With the addition of SystemVerilog Assertions throughout the design cycle, the testbench design is greatly simplified because the verification of the interface and the requirement rules are defined in an executable assertion language. That greatly eases the need and the design of an automatic verifier. Errors in protocol or design can be quickly detected. The testbench consists of the instantiation of modules in the design, resets, clocks, transactors to define the test scenarios through tasks to be performed (e.g., WRITEs, READs), and drivers to translate the transactions into low-level signals. The testbench may possibly include a simpler automatic verifier. 6.8 Functional coverage in verification With the recent advances in coverage technologies, functional coverage and assertion coverage have become quite significant in the verification process. Functional coverage is recognized as a means to ensure high quality of the design to be released to manufacturing. Testimonies on the values of functional coverage can be found in many books and papers. For example, in the verification of a Frequency-Programmable Switch Chip, the IBM design team experienced that the implementation of coverage models provided a high level of confidence upon completion of the verification efforts and helped quantify the stress on the logic designs. 53 Another interesting experience by a customer who used SystemVerilog Assertions in a batterypowered design was the benefit that coverage provided in the performance of the product. By the end of the project the top-level testbench did not show any functional bugs using the assertions. However, functional coverage revealed that one portion of the logic was performing unnecessary read/write operations to memory. Specifically, that portion of the logic had a high number of non-vacuous completions of memory accesses as compared to the non-vacuous completions of the logic that made use of those accesses. A correction to the logic to eliminate those unnecessary memory accesses yielded a 10% power efficiency increase. Considering that this design was battery powered, that 10% power efficiency was significant. Assertions with coverage helped in detecting the issues. 53 http://www.research.ibm.com/journal/rd/483/hoppe.html or http://tinyurl.com/ckye99 Functional verification of a frequency-programmable switch chip with asynchronous clock sections

214 SystemVerilog Assertions Handbook, 4th Edition Functional coverage can extend to several coverage domains. For example, in the functional verification of the Z990 Superscalar and Multibook Microprocessor Complex, the IBM design team identified several coverage domains. 54 These included, among other things the following: Program event recording coverage to track coverage events related to a specific domain or logic function, such as branch instructions, store instructions, and exceptions. Instruction coverage to verify that all instructions had been executed in all valid addressing, translation, and architectural modes. Architected features, such as all possible values for control registers, floating-point control register, and program status word. Superscalar grouping that defined which instructions could be executed simultaneously. Though functional coverage has been well adopted in the industry, advanced users are soon realizing that having all functionalities covered (in addition to the usual code coverage) doesn t necessarily mean that all those functionalities are checked for correctness. Design Managers tend to think that functional coverage can find design errors; rather it is a measure of how much verification is done and not necessarily how well it is done. According to this referred IBM article, the sole purpose of coverage is to measure test completeness and efficiency. Test correctness falls under functional verification. In that project, the failing test cases were all screened, defects were opened on them, and fixes were eventually provided and verified. As a result, all test cases ran successfully. While the authors believe strongly that use of functional coverage metrics is a must, they also insist that a vital link between functional coverage and correctness is even more important. One of the advantages of assertion-based coverage measurement is that the correctness is built-in into the assertions. In other words, with assertion-based coverage, functional correctness checking is the main product and functional coverage is a very valuable byproduct. But assertions, as in use today, tend to express localized behavior rather than end-to-end functionality. Hence the authors believe that assertion coverage and functional coverage will co-exist in verification. One of the increasingly painful problems is the extraction of meaningful information out of these functional coverage statistics, and the determination of how much verification is done. Traditionally, such an analysis is considered a tool issue. However, with recent advances in reactive testbench techniques, it is becoming more and more important to measure the coverage progress on the fly and to react quickly to the outcome. It is also important to be tool independent and yet achieve this goal. SystemVerilog Assertions provide a set of Application Programming Interface (API) routines that can be used to access the status of assertion evaluations within the verification environment. The API use model is presented in the next section with a small example. 6.8.1 SystemVerilog Assertions API While SystemVerilog Assertions are very powerful in expressing design behavior, users may need more flexibility in the analysis and interaction of the verification environment based on results of the assertions. Examples of such applications include: Grouping functionally related assert/cover statements into functional categories and analyzing them in different perspectives. Building an advanced temporal debugger as an add-on to the SystemVerilog aware simulator. Reusing internal debugging tools originally based on proprietary assertion languages, thus permitting the smooth migration to SystemVerilog, a standard language. 54 http://www.research.ibm.com/journal/rd/483/bair.html or http://tinyurl.com/dmexgw Functional verification of the z990 superscalar, multibook microprocessor complex

SystemVerilog Assertions in the Design Process 215 Building more automated testbenches using custom C-routines to interact with the assertion related events. For example, in an image processing application, a custom C- routine can be called to predict the output frame when an assertion evaluation starts. Verilog has a standard API named Programming Language Interface (PLI). The recent PLI version 2.0 is referred to as Verilog Procedural Interface (VPI). SystemVerilog defines a Direct Programming Interface (DPI) that allows for calling C routines from SystemVerilog, and SystemVerilog routines from C. Many vendors have extrapolated this to C++ as well. It is much faster than PLI/VPI at the expense of error checking. SystemVerilog also defines a set of API routines to interact with the SystemVerilog Assertions and is called SystemVerilog Assertions API. While the exact functional prototypes of the SystemVerilog Assertions API itself are beyond the scope of this book, this section presents a brief overview of the functions and use model. Readers are encouraged to refer to the LRM for further details. Since SystemVerilog Assertions API is an extension above the VPI, we will hereafter refer to it as VPI. The general flow of using VPI to extract information is a two-step process: 1. Obtain a handle to the assertions. 55 2. Obtain the properties of assertions. Calls to standard VPI routines, such as vpi_iterate and vpi_handle_by_name, can derive a list of assertions in the entire design or in a specific module. An analysis of assertions statistics will involve: Sorting the assertions based on their static characteristics such as name, instance name, module containing the assertions etc. For debug one might also be interested in the file name, line number etc. Such information is static in the sense that they remain unchanged throughout the simulation phase. Sorting the assertions based on their dynamic characteristics such as attempt started, attempt ended, attempt aborted, attempt stopped etc. The static information about assertions can be retrieved using a single call to the API routine vpi_get_assertion_info() from an assertion handle. To retrieve the dynamic characteristics, the API extends the VPI call back routines to accommodate assertions and register call-backs on specific events, such as start, stop etc. Building an Assertion Coverage Extractor using SVA API The Assertion API capabilities are demonstrated with a simple example. The shown C-code is incomplete and represents pseudo-code to show intent. For assertions, the coverage status property vpicovered implies that the assertion has been attempted, has succeeded at least once, and has never failed. More detailed coverage information can be obtained for assertions by using different arguments to the vpi_get function. Table 6.8.1.1-1 lists various vpi_get arguments related to assertions. 55 NOTES 1 As with all VPI handles, assertion handles are handles to a specific instance of a specific assertion. 2 Unnamed assertions cannot be found by name.

216 SystemVerilog Assertions Handbook, 4th Edition Table 6.8.1-1 vpi_get() Arguments and Usage Argument to vpi_get() function Usage Extract the number of assertion attempts. Extract the number of true (non-vacuous) successes. vpiassertattemptcovered vpiassertsuccesscovered vpiassertvacuoussuccesscovered vpiassertfailurecovered Extract the number of vacuous successes. Extract the number of assertion failures. Figure 6.8.1-1 represents SystemVerilog Assertions API C-code for an assertion statistics extractor. /ch6/6.8/vpi_sect6_2_7.c #include <stdio.h> #include <vpi_user.h> #ifdef VCS #include <vcs_vpi_user.h> #include <vcsuser.h> #endif #include <sv_vpi_user.h> void assert_cov (int data, int reason) { vpihandle assertion_h, itr_h; char * a_name; int a_attempts, a_true_success, a_vac_success, a_failures; itr_h = vpi_iterate(vpiassertion, NULL); vpi_printf ("SystemVerilog Assertions Statistics - demo from SVA Handbook\n"); vpi_printf ("Assertion Name: \t \t True Success \t Vacuous Success \t Failures \t total attempts \n"); while (assertion_h = vpi_scan(itr_h)) { a_name = vpi_get_str(vpifullname, assertion_h); a_attempts = vpi_get(vpiassertattemptcovered, assertion_h); a_true_success = vpi_get(vpiassertsuccesscovered, assertion_h); a_vac_success = vpi_get(vpiassertvacuoussuccesscovered, assertion_h); a_failures = vpi_get(vpiassertfailurecovered, assertion_h); vpi_printf ("%0s %0d \t %0d \t %0d \t %0d \t %0d \n", a_name, a_true_success, a_vac_success, a_failures, a_attempts); } /* while */ } /* assert_cov */ Figure 6.8.1 SystemVerilog assertions API C-code for assertion statistics extractor. A sample SystemVerilog model making use of the above C function is shown in Figure 6.2.7.2.1-2. This model does not show any RTL or assertions. However, types of results produced using these methodologies are shown in Figure 6.8.1-3. module cov_api_test (); /ch6/6.8/vpi_sect6_2_7.sv // Design has 3 assertions named as follows: // ap_rst_checks, ap_arm_arith_instructions, ap_arm_logical_instructions // The definitions of those assertions are not shown here as the goal of // this example is to demonstrate SVA API call. // Coverage collection, other option could be to use vpicallback final begin : call_api $assert_cov; // call to API C-code function end endmodule : cov_api_test Figure 6.8.1-2 Sample SystemVerilog example for use of the coverage extractor

SystemVerilog Assertions in the Design Process 217 Table 6.8.1-2 shows arbitrary results that can be produced after simulation of the model. Assertion Name Table 6.8.1-2 Sample Assertion Statistics True Success Vacuous Success Failures total attempts cov_api_test.ap_rst_checks_ 5 0 3 8 cov_api_test.ap_arm_arith_instructions 9 5 2 16 cov_api_test.ap_arm_logical_instructions 0 4 7 11 6.8.2 Formal verification (FV) If formal verification is available, the design can be exercised through the tool using the SystemVerilog assertions and assumptions already defined. Chapter 7 addresses the topic of formal verification. 6.9 Case study - synchronous FIFO This section provides a definition of the requirements for a synchronous FIFO used as IP. This section demonstrates by example how properties unambiguously clarify requirements. 56 The RTL design with properties is also presented. A VMM testbench model is provided as a reference because it is derived from previous work. 57 An explanation of how the various pieces fit together is also demonstrated. The numbering scheme for this specification and verification plan is separate from this chapternumbering scheme, and thus, each document starts at the number ONE. 6.9.1 Synchronous FIFO Requirements The requirements for a synchronous FIFO are provided in the following pages. 56 Format for this specification is from the book Component Design by Example, 2001 ISBN 0-9705394-0-1, Ben Cohen 57 The book A Pragmatic Approach to VMM Adoption 2006 ISBN 0-9705394-9-5 defines the use of the VMM methodology along SystemVerilog Assertions for the verification of the FIFO model.