Coverage User Guide
Coverage User Guide
User Guide
M-2017.03-SP1, June 2017
Copyright Notice and Proprietary Information
© 2017 Synopsys, Inc. All rights reserved. This Synopsys software and all associated documentation are proprietary to Synopsys,
Inc. and may only be used pursuant to the terms and conditions of a written license agreement with Synopsys, Inc. All other use,
reproduction, modification, or distribution of the Synopsys software or the associated documentation is strictly prohibited.
Third-Party Software Notices
VCS®/VCSi™ and VCS® MX/VCS® MXi™ includes or is bundled with software licensed to Synopsys under free or
open-source licenses. For additional information regarding Synopsys's use of free and open-source software, refer to
the third_party_notices.txt file included within the <install_path>/doc directory of the installed VCS/VCS MX software.
Destination Control Statement
All technical data contained in this publication is subject to the export control laws of the United States of America.
Disclosure to nationals of other countries contrary to United States law is prohibited. It is the reader's responsibility to
determine the applicable regulations and to comply with them.
Disclaimer
SYNOPSYS, INC., AND ITS LICENSORS MAKE NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH
REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Trademarks
Synopsys and certain Synopsys product names are trademarks of Synopsys, as set forth at
http://www.synopsys.com/Company/Pages/Trademarks.aspx.
All other product or company names may be trademarks of their respective owners.
Third-Party Links
Any links to third-party websites included in this document are for your convenience only. Synopsys does not endorse
and is not responsible for such websites and their practices, including privacy practices, availability, and content.
Synopsys, Inc.
690 E. Middlefield Road
Mountain View, CA 94043
www.synopsys.com
ii
Contents
Planning Coverage 7
Contents
iii
Compiling Design Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Options for Generating Coverage Metrics . . . . . . . . . . . . 3-4
Running the Simulation and Monitoring Coverage . . . . . . . . 3-5
Unified Coverage Database. . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Generating Coverage Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Using Unified Report Generator (URG) to Generate Coverage
Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Using DVE Coverage to Generate Coverage Reports. . . . . . 3-8
Using Unified Coverage API to Generate Coverage Reports 3-9
Viewing Coverage Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Viewing Coverage for Protected Modules . . . . . . . . . . . . . . . 3-12
Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Contents
iv
Generating El File for Condition Coverage. . . . . . . . . . . . 4-20
Specifying Tags in the Source . . . . . . . . . . . . . . . . . . . . . 4-21
Specifying Multiple Conditions in a Statement . . . . . . . . . 4-21
Specifying Multiple Statements in a Line . . . . . . . . . . . . . 4-23
Viewing Names in the Generated Reports . . . . . . . . . . . . 4-23
Limitations With Stable Names for Conditions . . . . . . . . . 4-25
FSM Coverage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
FSM Coverage for Verilog . . . . . . . . . . . . . . . . . . . . . . . . 4-27
FSM Coverage for VHDL . . . . . . . . . . . . . . . . . . . . . . . . . 4-29
Branch Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
Branch Value Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42
SystemVerilog Support for Code Coverage . . . . . . . . . . . . . . 4-44
Coverage Options and Sub-Options . . . . . . . . . . . . . . . . . . . 4-47
Mandatory Options for Generating Coverage Metrics . . . 4-47
Functional Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48
Using with Clause in Covergroups. . . . . . . . . . . . . . . . . . . . . 4-49
Coverpoint Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-49
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-52
Limitations With Using the with Clause . . . . . . . . . . . . . . 4-54
Writing and Configuring Test Run Metrics . . . . . . . . . . . . . . . . . . 4-55
Writing Test Run Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-56
Generating Lightweight Test Records . . . . . . . . . . . . . . . 4-56
Reporting Test Run Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . 4-61
Configuring the Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-64
Test Record of a Merged Database . . . . . . . . . . . . . . . . . . . . 4-66
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-67
Contents
v
5. Merging Coverage Metrics
Serial Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
Parallel Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Specifying the Number of Tests in Merging . . . . . . . . . . . . . . 5-6
Specifying Hosts to Execute Jobs . . . . . . . . . . . . . . . . . . . . . 5-7
Using a GRID Computing Engine . . . . . . . . . . . . . . . . . . . . . 5-7
Using an LSF Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
Merging Covergroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
Default Merging for Covergroups. . . . . . . . . . . . . . . . . . . . . . 5-9
Flexible Merging for Covergroups . . . . . . . . . . . . . . . . . . . . . 5-10
Merge Equivalence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
Rules for Flexible Merging of Databases . . . . . . . . . . . . . 5-12
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
Union Merging for Covergroups. . . . . . . . . . . . . . . . . . . . . . . 5-17
Rules for Union Merging of Databases . . . . . . . . . . . . . . 5-19
Reference Merging for Covergroups and Assertions. . . . . . . 5-31
Example - Covergroup Metrics. . . . . . . . . . . . . . . . . . . . . 5-32
Example - Assertion Metric . . . . . . . . . . . . . . . . . . . . . . . 5-36
Resetting the Scores of all Coverable Objects to Zero . . . . . 5-39
Toggle Coverage Reference Merging . . . . . . . . . . . . . . . . . . . . . 5-40
Use Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-41
Region Changes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-45
VDB Directory Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-47
Limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48
Mapping Coverage Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48
Mapping Assertion Coverage . . . . . . . . . . . . . . . . . . . . . . . . 5-52
Contents
vi
Mapping Sub-Hierarchy Coverage in VHDL . . . . . . . . . . . . . 5-53
Mapping Coverage Information From Multiple Sources. . . . . 5-54
Understanding Instance-Based Mapping. . . . . . . . . . . . . . . . 5-55
Examples of Instance-Based Mapping. . . . . . . . . . . . . . . 5-57
Mapping Assertion Coverage Using a Mapping Configuration File 5-
58
Map-Merging Assertion Coverage . . . . . . . . . . . . . . . . . . . . . 5-60
Mapping Relocated Source File. . . . . . . . . . . . . . . . . . . . . . . 5-62
Limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-63
Contents
vii
Resetting and Deleting a Covergroup in Coverage Database 7-3
Resetting Hit Counts of Bins . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Deleting a Covergroup from Coverage Database . . . . . . . . . 7-5
Resetting and Deleting Assertion Coverage . . . . . . . . . . . . . . . . 7-6
Resetting Assertion Coverage . . . . . . . . . . . . . . . . . . . . . . . . 7-6
Deleting Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
Resetting the Scores of all Coverable Objects . . . . . . . . . . . 7-8
Contents
viii
Creating User-Defined Groups. . . . . . . . . . . . . . . . . . . . . 9-22
Display Single Cover Group in Detail Pane . . . . . . . . . . . . . . 9-24
Viewing Code Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25
Viewing Line Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26
Viewing Toggle Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-27
Viewing Nets and Registers . . . . . . . . . . . . . . . . . . . . . . . 9-27
Viewing Multi-Dimensional Arrays . . . . . . . . . . . . . . . . . . 9-29
Displaying Condition Coverage . . . . . . . . . . . . . . . . . . . . . . . 9-30
Viewing Condition IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-31
DVE Coverage with Condition Coverage Observability . . 9-32
Displaying Finite State Machine (FSM) Coverage . . . . . . . . . 9-33
Displaying Transition Details . . . . . . . . . . . . . . . . . . . . . . 9-34
Displaying Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-35
Displaying Branch Coverage . . . . . . . . . . . . . . . . . . . . . . . . . 9-37
The Branch Coverage Detail Window . . . . . . . . . . . . . . . 9-37
Viewing Implied Branches . . . . . . . . . . . . . . . . . . . . . . . . 9-39
Displaying Assertion Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . 9-39
SVA Naming Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-41
OVA Naming Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-41
The Covers Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-43
Displaying Testbench Coverage . . . . . . . . . . . . . . . . . . . . . . . . . 9-48
Compute Coverage Score by Ratio . . . . . . . . . . . . . . . . . . . . 9-51
Filtering Instances with No Coverable Objects . . . . . . . . . . . . . . 9-53
Working With HVP Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-57
Working With Coverage Results . . . . . . . . . . . . . . . . . . . . . . . . . 9-58
Running Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-58
Contents
ix
Filtering the Hierarchy Display . . . . . . . . . . . . . . . . . . . . . . . . 9-59
Generating URG Report From DVE Coverage GUI . . . . . . . . . . 9-60
Contents
x
Detail Report for Cover Properties . . . . . . . . . . . . . . . . . . 10-49
The Covergroup Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-51
Viewing Results for Coverage Group Variants . . . . . . . . . 10-53
Understanding Covergroup Page Splitting . . . . . . . . . . . . 10-55
Correlation Report: Determining Which Tests Covered Which Objects
10-64
Viewing Tests for Covered Objects. . . . . . . . . . . . . . . . . . 10-66
Tests Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-75
Unsupported Arguments . . . . . . . . . . . . . . . . . . . . . . . . . 10-76
Difference Reports for Functional Coverage . . . . . . . . . . . . . . . . 10-76
Viewing the Difference Between Tests in Dashboard and Test Pages
10-78
What is Shown as Covered? . . . . . . . . . . . . . . . . . . . . . . . . . 10-79
Report for Default Mode (-diff or -diff object) . . . . . . . . . . 10-79
Report for Count Mode (-diff count) . . . . . . . . . . . . . . . . . 10-80
Unsupported Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-81
Exclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-81
Reporting Only Uncovered Objects (-show brief) . . . . . . . . . . . . 10-82
Brief Report for Line Coverage. . . . . . . . . . . . . . . . . . . . . 10-82
Brief Report for Condition Coverage . . . . . . . . . . . . . . . . 10-84
Brief Report for FSM Coverage . . . . . . . . . . . . . . . . . . . . 10-84
URG Support for Uncovered Only (–show brief) Feature on Selected
Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-85
Report Changes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-88
Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-88
Module List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-88
Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-89
Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-90
Contents
xi
Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-90
HVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-91
Assertions Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-91
Module and Instance Header Sections . . . . . . . . . . . . . . 10-91
Summary Only URG Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-92
Use Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-92
Coverage Report Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-94
Overview of URG Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-95
Common Report Elements . . . . . . . . . . . . . . . . . . . . . . . . 10-96
The Dashboard File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-98
The Hierarchy File (Design Hierarchy) . . . . . . . . . . . . . . . 10-100
The Modlist File (Design Module List) . . . . . . . . . . . . . . . 10-105
The modN File (Module Definition). . . . . . . . . . . . . . . . . . 10-108
The Groups File (Testbench Group List) . . . . . . . . . . . . . 10-111
The grpN File (Group Definition) . . . . . . . . . . . . . . . . . . . 10-114
The Tests File (Test Records). . . . . . . . . . . . . . . . . . . . . . 10-117
The Assertions File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-120
The HVP File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-124
Backward Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-129
Performance Improvement for HTML URG Reports . . . . . . . . . . 10-130
Use Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-130
-legacy batch_hier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-131
Design Hierarchy Page . . . . . . . . . . . . . . . . . . . . . . . . . . 10-132
HVP and HVP Problem Hierarchy Pages. . . . . . . . . . . . . 10-133
LP Hierarchy Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-134
-legacy batch_list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-135
-legacy batch_test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-138
-attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-139
Contents
xii
11. Analyzing Coverage Trend Charts
Generating Trend Charts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
Customizing Trend Charts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Modifying the Timestamp of Trend Charts . . . . . . . . . . . . . . . 11-10
Suppressing the Generation of session.xml . . . . . . . . . . . . . 11-10
Analyzing Trend Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11
Organization of Trend Charts. . . . . . . . . . . . . . . . . . . . . . . . . 11-11
Top-Level Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12
Navigating Through Trend Charts . . . . . . . . . . . . . . . . . . 11-15
Metric-Wide Breakdown Linkage . . . . . . . . . . . . . . . . . . . 11-16
Hierarchical Linkage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-21
Links to Previous Sessions . . . . . . . . . . . . . . . . . . . . . . . 11-24
Contents
xiii
Backward Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16
Exclusion State Markers in DVE . . . . . . . . . . . . . . . . . . . . . . 12-16
Understanding Review Markers in DVE GUI . . . . . . . . . . . . . 12-18
Adding Exclusion Annotations in DVE . . . . . . . . . . . . . . . . . . 12-20
Interactively Marking Items for Exclusion in the Detail Views 12-24
Filtering Coverage Objects Based on Exclusion Status . . 12-26
Excluding Multiple Objects in a Single Line . . . . . . . . . . . . . . 12-26
Excluding Hierarchies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-27
Exclusion Propagation in Hierarchies. . . . . . . . . . . . . . . . 12-28
Excluding Half Toggle Transitions . . . . . . . . . . . . . . . . . . 12-29
Excluding Covergroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-31
Exclusion Propagation in Covergroups . . . . . . . . . . . . . . 12-33
Excluding Auto-Cross Bins . . . . . . . . . . . . . . . . . . . . . . . . . . 12-35
Excluding Toggle Coverage MDA . . . . . . . . . . . . . . . . . . . . . 12-35
Exclusion File Syntax for MDA Exclusion. . . . . . . . . . . . . 12-36
Excluding Cross-of-a-Cross . . . . . . . . . . . . . . . . . . . . . . . . . . 12-37
Using Exclusion File to Exclude Cross-of-a-Cross. . . . . . 12-37
Enhanced Syntax of Covergroup Exclusion . . . . . . . . . . . 12-40
Saving and Loading Saved Exclusions . . . . . . . . . . . . . . . . . 12-41
Loading Exclusions From an Exclusion File. . . . . . . . . . . 12-43
Loading Excluded Covered Items in Strict Mode . . . . . . . 12-45
Recalculating Coverage Scores. . . . . . . . . . . . . . . . . . . . . . . 12-46
Using Adaptive Exclusion in DVE . . . . . . . . . . . . . . . . . . . . . 12-46
Adaptive Exclusion Review Flow . . . . . . . . . . . . . . . . . . . 12-47
Enabling and Disabling Adaptive Exclusion Review Mode 12-49
Reviewing Exclusions in the Navigation Pane . . . . . . . . . 12-51
Reviewing Exclusions in the Detail Pane . . . . . . . . . . . . . 12-56
Unmappable Exclusions. . . . . . . . . . . . . . . . . . . . . . . . . . 12-60
Contents
xiv
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-66
Viewing Excluded Coverage Objects in URG . . . . . . . . . . . . . . . 12-67
Generating URG Reports Using Exclusion Files . . . . . . . . . . 12-68
Viewing Excluded Covergroups in URG . . . . . . . . . . . . . . . . 12-70
Synchronizing Checks Using Checksum . . . . . . . . . . . . . . . . 12-71
Line Exclusion Format . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-72
Toggle Exclusion Format . . . . . . . . . . . . . . . . . . . . . . . . . 12-73
FSM Exclusion Format . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-74
Condition Exclusion Format . . . . . . . . . . . . . . . . . . . . . . . 12-75
Branch Exclusion Format . . . . . . . . . . . . . . . . . . . . . . . . . 12-76
Assertion Exclusion Format . . . . . . . . . . . . . . . . . . . . . . . 12-77
Covergroup Exclusion Format . . . . . . . . . . . . . . . . . . . . . 12-78
Viewing Annotated Exclusions in URG . . . . . . . . . . . . . . . . . 12-82
Exclusion Annotation Syntax . . . . . . . . . . . . . . . . . . . . . . 12-82
Indicating Exclusion Status in URG . . . . . . . . . . . . . . . . . . . 12-84
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-84
Dumping Full Exclusion Files in Commented Format . . . . . . 12-88
Dumping Full Exclusion Files . . . . . . . . . . . . . . . . . . . . . . 12-89
Controlling the Hierarchy Dumped in Full Exclusion Files 12-89
Using Dumped Full Exclusion Files . . . . . . . . . . . . . . . . . 12-90
Full Exclusion Files for Coverage Metrics . . . . . . . . . . . . . . . 12-90
Full Exclusion Files for Line Coverage . . . . . . . . . . . . . . . 12-92
Full Exclusion Files for Toggle Coverage . . . . . . . . . . . . . 12-94
Full Exclusion Files for Condition Coverage. . . . . . . . . . . 12-98
Full Exclusion Files for Branch Coverage . . . . . . . . . . . . 12-102
Full Exclusion Files for FSM Coverage . . . . . . . . . . . . . . 12-104
Full Exclusion Files for Group Coverage . . . . . . . . . . . . . 12-109
Full Exclusion Files for Assertion Coverage. . . . . . . . . . . 12-114
Contents
xv
Managing Exclusions in UCAPI. . . . . . . . . . . . . . . . . . . . . . . . . . 12-117
Excluding Coverage Objects Using Hierarchy Exclusion Files 12-117
Excluding Coverage Objects Using Object Handles . . . . . . . 12-118
Default Versus Strict Exclusion in UCAPI . . . . . . . . . . . . . . . 12-119
Using Report-Time Exclusion . . . . . . . . . . . . . . . . . . . . . . . . 12-120
Saving Exclusions in UCAPI . . . . . . . . . . . . . . . . . . . . . . . . . 12-121
Computing Checksum for Coverage Metrics . . . . . . . . . . . . . 12-121
Calculating Checksum for Condition Coverage . . . . . . . . 12-122
Calculating Checksum for Line Coverage . . . . . . . . . . . . 12-124
Calculating Checksum for Toggle Coverage . . . . . . . . . . 12-125
Calculating Checksum for FSM Coverage . . . . . . . . . . . . 12-126
Calculating Checksum for Branch Coverage . . . . . . . . . . 12-128
Calculating Checksum for Assertion Metric . . . . . . . . . . . 12-130
Calculating Checksum for Covergroup Metric . . . . . . . . . 12-131
Remapping Exclusions From the Block Level to the System Level 12-
132
Use Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-132
-map and -elfile Options . . . . . . . . . . . . . . . . . . . . . . . . . . 12-134
-mapfile and -elfile Options. . . . . . . . . . . . . . . . . . . . . . . . 12-135
Contents
xvi
Limitations With -cm_noconst and -cm_seqnoconst Options 13-
20
Limitation With the -cm_seqnoconst Option. . . . . . . . . . . 13-24
Other -cm_seqnoconst Limitations. . . . . . . . . . . . . . . . . . 13-25
Propagating Constants Through Instance Arrays . . . . . . . . . 13-26
Rules of Port Connections in Instance Arrays . . . . . . . . . 13-26
Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-28
Treating Other Signals as Permanently at 1 or 0 Value . . . . . 13-29
Specifying Instance-Specific Constant Signals in Constant
Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-31
Specifying Module-Specific Constant Signals in Constant
Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-31
Syntax of the -cm_constfile Input File . . . . . . . . . . . . . . . 13-34
Dumping Annotations for Automatically Excluded Coverage Targets 13-
41
Use Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-43
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-46
Multiple 1-Value Constants. . . . . . . . . . . . . . . . . . . . . . . . 13-46
Bit-Select Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-48
Bit Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-48
Bit Padding For Constant File Entries . . . . . . . . . . . . . . . 13-49
Contents
xvii
Dynamic UCAPI Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-9
UCAPI Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-9
Common Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10
Coverable Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-13
Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-13
Integer and Scalar Values . . . . . . . . . . . . . . . . . . . . . . . . A-14
Interval Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-15
Vector Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-15
Value Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-16
Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-16
Cross . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-18
Stable Names for Coverable Objects. . . . . . . . . . . . . . . . . . . A-19
Naming the Next Statement in a Module . . . . . . . . . . . . . A-20
Using Stable Names for Coverable Objects . . . . . . . . . . . A-20
Specifying Tags in the Source . . . . . . . . . . . . . . . . . . . . . A-21
Multiple Conditions in a Statement . . . . . . . . . . . . . . . . . . A-22
Multiple Statements on a Line . . . . . . . . . . . . . . . . . . . . . A-23
Names in the Generated Reports. . . . . . . . . . . . . . . . . . . A-24
El File for Condition Coverage . . . . . . . . . . . . . . . . . . . . . A-25
Design Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-25
Design and Test Name . . . . . . . . . . . . . . . . . . . . . . . . . . . A-26
Tests and Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-26
Source Definition and Source Instance . . . . . . . . . . . . . . A-27
Test-Qualified Source Regions. . . . . . . . . . . . . . . . . . . . . A-37
Other Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-39
Container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-39
Predefined Coverage Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . A-40
Contents
xviii
Line Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-41
Condition Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-44
Branch Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-49
Finite State Machine Coverage . . . . . . . . . . . . . . . . . . . . . . . A-55
Toggle Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-60
Assertion Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-64
Testbench Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-73
Setting Hit Count on Bins . . . . . . . . . . . . . . . . . . . . . . . . . A-79
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-79
Set covdbStatusCovered . . . . . . . . . . . . . . . . . . . . . . . . . A-79
Compressed and Uncompressed Bins. . . . . . . . . . . . . . . A-80
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-81
Loading a Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-83
Available Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-84
Loading Tests. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-85
Coverage Correlation: Determining Which Test Covered an Object
A-87
Contents
xix
Contents
xx
1
Introduction to VCS Coverage Technology 1
Coverage is a measurement of completeness in the verification of a
design and an important metric of a design’s readiness for tape-out.
A comprehensive coverage model combines different coverage
technologies and metrics to ensure all valid design scenarios are
exercised and validated.
Planning Coverage
Using Verification Planner, you can create and maintain a live and
executable verification plan that can be updated according to the
changing implementation of your design.
The basic steps for creating and using a verification plan are as
follows:
Once the plan is created, you can use DVE, URG, or spreadsheet
annotator to view the results. The reports shows the verification plan
hierarchy with the back-annotated scores of the associated
measures, linked directly to the detailed coverage reports. For more
information, see section
“Viewing the Verification Results” .
plan myPlan;
feature Feature_1;
measure Line, Toggle module;
source = "module: logic_block_tb@**";
source = "module: top@**";
endmeasure
endfeature
feature Feature_11;
measure Line, Cond, Toggle, Branch mod_2;
source = "module: logical_block_dut@*";
endmeasure
endfeature
feature Feature_2;
measure Line, Cond, FSM, Toggle, Branch, Assert,
test, AssertResult Inst_1;
source = "instance : test_top.top1.**.**@test*";
endmeasure
endfeature
feature Feature_3;
measure Line, FSM, Toggle, Branch Measure_1;
After simulating the design source file, to view the report, you must
back-annotate the coverage results.For example, in URG, you can
use the following command to back-annotate the results:
• The interactive plan editor in DVE Coverage. This tool allows you
to graphically browse and edit your verification plan.
For more information on this, see chapter HVP Interactive Editor
in the Verification Planner User Guide.
• As a text file in the HVP format using a regular text editor. This
helps you write your verification plan in a simple language.
For more information on this, see section Reporting HVP
Annotated Results in XML Format in the Verification Planner User
Guide.
Figure 2-2 shows the various elements of a verification plan and how
they are connected.
You can view the verification Planner results using one of the
following formats:
The tool also allows you to incrementally adjust goals as the project
timeline moves along. For example, if you expect your coverage to
be at 50% in the second month of a project, 70% in the fourth month,
90% by the sixth month, and then 98% by the eight month then you
can override your plan goals at those times to reflect your
expectations. In doing so, you can check whether your plan is on
track by viewing the reports. If all of the score cells are green, then
To obtain coverage metrics for your design, you need to compile your
design and run simulation, as discussed in the following steps:
Analysis is the first step in simulating your design. In this phase, you
analyze your VHDL, Verilog, SystemVerilog, and OpenVera files
using vhdlan or vlogan. The following are a few example
command lines to analyze your design files:
You can specify the types of coverage for which you want VCS to
compile your design.To compile the design for coverage, execute the
following command:
Note:
If you compile the design with the -cm_dir option and then move
simv.vdb to a new location, you must use -cm_dir at runtime
to point to the new location of simv.vdb.
-cm <cov_metrics_name>
The arguments to the -cm option are as follows:
line
Specifies line coverage
cond
Specifies condition coverage
tgl
Specifies toggle coverage
fsm
Specifies FSM coverage
branch
Specifies branch coverage
assert
Specifies assertion coverage
You can include more than one argument using a plus (+) as a
delimiter between arguments.
For example,
The HTML version of the reports take the form of multiple interlinked
HTML files. For example, a hierarchy.html file shows the
design's hierarchy and contains links to individual pages for each
module and its instances.
% dve -cov
OR
VCS does not report coverage scores for protected modules for any
coverage metric. If a module contains protected code, VCS
Coverage does not monitor the module or its self-instance and the
full hierarchy below it|.
Examples
• “Code Coverage”
You can obtain the following types of code coverage information:
• “Line Coverage”
• “Toggle Coverage”
• “Condition Coverage”
• “FSM Coverage”
• “Branch Coverage”
• “SystemVerilog Support for Code Coverage”
Line Coverage
initial
begin
$display("Assigning initial values");
clk=0; data=256;
#100 $finish;
end
always
#3 clk=~clk;
endmodule
task splitter;
input [8:0] tin;
output [8:0] tout;
begin
tout = tin/2;
end
endtask
In Example 4-1, the statements tracked by VCS for line coverage are
shown in boldface.
VCS line coverage also includes information about the always and
initial blocks and other types such as forever, case, if-else, so
on of blocks of code. In line coverage, a block is a nesting level in the
code. It is more of a level of control of the execution of the procedural
code. Typically, you will have to change the indentation of your
source code for a nesting level. Example 4-2 illustrates the code
blocks in the source code in Example 4-1. It is interrupted in a
number of places to explain the blocks.
Note that the assignment statements to regs clk and data are on
the same line. This illustrates the difference between line and
statement coverages. In this case, line 9 is covered only if both the
statements clk=0; and data=256; are covered.
endmodule
end
endmodule
The case item statements are separate blocks and the procedural
delays on these case item statements are considered separate wait
statements. There can also be blocks for missing constructs. If you
use an if statement instead of an if-else statement, VCS
considers the else construct to be missing. If you use a case
statement and do not enter a default case, VCS considers the default
case to be missing.
For example,
module dev;
wire w1,w2,w3;
reg r1,r2;
• Individual statements
• Statement blocks
• Statement block type
Note:
- Statement blocks consist of a set of individual statements
executed sequentially and always executed together in the
same time step.
- Concurrent signal assignments and component instantiations
are not reported in the coverage reports because they are
always executed.
- Coverage information is not reported for execution lines in entity
or configuration declaration statements.
Toggle Coverage
Note:
By default, toggle coverage does not display or report 0 → 1 and
1 → 0 transitions where the signal returns to its original value
during the same time step that is, a glitch during which zero
simulation time passes.
initial
begin
r1=0;
r2=8’b00000000;
#100 $finish;
end
always
#10 r1=~r1;
always
#25 r2=r2+1;
endmodule
always @ in
dutr1=in;
assign out=dutr1;
endmodule
Condition Coverage
OR
• In for loops:
for (i=0;i<10;i=i+1)
if(r1 && r2)
r3=r1;
else
r3=r2;
//coverage name a1
if (a || (b && c))
//coverage name a1
if (a || (b && c)) {
…
}
a || (b && c)Condition a1
1 --2---
For example:
Note:
This additional naming is valid only for one statement.
//coverage name a2
x <= (a || b) ? 1’b0 : 1’b1; y = (c && d) ? 1’b0 : 1’b1;
a || b Condition a2
1 2
There is no name for the second condition c && d, since it occurs
in another statement that has no pragma preceding it. If you want to
assign a name to c && d, then you must place the statement on a
separate line:
//coverage name a2
x <= (a || b) ? 1’b0 : 1’b1;
//coverage name a3
y = (c && d) ? 1’b0 : 1’b1;
a || b Condition a2
1 2
c && d Condition a3
1 2
LINE 12
CONDITION_ID 1
STATEMENT if ((a || (b && c)))
1 --2---
EXPRESSION -1- -2-
0 0 | Not Covered
0 1 | Not Covered
1 0 | Not Covered
LINE 12
CONDITION_ID a1
STATEMENT if ((a || (b && c)))
1 --2---
EXPRESSION -1- -2-
0 0 | Not Covered
0 1 | Not Covered
1 0 | Not Covered
LINE 12
CONDITION_ID a1.1
STATEMENT if ((a || (b && c)))
1 2
EXPRESSION -1- -2-
1 1 | Not Covered
0 1 | Not Covered
1 0 | Not Covered
You can use the covdb_get_annotation(condObj, "id") to
get the stable name from the condition ID handle.
• The support for stable names is not available for VHDL conditions.
It is available only for Verilog conditions.
• There should be no other lines (even blank lines) between the
condition statement line and the pragma line.
• The stable name for condition cannot have a period (.) character
in it; it is reserved for condition coverage naming scheme for sub-
conditions.
FSM Coverage
The sequential logic is driven by the next state signal and clock, and
reset signals. The combinational logic is driven by the current state
and the inputs to the FSM.
reset
sequential logic current state
clock
determines the
current state
next state
combinational logic
determines the
next state
inputs
input in;
reg [3:0] current,next;
initial
current=4’b0001;
always @ in
begin
case (1’b1)
current [0] : next=4’b0010;
current [1] : next=4’b0100;
current [2] : next=4’b1000;
current [3] : next=4’b0001;
initial
begin
state=idle;
next=idle;
end
always @ in
begin
next = state; // by default hold
case (state)
idle : if (in) next = first;
first : if (in) next = second;
second : if (in) next = third;
third : if (in) next = idle;
endcase
end
endmodule
The values that the statements in the group assign to a signal are the
states of the FSM, and must be of an identifiable set of parameters,
numeric constants, or text macros (where the macro text that VCS
substitutes for the macro name is a numeric constant). The states
can also be enumerated types in SystemVerilog.
Limitation
The current state variable and the variables used to store the next
state value must not have unpacked dimensions.
begin
my_fsm : process(insig)
begin
next_state <= curr_state;
case curr_state is
when idle => if (insig = '1') then next_state <= first;
end if;
when first => if (insig = '1') then next_state <= second;
end if;
when second => if (insig = '0') then next_state <= third;
end if;
when third => if (insig = '1') then next_state <= idle;
end if;
end case;
end process;
advance_fsm : process
begin
wait until clk'event and clk = '1';
end exfsmarch;
Limitation
FSMs are not supported inside loop generate blocks.
Branch Coverage
Note:
VHDL branch coverage is an LCA feature. For more information
about the LCA feature, see the section Using VHDL Branch
Coverage in the VCS MX LCA Features Guide.
r1 (r2 && r3) (r5 && r6) (r7 && r8) (r10 && r11)
1 1 1 - -
1 1 0 - -
1 0 - - -
0 - - 1 1
0 - - 1 0
0 - - 0 -
default - - - -
By default, VCS does not monitor branch coverage for if and case
statements and ternary operator(?:) if they are in user-defined tasks
or functions or in code that executes as a result of a for loop. You
can, however, enable branch coverage in this code.
res <= a ? b : c;
If ternary expressions are more than one bit, branch coverage tracks
them in the same way as it tracks the ternary expressions having one
bit. For example, consider the following expression:
reg a, b, c, f;
reg [3:0] d, e, g, h;
assign a = b ? ( c ? d : e ) : ( f ? g : h );
assign a = b ? ( c ? d : e ) : ( f ? g : h );
-1- b
-2- c
-3- d
-4- e
-5- f
-6- g
-7- h
Branches:
Expression Results
Branch value coverage monitors the value of all leaf alternative
expressions in ternaries. This includes both simple expressions, as
in the examples above, and complex expressions. For example,
branch coverage tracks the values of sx and
((4’d2 << ss) + ({2’b0,le[1:0]} << fs)) in the following
expression:
-1- (a|b)
-2- sx
-3- ((4’d2 << ss) + ({2’b0,le[1:0]} << fs))
Branches:
-1- -2- -3-
0 - 0 Covered
0 - other Not Covered
1 0 - Covered
1 other - Not Covered
Instead, the constant result is omitted from the list in the report, as
shown in the following example:
-1- a
-2- tied0
-3- c
Branches:
-1- -2- -3-
0 - 0 Covered
0 - other Not Covered
1 0 - Not Covered
1 other - Covered
If all results are constant, branch coverage omits all leaf values and
only reports ternary conditions. For example, consider the following
expression:
-1- oe_s
-2- kp_hold
-3- kp_hold
Branches:
-1- -2- -3- Status
1 1 - Not Covered
1 0 - Not Covered
0 - 1 Not Covered
0 - 0 Not Covered
-1- avec
-2- bvec
-3- cvec
Branches:
-1- -2- -3-
0 - 0 Not Covered
0 - other Not Covered
1 0 - Not Covered
1 other - Not Covered
Here, avec contains the value ‘x’ for the duration of the simulation to
get the 0% coverage reported. Note that avec remains x for the entire
simulation.
• “Command Line”
• “URG”
Note: The option to track branch values is determined at compile time
and no extra switches are required at simulation or report time.
Command Line
URG
• Zero and non-zero values are covered; x and z values are not
covered. For example:
assign out = ((din & {512 {1'bx}})? din :((~din) &
dout_temp) |(din & {512 {1'bx}})));
assign y = x & 3'bx; // this is not extracted in
// conditional coverage
• Branch values are not monitored for leaf nodes that have
unpacked dimensions.
module test
reg a;
reg z[6:0];
reg b[6:0];
reg c[6:0];
initial begin
z = a? b : c;
//Coverage should not create z = a? (b? b :b) : (c? c: c);
//and hence, the branch values are not monitored for the
//leaf nodes b and c.
end
endmodule
genvar i;
generate for (i=0; i<4;i++ )
begin: inst
always @(posedge clk)
e[i] <= ((c[i] && d[i]) ? ((c[i]!=1'b0)?
c[i]: ~c[i]) : d[i]);
end
endgenerate
initial @ All NA NA
Loops
generate line+tgl NA NA
COVERAGE
Datatypes
-cm <cov_metrics_name>
The arguments to the -cm option are as follows:
line
Specifies line coverage
cond
Specifies condition coverage
tgl
Specifies toggle coverage
branch
Specifies branch coverage
assert
Specifies assertion coverage
You can include more than one argument using a plus (+) as a
delimiter between arguments.
For example,
Functional Coverage
You can use the with clause to precisely specify the functional
coverage space for your SystemVerilog based verification
environment. This feature is applicable only for regular coverpoint
bins (transition bins are not supported).
Coverpoint Syntax
The syntax for specifying ranges for coverpoint bins to include the
with clause is as follows:
bins_or_options ::=
Where,
Examples
bit [7:0] x;
a: coverpoint x
{
bins mod3[] = {[0:255]} with (item % 3);
}
The bin definition in this example selects all values from 0 to 255 that
are not divisible by 3.
As the range list in the example includes all values of the coverpoint
variable, it can be substituted with the name of the coverpoint, as
follows:
select_expression ::=
...
| select_expression 'with' '(' with_expression ')'
| cross_identifier
The with clause for the cross further restricts the set of coverpoint
bin combinations (or ‘tuples’) that are specified by the select
expression, select_expression. The subsumed combinations
must satisfy with_expression. Instead of select_expression
(that is, expression with binsof), you can also specify the cross
identifier itself (that is, the name of the cross), to indicate that the
with clause needs to be applied to all the bin combinations for the
cross. As discussed in section “Coverpoint Syntax”,
with_expression can be an arbitrary expression (including
function calls), and involves the coverpoints that compose the cross.
The expression should have at least one coverpoint (specified by the
name of the coverpoint) as an operand.
Examples
logic [0:7] a, b;
• Does not support the solver for constraints involving function calls.
• The –covg_dump_range option that is meant for displaying the
values subsumed by bins in coverage reports, is not supported
for regular bins involving large bin ranges and having with
expressions on them.
• A runtime error is issued for bins that uses with clause and has
32767 matching items.
integer i1;
..........
c1: coverpoint i1 {
bins b1 = {[$:$]} with( item%2 == 1);
}
...........
The following sections discuss how you can write and configure test
run metrics:
You can create this lightweight VDB by providing the all argument
with the –cm_stats option as follows. This forces the creation of a
lightweight VDB directory even when coverage is not enabled or
suppressed:
The name of the test can be specified on the simv command line by
using the –cm_test option in conjunction with the -cm_name
option. Use the–cm_name option to designate a unique test name
under the directory (created using the –cm_dir option), in the VDB to
store the test records. Use the –cm_test option to assign the test
an unambiguous name as shown in the following example:
The -cm_name option provides the location where the test data
needs to be stored. If two simulations are run with the same
-cm_name value, the data of the latest simulation is overwritten over
the first. If you do not provide –cm_name option, then test is used as
a default. You can then use the –cm_test option to assign a name to
your test.
Note:
While covergroups enable themselves by default, they can be
disabled with the command line options. You can use the
-cm_stats all option in these cases to force the generation
of a test record.
In the following example, test1 is run without coverage, but with the
–cm_stats all option, so a test record is generated into a VDB.
test2 is also run with coverage and its results are stored in the
same VDB directory. Thus, both lightweight test records and regular
test records coexist in the same VDB directory:
lightweight.vdb/lightweighttest1
mixed.vdb/lightweighttest2
mixed.vdb/regulartest3
cov.vdb/regulartest4
Table 4-1 lists the test run metrics automatically recorded by VCS.
or
Some test run metrics can be displayed in the primary list of tests
next to the coverage scores and test names. This can be used for a
quick reference or for sorting the tests using one of these metrics.
Test run metrics are only displayed in the primary list of tests when
the grade option is used. Specify the type of test grading to perform
as the sub-argument to the -grade option (for example, -grade
index), or use -grade list to create a primary test table without
grading the tests.
For example,
Cost-based grading shows the cost type selected for grading and the
running total of that metric, by default. For example, if -grade cost
simtime is used, row #N in Table 4-1 shows the simulation time for
test #N along with the simulation time total of the tests 1 through N.
You can modify the default behavior and add more columns using
the columns argument.
For example, execute the following command line to gather the test
record information of a merged database:
This command gathers the test record from each run in the
test.xml file in the merged database because of the inclusion of
the -dbname option.
Note:
To dump test records while merging vdbs, it is not required to pass
the -show tests option.
The -show tests option only controls the display of the test
records/test correlation data in the URG reports. You can generate
the URG report with the test record of the merged database using the
following command:
• Passing the -cm_stats option to the vcs command line with the
-R option is not supported.
• Random seed information is only available when there is
covergroup data for the test.
If you specify the -show tests option to URG when merging, the
resulting merged database notes, for each covered object, which
tests covered it, up to a maximum number of tests per object. You
can also specify the maximum number of tests to be stored for each
object using the -db_max_tests option, as follows:
• “Serial Merging”
• “Parallel Merging”
You can also use the following algorithms to influence how coverage
data from different tests is combined when merging:
• Default merge
• Flexible merge
• Union merge
• Reference merge
Serial Merging
For example, consider that you have run four tests and therefore
have four sets of test results. When you employ serial merging on
these tests, it starts merging the test results of the with the first two
tests. It then merges this merged results with the results from the
third test, then merges the new merged results with the results from
the fourth test to generate the final merged test result.
test1
job1
test2
test3
test4
test5
job2 job4
test6
test7
test8
test9
job3
test10
test11
Notice that there is a hierarchy of levels to the jobs. The first three
jobs are on the first level, the fourth job is on the second level.
You can control the number of tests that URG merges into a group,
and the number of lower level groups that go into a higher level
merging. If you specify a smaller the number of tests to be
considered per merging, it results in a higher number of jobs (and
thereby levels) created to complete parallel merging.
You can specify the number of tests that should be considered for
merging, and the number of lower-level mergings in a higher-level
merging, using the -parallel_split integer option, as
follows:
If you specify a lower number of tests per merge, the number of jobs,
and the associated levels increases. Therefore, for twelve tests,
specifying a value of 3 creates six jobs on three levels and specifying
a value of 6 creates three jobs on two levels.
You can choose the machines on your network that you want to run
parallel merging jobs on. To do so, list the machine names on
separate lines in a text file and provide the file name as an argument
to the -parallel option.
RHEL32_machine1
RHEL32_machine2
RHEL32_machine3
RHEL32_machine4
Following the -grid option, you can pass the secondary options
-sub and -del to run and clear the GRID engine respectively.
In this example, URG starts the GRID engine with the qsub
command. URG appends -l arch=1x24-amd64 -P bnormal to the
qsub command line. After parallel merging, URG passes the qdel
command to the engine to clear the engine.
You can also run your parallel merging operation on an LSF engine
using the -lsf command-line option. Similar to the -grid option,
you pass the optional arguments to the engine in quotation marks
that follow the option.
With the -lsf option, you must enter the secondary options, -sub
and -del, to enter the commands to create and control jobs in the
engine. The following is an example of using the -lsf option:
Merge Equivalence
To merge two coverpoints or crosspoints, you should merge them
equivalent to each other. The following section lists the requirements
for merge equivalence.
Example
The example discusses two tests with minor changes in the
functional and assertion coverage models. The changes are marked
in boldface.
Coverpoint Analysis
The key value is that the coverage gathered for all versions of all
parts of a covergroup is retained, and the data for parts that does not
change is merged across all the test runs. In contrast, reference
merge splits covergroups that have any differences between them,
along with their data. Flexible merge is similar to union merge, but
flexible merge discards data from the changed parts of a covergroup,
whereas union merge saves the data for each changed part so that
data can be retrieved later if the covergroup definition changes .
Figure 5-3 illustrates the union merging flow. As simulations run with
different models, all variations are combined to produce a superset
coverage model and to merge the merge-able data down to the
coverpoint bin level. When it is required to generate a snapshot, a
specific reference model is chosen and the superset coverage data
is extracted based only on the coverage objects in the union-merged
database that match those in that reference model.
Note:
Code coverage is not supported with union merging.
You can perform union merging in URG using the union merge
report-time option. To enable union merging, use the union option
along with -flex_merge on the urg command line, as follows:
P New merge-equivalent version Data from identical bins in version A and B are
of P merged.
Bins unique in either A or B are preserved with
their coverage data.
Bins with the same name but different in A and
B are preserved as multiple copies, each with
their own unmerged data.
P New version of P that is not Two coverpoints named P appear in the final
merge-equivalent merged result, one containing A's data and one
containing B's data
Scoring
Scores are computed normally during union merging. In the default
mode, the scores of each coverpoint and cross are averaged
together to compute the score of the group. In group ratio mode, all
numerators (covered count) of coverpoints and crosses are added
and divided by the sum of all denominators (coverable). For more
information about computing scores by ratio, see section Compute
Coverage Score by Ratio in the Coverage Technology Reference
User Guide.
The following are the other merging modes besides union merging:
Examples
This section illustrates the various examples that are union merged.
Consider two code versions, Version A and Version B of a
covergroup G that are union merged. Note that these examples do
not define any functionality.
Note:
If a new bin is added and another bin deleted, all bins are still
displayed in the merged result. If a bin itself changes, the hit counts
of the bin are added up in the merged result.
Added Coverpoint
The merged result is the coverage from version A and version B that
are merged; the union of coverpoints in both covergroups is retained.
covergroup cg3;
urg -dir A.vdb B.vdb covergroup cg3;
coverpoint data1;
group flex_merge_drop coverpoint data1;
coverpoint data2;
coverpoint data2;
coverpoint data3;
endcovergroup
endcovergroup
The following is the union merged result with two copies of cp1:
With this data, you observe that for reference merge, the data for the
second copy of cp1 (with max 64) is discarded, as follows:
Note:
The -flex_merge drop option can be used as an equivalent
to -group flex_merge_drop. The drop option to
-flex_merge enables drop mode of flexible merging for
covergroups. For more information about -group
flex_merge_drop, see Section “Flexible Merging for
Covergroups”
endmodule
To enable the drop mode of flexible merging, use one of the following
commands:
OR
top.inst2:
coverpoint cp1; (Scores of cp1 from both databases are merged)
coverpoint cp2; (Scores of cp2 from latest.vdb are retained)
coverpoint cp3; (Scores of cp3 from both databases are merged)
coverpoint cp4; (Scores of cp4 are skipped, no longer reported)
top.inst1:
coverpoint cp1; (Scores of cp1 from old database are retained)
coverpoint cp2; (Scores of cp2 from old database are retained)
coverpoint cp3; (Scores of cp3 from old database are retained)
top.b.inst:
coverpoint cp1; (Scores of cp1 from old database are retained)
coverpoint cp2; (Scores of cp2 from old database are retained)
coverpoint cp3; (Scores of cp3 from old database are retained)
top.b.inst3:
coverpoint cp1; (Scores of cp1 from latest database are retained)
coverpoint cp2; (Scores of cp2 from latest database are retained)
coverpoint cp3; (Scores of cp3 from latest database are retained)
Along with the report of the recent shape of top.inst2, the shapes
of the covergroup instances top.inst1 and top.b.inst that are
not present in the latest coverage model are also reported.
top.inst2:
coverpoint cp1; (Scores of cp1 from both databases are merged)
coverpoint cp2; (Scores of cp2 from both databases are merged)
coverpoint cp3; (Scores of cp3 from latest.vdb are retained)
coverpoint cp4; (Scores of cp4 are skipped and no longer reported)
top.inst1: //DELETED since they are not present in the latest coverage
model
top.b.inst: //DELETED since they are not present in the latest coverage
model
top.b.inst3:
coverpoint cp1; (Scores of cp1 from old database are retained)
coverpoint cp2; (Scores of cp2 from old database are retained)
coverpoint cp3; (Scores of cp3 from old database are retained)
If there are multiple tests present in the base database, URG selects
one of those tests as the base test and it would be considered as the
reference test. URG does not specify which test would be
considered as the base test. Therefore, it is always recommended to
pass a base database containing only the test that contains the
entire and the latest coverage model.
Consider that the latest coverage model has covergroups CG1, CG2,
CG3, but different seeds lead to instantiation of different covergroups
in each test, as follows:
Command Line:
Note:
If conflicting flex merge options are passed, for example,
-flex_merge reference+drop or -flex_merge
reference -group flex_merge_drop, then reference
takes priority over the drop merge and the reports are generated
accordingly.
You can reset the scores of all coverable objects to zero. The scores
of code, assert, and covergroup coverage can be reset to zero. As
the reset database contains the latest covergroup shape, it can be
used as a reference database to generate a report from a union-
merged database. For more information about reference database
and union merged databases, see Section “Reference Merging for
Covergroups and Assertions” and “Union Merging for Covergroups” .
For example,
Note:
It is mandatory to pass -dbname reset.vdb along with
-reset_coverage.
This section describes a feature that allows coverage data for toggle
coverage to be merged on a signal-by-signal basis instead of
module-by-module (or instance-by-instance) basis under a switch.
• “Use Model”
• “Limitation”
The base design is the first design and the input design is the other
design to be merged with the base design. If there are multiple input
designs, each design is merged one at a time with the base design.
where,
• <base.vdb> and <input.vdb> are the base database and input
database respectively. Note that both directories must be either
a compile-time VDB or a merged VDB produced with URG's
-dbname option. VDBs that are produced using the -cm_dir option
on the simv command line cannot be merged in this mode.
• -flex_merge tgl enables reference merging for toggle coverage
metric.
The rules for toggle reference merging are as follows:
1. Only signals that exist in the base design are retained. Signals
that exist only in the input design are discarded.
2. Coverage data of the signals that exist in both databases with
same bounds and size are merged from both designs.
Only the data from the base design is shown in the Default Flow
columns of Table 5-16 to Table 5-23, as any design change causes
the data from the input design to be discarded for all signals in the
module.
Now, In the first row of the table above, signal b exists only in the
base design. In the default flow, coverage for a is taken only from
base.vdb because all of the input design data for this module is
discarded. In the reference merging flow, coverage data for a and b
is merged from both, that is, base.vdb and input.vdb (see
Table 5-16).
b No No b No No b No No
Table 5-17 Default and Reference Merging Flows for all Signals
Base Design, Input Design, Default Flow Reference
base.vdb input.vdb Merging Flow
b No No b No Yes b No No b No Yes
c Yes No
b No No a Yes No b No No b No Yes
If bounds change for the signal v from [3:0] to [5:2], the input data
for v is discarded and the data for a is merged from both designs
(see Table 5-19).
v[2] Yes Yes v[4] Yes Yes v[2] Yes Yes v[2] Yes Yes
• “Region Changes”
• “VDB Directory Types”
Region Changes
As with the default flow, coverage for a module or an instance that
exists only in the input design is not retained when merging. For
example, consider Table 5-21 in which the module name, mymod, is
same in both base.vdb and input.vdb. However, their instances are
different, that is m1 in base.vdb and m2 in input.vdb. In this case,
only data for m1 is retained and data for m2 is discarded.
For the input design, toggle coverage merging happens only for
those iterations that exist in the generate statement of the base
design. For example, see Table 5-23:
Simulation-only VDB It is created by a simv executable % simv -cm tgl -cm_dir simv.vdb
that uses the -cm_dir flag to direct
runtime results to a new directory, where,
or to one that was previously -cm tgl adds runtime data to simv.vdb
created by another simv run.
Simulation-only vdbs contain only
runtime coverage data, and no
shape or design information.
Merged VDB A merged vdb is one created with % urg -dir comp.vdb simv1.vdb
the URG -dbname flag. When URG simv2.vdb … -dbname merged.vdb -
creates a merged vdb, it includes noreport
shape, design and runtime where,
coverage information in it. -dbname is used to create merged
coverage database.
<base_design>
The first directory mentioned is the base design and will report
the design coverage directory after the merge.
<input_design>
The second directory provided to the URG command line is the
input design. The input design coverage is merged into the base
design.
<module name>
base design
design 2
mapped
coverage
mapped design
2. Compile the mapped design for coverage and then simulate that
design while monitoring for coverage. For example:
% cd /net/design2
% vcs -cm line sub1.v sub5.v main.v test.v
% simv -cm line
3. Run URG specifying the name of the top-level module in the sub-
hierarchy. Also, specify the coverage directory for the base
design, and then specify the mapped design. For example:
% urg -dir /net/design1/simv.vdb /net/design2/simv.vdb \
-map sub1
The files generated using this command, only contain sections for
the module instances in the sub-hierarchy. These module instances
are identified by their hierarchical names in the first (or base) design.
The coverage information in these sections is the coverage
information from both designs.
You can use the -map option in the URG command line to map
assertion coverage from two designs. This section discussed
different scenarios that help you understand how assertions are
handled. The basic syntax of the -map option is as follows:
Syntax
Example
% urg -dir coverage_chip.vdb -dir coverage_block.vdb \
-map block
Syntax
Known Issue
By default, the report contains data only for sections for the entity
instances in the sub-hierarchy. These entity instances are identified
by their hierarchical names in the first or base design. The coverage
information in these sections is the coverage information from both
designs.
The first directory specified with -cm_dir must have both t1 and t2
instantiated.
A B
My_Ip B C
Common My_Ip1 My_Ip2
My_Ip1 My_Ip2
Base Input
The mapping configuration file for this example will contain the
following information:
MODULE: My_Ip
INSTANCE:
SRC: B.My_Ip1, B.My_Ip2
DST: A.B.My_Ip1
• If the instance name from the input design matches the pattern
given in the -mapfile file_name file, but if it does not
correspond to the module for which the pattern is provided, it is
ignored.
• Rules applied for mapping are applied in all directories given by
the -dir option.
Example 1
MODULE: My_Ip
INSTANCE:
SRC: *
DST: A.B.My_Ip1
Example 2
If you want to merge one instance of the input design into all the
instances of the base design, use the * wild-card after DST:
MODULE: My_Ip
INSTANCE:
SRC: B.My_Ip1
DST: *
This syntax merges the data from B.My_Ip1 into both A.B.My_Ip1
and A.C.My_Ip2.
Syntax
Example
Syntax
MODULE: block
INSTANCE:
SRC: B.My_block1.bind_My_block_1,
B.My_block2.bind_My_block2
DST: A.B.My_block.bind_My_block_base
MODULE: block (This is required if you are interested in mapping
line, toggle, code coverage for same block).
INSTANCE:
SRC: B.My_block1, B.My_block2
DST: A.B.My_block
Note:
URG issues the following warning during report generation for
this case; however, mapping is correctly done.
MODULE: block_sva
INSTANCE:
SRC: B.My_block1.bind_My_block_1,
B.My_block2.bind_My_block2
DST: A.B.My_block.bind_My_block_base
If you use the -map option and merge the VDBs keeping VDB1 as
the base, a warning message is issued stating that the secondary
VDB(VDB2) has assertions that are not present in the base VDB and
those assertions will be discarded. If you want to keep such
assertions in the merged VDB, then use the -map_merge_union
option in conjunction with -map or -mapfile option. The report
generated using the -map_merge_union option is independent of
the order of VDBs specified on the command line.
When you use the -mapfile or -map option along with the
-map_merge_union option, no warning is issued, as shown in the
following command:
However, if you change the location of a source file, you can map the
path to the relocated file using the -pathmap option.
For example:
/home/work/src : local/files/source
Limitation
• “Test Grading”
• “Cost-Based Test Grading”
• “Parallel Test Grading”
• “Using Grading in a High-Coverage Environment”
• “Generating Graded Test List Files”
• “Modifying Overall Grading Scores”
Most test suites contain a large number of tests, and this number
keeps increasing with the evolution of the DUT. As the test suite is
developed, it often results in the creation of redundant tests that
check overlapping functionality.
You can use the -grade option to URG to specify and run test
grading on a test suite and generate test grading reports.
Your test suite achieves a certain level of coverage when all tests are
run. Grading results in an ordered list of tests in "best first" order that
achieves the same coverage as the full suite of tests, such that only
the required tests are selected, and tests that are not required for
coverage are excluded.
To grade a set of tests, invoke URG with the -grade option. There
are many options to control how grading is executed and reported,
but the basic decisions you have to make are as follows:
If the original test VDBs are available when grading is done, and test
standalone scores ("TEST" in the reports) are being reported, URG
loads those individual tests' data to compute those scores. This is
enabled by default and can be interesting as a reference, but can
add a significant amount of time to the grading process. To omit
reporting the test standalone scores, add scores total+incr as
an argument to the -grade option.
To specify the total number of tests for grading, use the following
command:
N can be any positive integer. Its default value for N is 20. In theory,
you can use N equal to the total number of tests you are grading for
the highest quality report, but in designs with millions of objects this
is generally not practical.
You can also merge the tests yourself and then grade from the
merged VDB, as long as you create the merged VDB with the -show
tests option passed to URG. Similar to the indexlimit option
discussed above, a merged VDB does not record every test that
covers every object by default. You can control the maximum
number of tests tracked per object with the -db_max_tests option
when merging.
For regular grading, the benefit is merely how much the test will
improve the overall coverage score when merged with the already-
chosen tests. This results in a list of tests in best-first order that uses
the fewest number of tests to reach the coverage goal.
This happens because when choosing the first test, these benefits
are computed for each test:
As TST3 has the highest benefit, it is chosen as the first test in the
list.
When you are not performing cost-based grading and you view the
test metrics, any missing metrics are shown as “--”.
Note:
When you specify columns along with -grade cost, URG will
not automatically include the specified cost metric. For example,%
urg -grade cost cputime columns seed shows only the
seed value and not the cputime in the report.
Note:
For index grading (not cost-based) with assertion or covergroup
coverage, SimTime, Seed and 48Seed are automatically
displayed in the URG report.This behavior is retained for
backward compatibility as shown in Figure 6-8.
For example:
Note:
You can perform either default (best-first) or cost-based grading
using this option.
When these options are given, merging is done in parallel and the
grading step is done in one serial step at the end.
• “Use Model”
• “Recommendation”
Use Model
Recommendation
To generate graded test files, use the testfile argument with the
-grade option in URG.This command generates the
gradedtests.txt text file, which contains a simple list of graded
tests and is easy to parse. These tests are different from the score
values generated in the URG tests.html or tests.txt report
When you use quick, greedy, or index grading, URG generates the
urgReport/gradedtests.txt file.The gradedtests.txt file
begins with the following comment, followed by the list of test names:
You can modify the overall graded score by modifying the weights of
each metric using the -scorefile option. The -scorefile option
enables you to specify a separate score file that allows you to assign
a different weight to each metric.
To instruct URG to use the score file, use the following syntax:
Note:
You can use either the -scorefile or -metric option, but not
both.
metric1 weight1
metric2 weight2
…
metricN weightN
In this file, each metric can only be specified once. The metric names
are the same as those used for the -metric option on the command
line (for example, line, cond, assert). Each weight must be a
non-negative integer.
line 1
group 2
In this case, the overall score and the score for each test will be
computed as follows:
You can open the covergroup coverage database for editing using
the URG -group db_edit_file command option. An example of
the URG command with the -group db_edit_file option is as
follows:
Note:
VCS does not support editing the code coverage data.
Where,
funccov|assert:
Identifies the metric type. Use the keyword funccov to edit a
covergroup and assert to edit an assertion.
module|tree:
Identifies the scope of the operation. Use module if the operation
applies on all instances of the module and tree if the operation
applies only on a specific instance.
covergroup_name:
Identifies the name of the covergroup that is the target of the
operation.
The reset command enables you to reset the hit counts of all bins
in a covergroup to zero.The following examples illustrate the usage
of the reset command:
• To reset the hit counts of all assertions under the instance top.i1,
use the following command.
begin assert reset tree top.i1 end
• To delete all assertions from all instances of the module mid, use
the following command:
begin assert delete module mid end
You can reset the scores of all coverable objects such that all hit
counts are zero and every object is marked uncovered. Such a reset
database retains the shape information for the design, and can be
used as a base design for merging, but with all coverage information
removed. For more information on reference database and union-
merged databases, see Section “Reference Merging for
Covergroups and Assertions” and “Union Merging for Covergroups” .
For example,
Note:
It is mandatory to pass -dbname <reset.vdb> along with
-reset_coverage.
Annotated
Spreadsheet
Note:
For the test metric, the cell color is based on the (pass count)/
(total test count) percentage.
For example, Figure 8-3 shows the pop-up window for the source
string /cfg1/CPU1/L1CACHE/* and seven matched testcases,
with an annotated score of total=7 pass=6 fail=1. The pop-up
window illustrates details about how this score was aggregated.
Figure 8-3 Pop-up Window for a Source String and With Matches
If the number of matched regions is too high, you can set a filter, for
example, to see only the testcases with pass or warn. In this case,
you can use -ss_show_sources test pass+warn at the
command line. For more information about using the
-ss_show_sources switch, see section, Using the Spreadsheet
Annotator Commands in the Verification Planner User Guide.
• “Opening a Database”
• “Loading Multiple Coverage Tests Incrementally”
• “Loading and Saving Sessions”
• “DVE Coverage Source/Database File Relocation”
• “The Navigation Pane”
• “The Coverage Summary Map Window”
• “Review Flow for Unmappable Exclusion”
• “The Coverage Detail Window”
To start DVE in the coverage mode, enter the dve command with the
coverage command-line options as follows:
-cov
Opens the DVE Coverage GUI.
-dir <dir>
Opens the coverage database in the given directory.
Other Options
You can also append the following options as required: -f <file>
Opens the coverage directories listed in the given file.
-tests <file>
Opens coverage tests listed in the given file.
-show availabletests
Lists the available tests for the given design.
-assert minimal
Reports only modules and instances which have assertion in
assertion coverage. Code coverage database can not be loaded
with this option.
You can click the Tips>> button to read the description of each of
these options.
5. (Optional) Click any of the following buttons above the test
directories list box to add and remove the directory:
- Selects all tests in the list. If you select more than one test
file, the results of the tests are merged.
7. Accept the default name or enter a new name for the test results.
8. Click OK.
The DVE Coverage window is populated with coverage
information, as shown in Figure 9-2.
Navigation pane
Console Window
You can interactively load many coverage tests and merge them
interactively in the DVE Coverage GUI. With the incremental loading
feature, you can re-open the Open/Add Coverage Database dialog
box and select the third test, load it, and merge it together with the
previously merged tests. Thus, you can save time needed to close,
re-open, and merge the database.
1 2
2. Click the left icon from the Test directories field (indicated as 1
in the figure) to add a test path.
3. Repeat Step 2 to add multiple test, if required.
4. Click the icon indicated as 2 in Figure 9-3, if you have a file with
test paths.
You can either perform step 2 or 3, or both to add the test
directories.
5. Specify the test path in the Tests to Open field.
Saving a Session
You can save all session data or arrangement of windows, views and
panes for later reuse.
Loading a Session
To load a previously saved session, execute the following steps:
If you change the location of a coverage file, and then attempt to load
that file with DVE, DVE displays a dialog asking you to provide the
new location of the file.
After you provide DVE with the new location of the file, DVE
subsequently uses both the built-in location and the new location
information you have provided.
For example, assume that the location of a file foo.v (as specified
in the coverage database) is as follows:
/A/B/C/foo.v
Consider that you moved the file to this location, which you provided
to DVE:
/X/Y/C/foo.v
/X/Y
Assume now that DVE performs a search for the following file, based
on database information:
/A/B/E/bar.v
/X/Y/E/bar.v
If DVE cannot find the file using the default location, then DVE
displays a dialog asking for the correct location of the file.
Note:
DVE can only remember one root location directory at a time. DVE
replaces any earlier root location directory with whichever new
location you specify.
drop-down shows
current coverage
database Filter drop-down
The Main Coverage Table window shows you the summary of each
type of coverage. For example, Figure 9-6 shows the details for lines
covered.
Show
Provides the following options:
Functional Groups
Displays results by user-defined groups including total score and
scores for cover directive and covergroup coverage.
Instances
Displays results by module instances and their total coverage
score and individual scores for line, condition, FSM, and toggle
coverage. There is a row for each module instances (click the plus
(+) to the left of the top-level module to see the instances under
it). A plus down the design hierarchy indicates new instances to
be revealed.
Test
Provides the name of the merged test that you specified in the
Open Coverage Database dialog box, see Figure 9-1.
Hierarchical Coverage
Specifies whether to display hierarchical or local coverage
numbers in the table. If it is checked, for each instance, functional
group, or module, the numbers are aggregated for all objects
hierarchically under the selected item. When you clear this check
box, the coverage numbers are for the particular item and do not
include the objects under them. When the Show field is set to
Modules, there is no hierarchical display possibility and this check
box disappears.
Detail Window
Displays coverage for each coverage type available. By default,
the Detail window shows the coverage for the metric
corresponding to the clicked column for the object in the clicked
row. Click a cell to view the Detail window.
Use the Map window for a quick view of the overall coverage results.
The map window tabs displays results in customizable color-coded
ranges to help identify coverage areas of interest and overall
progress. Figure 9-7 shows a coverage map and the default color
key and range.
You can change the root of the map by dragging and dropping a
functional group, instance, or module from any other window.
Ports,
variables, and
signals
Note:
When viewing annotated data, DVE requires the original source
files to be unaltered since the compilation.
2. Click the Create new group icon , then accept the default
name or name your group.
3. Select cover groups and assertions from the Name list, search
using a search string, or click More to specify search options and
criteria.
4. Drag and drop the desired items into your created group.
5. Click OK.
Your group gets created and the dialog box closes. You can click
Apply to save the group. The dialog box remains open and you
can make more groups.
The detailed pane displays only single cover group. So, when you
drag-drop or double-click a cover group variant, the detail pane
populates with only one cover group, as shown in Figure 9-12.
• The Annotated source window allows you to view the source files
annotations that shows you which code has and has not been
covered. The highlighted colors can be changed using the Colors
tab in the Preferences dialog box. The color banding adjacent to
the scroll bar aid in navigating the code. Figure 9-9 shows the
Source Window with annotations, and the default annotation
colors.
• The Detail Window for line coverage displays metrics for coverage
of blocks and statements. A block of code is a group of statements
that always will be executed together.
The top level MDA is expandable to its next level of indices similar to
a vector. Each of the MDA's layers are expandable until the bit level.
Similar to vector, the coverage information of each layer of the MDA
consists of coverage for 0->1 and 1->0 transitions.
You can exclude the top level MDA, any MDA layer in the middle, or
the word and bits.
The Condition Detail Window helps you monitor whether both true
and false states of the conditional expressions and sub-expressions
in your code are covered.
You can enable the observability based condition coverage using the
-cm cond -cm_cond obs compile option.
In the DVE Coverage GUI, you can view the observability expression
in the Expression Displayer pane. The observability expression and
its values are displayed in the format: [Expression]=[Value].
Displaying Sequences
The Sequences view shows states and sequences and their
possible coverage numbers that an FSM can follow to reach from
one state to another state. Holding the cursor on a cell displays a
tool-tip showing the sequences and their coverage.
Note:
You must turn on the sequences at compile-time to view them in
DVE by using -cm_fsmopt sequence switch.
This section describes branch coverage. You can view the branch
coverage information in the following windows:
• Source pane - allows you to view the source file annotations that
shows you which code has been covered and which has not. The
source code lines are color-annotated according to their coverage
values. You can see only the line of branches as color-annotated
and not the line of terms.
You can also see the missing Else/Default statements annotated
in the Source pane.
• The Detail List View - allows you to view the items and branches
on the left side and the branch path list on the right side. When
you select the items, the Value column will be empty. When you
select the branch, the value column gets populated with the
branch’s value.
• Show drop-down - allows you to look at the coverage of other
instances or module variants corresponding to the current
instance or module.
SVA assert and cover statements and OVA assert and cover
directives appear in the Navigation pane and in the Details
Window Covers tab.
Note:
DVE uses the same symbol for SystemVerilog and OpenVera
assert or cover statements and directives.
top. dev1.specdev1.cover1
top.dev1.specdev1.checker1.assert1
top.dev1.specdev1.ova_unit_instance_name.directive_name
Hierarchical name of the Instance name for the Name of the directive
module instance to which OpenVera assertion
the OpenVera assertion unit
unit is bound
top.dev1.specdev1.assert1_inst00000000.directive_name
The Detail Window Covers tab places the name of the directive in
a separate column from the rest of the hierarchical name.
This section describes the fields and columns in the Covers Tab.
Figure 9-27 OpenVera assert and cover Directives in the Covers Tab
The Instance column lists the module instance that contains the
assert and cover statement or directive. If you bindan SVA
module, this name also include the instance name for the SVA
module. Each entry in this column also begins with the symbol for
one of these statements.
The Attempts column lists the number of times VCS searches to see
if the assert statement or directive succeeded or the cover
statement or directive matched.
The Failures column shows the number of times assert does not
succeed. cover does not have failures, so the entry for cover
statements in this column will always be 0.
The SVA and OVA constructs specify the clocking event that defines
the coverage data reported during simulation and specifies the
coverage points monitored.
When you open a database, DVE displays the SVA covergroups and
OVA covergroup in the Functional Groups folder in the Navigation
pane.
To drill down for details of the cross or cover point results, you can
double-click on a rectangle in the map view or drag and drop, or
select a cross in the left pane.
Without the -group ratio option, the score for a cover group is
calculated as the average of the percentages of individual cover
point scores.
Score of cov1 50% is the average score of cp1, cp2, and cp3, as
shown in Figure 9-36.
3. Click OK.
DVE makes this mode as default until you again enable this feature
by clearing the Show full hierarchy, including instances that
have a hierarchical coverable count of zero check box.
Note:
Command-line option takes precedence over preference setting.
You can use the DVE Coverage GUI to create HVP files. An HVP
(Hierarchical Verification Plan) is a comprehensive model that allows
you to hierarchically describe a verification plan. You can then
annotate that plan with live verification data using the Unified Report
Generator (URG) tool.
For more information about HVP files, see the LCA category in the
VCS Online Documentation.
Running Scripts
You can perform any DVE operation with Tcl commands, including
using Tcl scripts to modify the display of your coverage data. For
example, you can omit the display of statement, instance, or module
coverage.
You can generate a URG report from the DVE coverage GUI. URG
Window is the interface you use to generate the URG report. You
need to set the configuration options in the URG Window and run
URG to generate the report.
To run URG and view the customized report, repeat Steps 7 and 8.
• “Supported Metrics”
• “Invoking URG”
• “Format to Display Coverage Results”
• “What is Covered in Each Coverage Metric”
• “Difference Reports for Functional Coverage”
• “Reporting Only Uncovered Objects (-show brief)”
• “Summary Only URG Reports”
• “Coverage Report Files”
Supported Metrics
• Code coverage
- “The Line Coverage Report”
- “The Toggle Coverage Report”
- “The Condition Coverage Report”
- “The FSM Coverage Report”
- “The Branch Coverage Report”
• “The Assertion Coverage Report”
• “The Covergroup Report”
The following reports are generated as .html or .txt files:
Invoking URG
Data files are grouped into tests based on the names of the tests.
Therefore, if you have the following data files, URG considers all of
them as data for 'test1'.
./simv.vdb/snps/coverage/db/testdata/test1
-metric [+]line+cond+fsm+tgl+assert+group
For example:
Data from the following tests was used to generate this report
simv/test_0
simv/test_1
simv/test_2
For more details about how versioning is done, see the section
“Version Check” in the Coverage Technology Reference Manual,
which discusses the major / minor version numbers maintained in
the database's XML files. Note that DVE Coverage GUI and URG
uses the UCAPI, thus the requirements are the same.
• Statistics table
• Table of coverable objects
Statistics tables are summaries of types of coverage elements. Each
line in a statistics table reports the coverage for a class or category
of object. Figure 10-1 shows an example of a statistics table for line
coverage:
Statistics tables are color-coded using the same color legend as for
coverage tables shown in Figure 10-45.
For all types of coverage, the data section begins with a statistics
table showing the basic categories (for example, lines, statements,
and blocks, or logical and non-logical conditions). This is followed by
a table of coverable objects.
Note that several metrics have options that change exactly what is
covered and how to display it. For example, use the condition
coverage option -cm_cond allops to control which vectors and
conditions are monitored. For more information, see the Coverage
Technology Reference Manual in the VCS VCS MX SolvNet online
support site at:
https://solvnet.synopsys.com/
URG, by default, shows detailed coverage reports for all the modules
and instances for any given metric. URG shows the entire summary
table for a metric it reports. Figure 10-2 is an example for toggle
coverage report.
The line coverage report starts with a table listing individual statistics
of each always block, initial block, VHDL process, and continuous
assignment. For example,
Note that each line in the table is identified by its type (always, initial,
continuous assignment, and so on) and its starting line number.
These entries do not represent the scores for individual lines or
statements, but for the whole always block, initial block, VHDL
process, or continuous assignment. You can then see which part(s)
of the module require the most attention.
Note:
When statements are spread across multiple lines, the covered/
coverable numbers and the coloring will only be shown on the first
Note that URG only lists lines with statements on them in the
simplified report.
Use Model
Consider the following design source code file source.v and the
macro file gt_macros.sv:
source.v
`include "gt_macros.sv"
2 module bot;
3 logic [2:0] sigA;
4 logic [2:0] sigB;
5 logic [2:0] a;
6 logic [2:0] b;
7 logic [2:0] a1,b1,c1,d1;
8 logic [2:0] d;
9 bit clk ;
10
11 `ALWAYS (sigA[2:0],sigB[2:0],clk)
12
13 initial begin
14 clk = 0;
15 #1 clk = 1;
16 #1
17 $finish;
18 end
19 endmodule
gt_macros.sv
1 `define DELAY #1
2
3 `define ALWAYS(q,i,clock) \
You can see the precise line coverage information of the expanded
macro instantiation. The report shows the lines that are covered and
the lines that are not covered in the macro instantiation.
URG Report
The following is the line coverage report for the preceding example:
---------------------------------------------------------------------
Line Coverage for Module : bot
10
11 3/6 ==> `ALWAYS (sigA[2:0],sigB[2:0],clk)
ALWAYS (sigA[2:0],sigB[2:0],clk):
11.1 always @(posedge clk)
11.2 begin
11.3 1/1 if(sigB[2:0])
---------------------------------------------------------------------
In the annotated coverage report, the line number shown for each
statement of a macro expansion is given as N.M, where N is the line
number where the macro is instantiated in the source, and M is the
line number of the coverable object relative to the macro definition.
So for a macro on line 11 that spans across 9 lines (as in the example
above) the first object is numbered 11.1, the second 11.2, and so on.
After the expanded macro text, the regular source code text of the
file continues on the next line.
You can distinguish the macro text from the other statements in the
HTML report as it is displayed with a light gray background.
By default, the macro text is expanded in the URG HTML report. You
can click the expand/collapse icon to show or hide the macro text.
The following report hides the macro text:
For example,
module m;
…
`ALWAYS1(`STMTLIST)
endmodule
module tb();
logic clock;
intf intf_0(clock);
mod mod_0(intf_0, clock);
initial begin
clock = 0;
forever #3 clock = ~clock;
end
initial
#15 $finish;
endmodule
module tb();
logic clock;
intf intf_0(clock);
mod mod_1(intf_0,clock);
mod mod_2(intf_0,clock);
initial begin
clock = 0;
forever #3 clock = ~clock;
end
initial
#15 $finish;
Endmodule
You can use the following command to exclude signal ack from all
instances of module mod:
• Enums are not supported within interfaces. You can infer real
values of enum changes from FSM coverage, which shows
transitions between two enum states. For example:
interface intf(input bit clk);
typedef enum reg[1:0] {pink,red,yellow} color;
color d;
clocking master_cb @(posedge clk);
inout d;
endclocking
modport master (import master_cb.d);
endinterface
module tb();
logic clock;
intf intf_0(clock);
endmodule
module top;
wbone wbone_sifc[1]();
dut_shell mydut(wbone_sifc);
endmodule
module Top();
logic clock;
intf intf_0(clock);
nst_intf nst_intf_1(clock,intf_0);
mod mod_0(nst_intf_1,clock);
Top.mod_0.clk
Top.mod_0.intf1.nst_clk
Top.mod_0.intf1.s1.clk
Top.nst_intf_1.s2
The subexpression (y_tot || x_not) is then broken down into its terms,
y_tot and x_not. These are reported separately in the second
section.
Using URG, you can separate the condition report itself into its own
page. But it can happen that the condition section by itself is still too
large. In such cases with large expressions, the URG report will be
split in a list format. You can control the splitting threshold using the
URG option -split N. If page size of the line coverage annotation
exceeds N, it is moved into a new page, and links are created for
navigation.
Note:
Starting with VCS K-2015.09 release, the -split N and -split
metric options are not supported. However, these options can
be used with the -legacy option on the urg command line.
The FSM coverage report begins with a summary table for states,
transitions, and sequences for all FSMs in the module/instance/
entity. Subsequently, it shows individual state, transition, and
sequence tables for each FSM.
URG branch coverage reports display the source code text with
annotations showing both covered and uncovered branches.
Consider the following lines from a design source code file:
In Figure 10-15, the URG branch coverage report first shows the
source code, which contains the branch alternatives for a given
branch, with each branch control highlighted and indexed with a
number. Subsequently, the source code is followed by a table
showing the different combinations and the coverage status of the
control branches.
One difference between URG and DVE Coverage GUI reports is that
URG displays an arrow (==>) for each branch.
Note that the index number for control branch -1- is colored in green
because it is fully covered. The arrow (==>) is at the same
indentation as the corresponding index. The index of control branch
-2- is in red because it is not fully covered, that is, the else
statement branch is not covered.
If there are multiple branches, each branch has its individual index
and an arrow (==>) beneath each index. For example:
Number of
Line Number Branches Covered Percentage
1 3 0 0.00
15 3 2 66.67
316 2 1 50.00
URG reports the details of an assertion. It tells you how many times
the assertion has succeeded and failed.
Summary Tables
The URG asserts.html page includes five summary tables, as shown
in Figure 10-20. Every first column of these summary tables provides
a hyperlink to navigate from summary table to detail table (see
Figure 10-21).
• Assertions Uncovered
• Assertions Success
• Assertions Failure
• Assertions Incomplete
• Assertions Without Attempts
• Assertions Excluded
Note:
The “Assertions Without Attempts” table will not be included in
“Detail Report for Assertions”, if there are no incomplete
assertions.
The first column lists the names of the block identifier for assert or
cover statements.
The REAL SUCCESSES column lists the number of times the assert
statement succeeded. A real success is when the entire expression
succeeds or matches without the vacuous successes. This column
is color-coded. A cell with 0 value shows there are no real success
and is colored in red and the success values are shown in green.
Each covergroup report lists all points and crosses and their
coverage scores at the top.
There is also a section for each point and cross showing the
individual coverage percentage, information about the point or cross,
and so on.
class W {
rand bit [3:0] addr;
rand bit [3:0] resp;
program prog {
@(posedge CLOCK);
The -split N option controls the size of all files before being split.
The argument is an integer specifying the maximum size in
kilobytes (KB) for any generated file. This number is used as a
guideline, not an absolute limit. The default value is 200KB.
Note:
The page-splitting functionality applies only to HTML reports, not
text reports.
Note:
You can split covergroup using three methods: Instance splitting, Bin
table splitting, and Variable/Cross splitting.
Instance splitting
URG splitting behavior for covergroup instances resembles code
coverage splitting for module instances. When URG generates a
report for any group instance, URG checks the size of the current
page and creates a new page if the report exceeds the value you
defined with -split N.
Notice that in this mode sort works only in the current bin table sub-
page.
• A note "This cross/variable has %d bins so the list has been split
into multiple HTML pages. Click on the page number below to see
each subset of bins."
• A summary table (page link / expected / uncovered / covered /
percent).
In the following figures, Figure 10-28 shows the original report and
Figure 10-29 shows how the report is split.
When you have multiple test files (intermediate results files) from
multiple simulations, URG merges the coverage results so that if
something is covered in one, but not all the test files, URG reports it
as covered. URG indicates this information in the modinfo.txt/
mod*.html pages as to which test covered each metric.
You can use the URG -show tests option to see the list of tests
that cover objects for all coverage metrics. You can see the test
information for a specific metric using the sub-options for line,
condition, toggle, FSM, assert or group.
For example,
In the coverage detail report, to see the test name in the URG HTML
report, hover the cursor over the test number.
Line Metric
URG displays the tests covering line objects. The tests covering the
line coverage object are listed after the line.
For example, line 185 of the design source code is covered by test
numbers T1, T2 and T3 as shown in Figure 10-32. When you hover
the cursor over T3, its corresponding test name simv/test3 is
displayed as shown in Figure 10-32.
If more than one object is shown in the same line, a "|" is displayed
to separate the test list for each object. For example, both the objects
in line 194 are covered by T1, T2 and T3 as shown in Figure 10-32.
Condition Metric
URG reports the tests that cover the conditions in a design source
code.
For example, URG reports the status for the combination of truth or
falsity of the conditions kp_hold, y_tot, and x_not and displays the
test numbers T1, T2, and T3, that cover these combinations as
shown in Figure 10-33.
Branch Metric
URG reports the coverage status for the possible expression values
of control branch 1 and the test numbers that cover these
possibilities. In Figure 10-34, for the expression shown, true case is
covered by T1,T2 and T3 and false case is covered by T1, T2 and
T3.
FSM Metric
URG reports the tests that cover FSM transitions, states and
sequences. The first section of the report lists the states, status of
coverage and the test numbers. The subsequent section lists the
transitions, status of coverage followed by the test numbers that
cover these transitions. FSM sequences are listed in the third table
with its corresponding status and tests.
Tests Page
The list of tests in the tests page (tests.html/txt) has the
columns: TEST NO, TEST NAME, USER TEST NAME, STATUS,
STARTED, FINISHED and SIMULATION TIME showing all the test
numbers used in the coverage reports (T1, T2, and so on) and their
corresponding test information. For example, a tests page may
contain data as shown in Figure 10-40.
Unsupported Arguments
The -diff command line argument of the urg command is not
compatible with test correlation mode. If -diff is entered along with
-show tests or -show maxtests, an error is reported and URG
exits.
Given two tests test1 and test2, a diff report shows the difference in
the objects covered by the two tests. The difference is the set of
objects covered by one test minus the set of objects covered by the
other test.
The filename specified with the -tests flag (myfile in the example
above) must contain the names of the two tests. If more or fewer than
two tests are specified, or if the -tests flag is not given at all, URG
reports an error and exits.
The order in which the two tests are specified matters. The first test
specified is called the diff test. The second test is called the base
test. The diff operation is diff test – base test.
simv/test
simv/test_gen_1
If the -diff count flag is used, then the differences between the
hit counts are shown for functional and assertion metrics that have
counting data in tests. The hit count in the base test is subtracted
from the hit count in the diff test for each object. If the result is greater
than 0, the result is shown as the hit count in the diff report. If the
result is greater than or equal to the hit count goal (1 by default), then
the object is shown as covered.
Details about the diff being processed are shown at the top of the
dashboard and test pages. For example, assume that the –tests
file contains the following:
simv/test2
simv/test1
This report was generated with the -diff flag. The tests
used were:
The following table shows how a given object is shown in the diff
report for different combinations of coverage status in the base and
diff tests:
Note that in the default mode, the hit counts do not matter. For
metrics that support hit counts in the report, the hit count of the diff
test is shown for any objects that are covered in the diff test but not
covered in the base test. For all other objects a hit count of 0 is
shown.
1 10 7 Covered, count 3
1 1 0 Covered, count 1
For metrics for which counting is not enabled, the same reporting
rules are used as for default mode (that is, –diff object), even
when –diff count was given.
The following flags are not compatible with the –diff flag. If any of
these flags are given with the –diff flag, an error is reported and
URG exits.
• -grade
• -annotate
• -trend
• -show maxtests N
• -show availabletests
• -dbname (You cannot save a merged diff db)
• -map
Exclusions
All types of exclusion are supported with the –diff flag, including
the –hier file and the loading of exclude files.
This section describes how URG allows you to create reports only for
uncovered objects (instead of creating reports for all coverable
objects).
You can use this option in combination with text mode to generate a
brief text report:
if (some condition)
if (some other condition)
a <= (b ? c :
( d ? e :
( f ? g :
if (some condition)
if (some other condition)
a <= (b ? c :
( d ? e :
( f ? g :
If several uncovered lines are grouped together, they are all grouped
together in the report. For example:
if (some condition)
begin
if (some other condition)
begin
a <= b;
if (yet another condition)
begin
x <= y;
end
end
end
The report for the above example would show the following text,
rather than reporting the information in two separate sections:
The brief report shows both the condition and its subcondition—if
one of the subcondition is uncovered even though the condition itself
is fully covered.
If an FSM is fully covered except for its sequences, URG omits the
FSM even if the sequence score is less than 100.
If an FSM is not fully covered, URG lists all of the FSM’s states, and
only its uncovered transitions and sequences.
The -show brief option enables you to see only the uncovered
metrics. To see only the uncovered metrics, execute the following
command:
This section describes how each report section changes when you
use the -show brief option.
Dashboard
The dashboard report does not change. The total coverage
summary for the design is shown with the summary for each top-
level instance.
Module List
Only modules with an overall coverage score less than 100% are
shown. Modules with no coverable objects in them (for any reported
metric) are not listed.
For example, assume the module list report looks similar to the
following:
In brief mode, the module list report would only show the following
modules:
In other words, the only parts of the hierarchy that will be deleted
from the report are those entire subtrees that have coverage scores
of 100%, or that have no coverable objects in them at all.
Groups
The groups report omits any groups that have a 100% score.
Tests
The tests report does not change.
Assertions Report
URG lists in any of the tables only assertions that are not covered or
that failed. Only covers and assertions that are not covered are
listed.
Module Header
URG lists the same header for modules, including all self-
instances—even those self-instances that have 100% coverage.
However, the self-instances with 100% coverage do not link to any
report because their reports are not generated. URG shows all self-
instances because you can see how URG computed the scores for
the module.
If a module is hidden from the module list page, but its instances are
reported, the module header still appears at the top of the module
page because the module header contains useful information for the
whole page.
Use Model
• Dashboard
• Modlist (code or assertion coverage)
• Asserts (assertion coverage)
• Groups (group coverage)
• Tests
• Greater than zero and less than the maximum level of hierarchy,
then URG generates the hierarchy until the specified level.
• Greater than the maximum level of hierarchy, then URG generates
the entire hierarchy.
• Zero, then URG does not generate any hierarchy.
• Less than zero, then URG generates an error to mention that no
hierarchy is generated.
• Easily view the hierarchy in the design and browse to the instance
that is of interest, as the Design Hierarchy page shows the
complete tree structure of the design. For any instance, you can
expand or collapse its sub-instances. The Expand All and
Collapse All buttons on the left corner of the page enable you to
expand or collapse the hierarchy tree.
• Sort tables by clicking on column headings.
• Use new tabs and panes to switch between report sections.
• View coverage details while still viewing the definition or the
instance summary data, as the corresponding coverage scores
are displayed in the right pane.
• Provide readily viewable reports that include a concise summary
and that are easily navigable.
Recommended Browsers
URG generates a number of files that you can use to access the
report files in either HTML or text format. The HTML files contain a
common navigation menu and also follow a color-code that helps
visually assess the coverage metrics.
• dashboard
• hierarchy
• modlist
• groups
• tests
• assertions
• hvp.<plan_name>
For example,
In this example, the first cell shows the name of a region, and the
second cell shows the overall score of all metrics. (By default, this is
the simple average of all the metric percentages. You can control the
way the score is computed using the -scorefile option.)
You can resize the left pane and right pane as needed using the
resize cursor. You can also show/hide the panes with a click, as
shown in Figure 10-44. The color-code legend is displayed in the
bottom pane. By default, the color-code legend (bottom pane) is
hidden.
In the URG reports, the Dashboard page contains the Total Module
Definition Coverage Summary section and the Total Groups
Coverage Summary section. The Scores for Verification Plan
section is displayed at the top of the Dashboard page if a verification
plan is passed on the command line.
For easy viewing of coverage data, each row of the coverage table
can be selected. The selected row is highlighted in blue.
In the module definition report, the left pane shows the coverage
information for the module, a link to its source file and the list of
module self-instances (with their coverage scores). The module self-
instances are hyperlinked to the respective module instance
coverage information. Click the module-self instance, to see the
coverage scores in the left-bottom pane.
The left-bottom pane shows the coverage scores of the instance and
its sub-instances. By default, the sub-instance hierarchy tree is in the
collapsed state. This pane only lists the sub-instances that are
directly under the current instance and therefore only two levels of
the hierarchy are displayed. If the current instance does not have
any sub-instance, the second level of the hierarchy tree shows “no
children”, as shown in Figure 10-56:
Figure 10-57 displays a partial section of the modinfo text report that
includes the coverage information about both module definition and
module instances.
In the Group Definition page, the left pane shows the coverage
summary information for the current group definition, variables and
crosses. It also lists the group source file location and all the group
instances that are related to the current group definition. Click the
instance to see the group instance information in the left-bottom of
the same pane.
The right pane shows the detailed coverage information for the
variables, crosses, and bins. Click the variable, cross, or bin in the
quick navigator tab to navigate from one variable/cross to another
variable/cross.
Figure 10-62 displays a partial group info text report. The design
source file location is displayed as well.
The URG tests page shows the total coverage summary, the list of
tests, and the test run metrics of each test. For more information
about test run metrics, see Section “Correlation Report: Determining
Which Tests Covered Which Objects”.
• Assertions by Category
• Assertions by Severity
• Summary for Assertions
• Summary for Cover Properties
Detailed information about assertions, such as uncovered
assertions, successful and failed assertions, and the detailed report
for cover properties are shown in the right pane. The top navigator
allows you to navigate to these Assertion sections. Hovering the
mouse over the assertion or cover property shows the source file as
a tooltip. Click the assertion or the cover property to open the
respective source file.
Note: If there are many assertions, the assertion page gets split and
shows next page and previous page tabs to navigate pages
(see Figure 10-66).
Besides showing the coverage scores, the HVP hierarchy page also
shows all the attribute values along with the plans and features. By
default, all the attributes are displayed in the hierarchy page, and the
attribute names are displayed as column names. If you do not want
to see all the attributes in the HVP hierarchy page, you can list the
attributes of interest in a configure file. When generating the URG
report, you can append -attribute <attribute configure
For example,
% urg -dir <path of the VDB file> -plan <path of the HVP
file> -attribute <path of the attribute configure file>
Note:
The -attribute option must be used with the -plan option.
Below the Plan Navigator tab, you can find the Feature Detail
Navigator tab. This Feature Detail Navigator enables you to quickly
navigate to Sub-features, Measure Totals, Measures and Attributes/
Annotation values sections. The detailed pane shows the detailed
coverage information, such as measures and attribute/annotation
values of the feature.
Backward Compatibility
To generate the HTML reports in the legacy page format, you can
use the -legacy option. For example,
Use Model
• -legacy
- “-legacy batch_hier”
- “-legacy batch_list”
- “-legacy batch_test”
The syntax for using the -legacy batch_hier option with the urg
command is as follows:
Where,
Figure 10-72 The Design Hierarchy Page Using the -legacy batch_hier
Option
Figure 10-73 The HVP Hierarchy Page Using the -legacy batch_hier Option
Figure 10-74 The LP Hierarchy Page Using the -legacy batch_hier Option
Note:
The -legacy batch_list option does not support appending
parameters in a module in the Design Module List page.
Therefore, the value of parameters does not appear next to the
module in the Design Module List page.
Figure 10-75 The Design Module List Page Using the - legacy batch_list
Option
Note:
The -legacy batch_list option does not support appending
parameters in a module in the Testbench Group List page.
Therefore, the value of parameters does not appear next to the
module in the Testbench Group List page.
Figure 10-76 The Testbench Group List Page Using the - legacy batch_list
Option
• “Tests Page”
Note:
The -legacy batch_test option does not affect other pages such
as Design Hierarchy page, HVP/HVP Problem hierarchy page,
LP Hierarchy page, Design Module List page, and Testbench
Group List page.
Tests Page
The Tests page supports the page splitting feature by default and it
also provides a page navigator to navigate among pages. With the
-legacy batch_test option, URG disables the page splitting feature
in the page to show all records in the same page. However, it
provides the search capability on the page.
-attribute
URG does not show any attribute in the HVP Hierarchy page by
default. For example, the following command displays the HVP
Hierarchy page without any attribute (see Figure 10-78):
To view all attributes in the HVP Hierarchy page, use the -attribute
option with the -plan <hvp file> option. For example, the following
command displays the HVP Hierarchy page with all attributes (see
Figure 10-79):
You can analyze these verification trends using URG reports. URG
uses raw data from the coverage database and verification planner
metrics data to plot trend charts. These trend charts allow you to
graphically analyze the data from a number of previous URG reports.
Each URG report contains coverage data and metrics data that
constitutes a snapshot of the verification metrics for a single session,
at the point in time when that report was generated. You can use
URG to generate a set of trend charts to track the progress of your
projects using the -trend option with the URG command, as
follows:.
This command generates the trend charts and displays it under the
trend tab in the URG report, as shown in Figure 11-1.
Trend charts are most useful if you periodically sample the same set
of data over a period of time. It is recommended that you execute a
URG run on a standard set of coverage and test result data after
each complete regression. For example, you could run a nightly or
weekly cron job that first runs your regressions and then runs URG
with the -trend option.
The following are the various options that you can provide to the
-trend argument:
-report someUniqueName
Ensures that each snapshot of the URG report has a unique name.
If you do not assign unique names, the URG results will be
overwritten and you will not be able to generate a meaningful trend
report. One way to generate a unique name is to base the name
on the current date/time.
URG provides various options using which you can customize trend
charts to suit your requirements. For example, you can select the
maximum level of data details or chart details (depth) that URG
should consider while creating the trend charts.
It is important that you use the same depth while creating all
your URG reports so that you can create trend series.
In the following example, the trend chart is generated for two levels
of hierarchy:
When you do not specify the depth value, as shown in the following
commands, URG displays the trend data for the entire design. As
the depth is not specified, the default value of 1 is considered.
Therefore, the coverage report for only the top-level module is
generated. In other words, the following commands will not allow
drill-down:
-trend linestyle
Displays the lines in the trend chart in different styles (solid line,
dashed line, and so on).This feature is useful when you need to
print these charts with a black-and-white printer. Figure 11-2
shows a trend chart without different line styles. Figure 11-3
shows a trend chart generated using the linestyle option. The
line styles are automatically selected by an internal line style
palette.
-trend offbasicavg
Displays only the Plan Average lines without displaying the Basic
Average lines on the chart.
You can modify the timestamp of the current URG report using the
URG_FAKE_TIME environment variable. Set this variable before
using the urg command. Ensure that you specify the timestamp in
mm-dd-yyyy hh:mm:ss format. For example, you can set the
timestamp variable as follows:
% setenv URG_NO_SESSION_XML
When you generate a trend chart using the -trend option, URG
generates a trend chart that you can access using the trend tab in
the URG report.
The following sections discuss how trend charts are organized and
how you can use them to analyze coverage scores:
Figure 11-5 shows a diagram that illustrates the URG trend chart
organization:
Generated when
Generated when
DUT hierarchy Click legend flavor -dir
-dirisisgiven
given
Click flavor wide
sub-metric
2nd level chart breakdown
BasicAverage breakdownchart
breakdown
Curve
DUT
DUT Click legend
Click curve DUT hierarchy flavor
flavor wide
instance
instance
3rd level chart sub-metric
breakdown
breakdown
breakdown chart
Generated when
HVP
HVP hierarchy
hierarchy Click legend
Generated
-plan is is
given
when
HVP
Click PlanAverage 2nd hierarchy flavor -hvp given
2nd levelchart
level chart
2nd level chart
flavor
flavor
breakdown
Or userdef metric breakdown
Curve breakdown
DUT
Click curve HVPDUT
hierarchy’ Click legend flavor
flavor wide
instance
instance
3rd level chart sub-metric
breakdown
breakdown
breakdown chart
Top-Level Chart
URG always displays a top-level chart when you select the trend
tab as shown in Figure 11-2.
• The tooltips for line graphs display the metric name and score of
the point for each curve. In addition, if the curve is click-able, the
tooltip shows the next chart that you can see by clicking the label.
For example:
78.1% - Basic raw coverage score curve
• The tooltips for the legends above y-axis show the next chart that
you can see by clicking the label. For example:
Click to see metric-wise basic coverage breakdown chart
• The tooltips for the x-axis date labels show the exact date and
time in mm/dd/yyyy hh:mm:ss format and the name of the URG
report for each session.
Note that each x-axis date label displays the date of each session in
mm/dd/yyyy format without a time. If the number of sessions
increases, URG shows only the “-” character instead of the date for
each session.
Dip on line
curve
Click the green arrow beside Plan Average, to see the Plan Average
score breakdown page as shown in Figure 11-7. The Plan Average
chart displays the coverage metrics lines of the Plan Average score.
You can study the metric detail line to analyze the trends of coverage
scores for a metric over a period of time. You can also analyze the
factors that affect the coverage scores of these metrics, For
instance, in Figure 11-7, there is a dip on the Line coverage score in
the 11/12/2007 session. This dip could be caused due the
introduction of new code. If you inspect the Line detail chart, you see
that total number of coverable objects increased on 11/12/2007. This
increase in coverable objects caused the drop in the Line coverage
Figure 11-8 and Figure 11-9 show the details (total coverable points
line and goal line (if they exist)) for Line and Group metrics
respectively.
In Figure 11-8, the three lines represent the Line Coverage score,
the Goal of the line metric, and total number of Coverable Points,
respectively.
Hierarchical Linkage
Click the individual lines on a top-level chart, to view sub-hierarchy
charts. Consider the Figure 11-6, the green arrows 5, 6, 7, and 8 are
sub-hierarchy chart hyperlinks. Each line displays the trend of a
metric and is color-coded to match the metric legend it represents.
Figure 11-6 displays the following values:
Click the Basic Average legend (the green arrow 1 in Figure 11-6),
which links to the chart of raw coverage score, as shown in
Figure 11-11. The top.wb_dma_test_top.dut instance contains
five sub-instances. You can drill-down to the next level by clicking
any individual curve to view the sub-instance chart. Further, the
legend labels are also click-able,which enables you to view the flavor
breakdown charts of this average coverage score.
Click the Plan Average legend (the green arrow 2 in Figure 11-6),
which links to the chart of coverage score lines for each sub-feature
as shown in Figure 11-12. Each line is click-able if you specify the
-trend depth <number> argument with a value of 2 or higher
and the verification plan sub-hierarchies are available. The legend
labels mentioned above the y-axis are also click-able for flavor
breakdown charts.
Other verification plan metric line charts on the top chart are also
click-able if their sub-features exist and the -trend depth
<number> argument is has higher value.
If the current URG report is located under the same trend root
directory as other URG session reports, the URL to the other session
is a relative path, such as ../../urgReport_session_N/
dashboard.html. Therefore, this hyperlink works even if you
move the entire trend root directory to another path or access the
URG report from a Windows disk mount.
Exclusion Management
12-1
focus testing the parts of the design that can happen. This section
explains some ways to remove impossible or unexercised parts of
the design from coverage monitoring.
The other type of exclusion is done when you are asserting that a
given coverable object - for example, a signal bit, a cross bin, a line
of code - cannot be covered, and therefore should not be counted
when computing your coverage score. When you exclude at the
object level, you are saying not to count that object because it cannot
be covered. In fact, it is not legal to exclude an object if it is covered,
and if it becomes covered an error will be flagged.
You can exclude items interactively using DVE, and your exclusions
can be saved to files that can be reloaded into a later DVE session,
into the Unified Report Generator (URG), or into the Unified
Coverage API (UCAPI), in the following sections:
Exclusion Management
12-2
Managing Exclusions in DVE
The following sections discuss how you can create and manage
exclusions in DVE
Exclusion Management
12-3
• “Using Adaptive Exclusion in DVE”
Exclusion Management
12-4
• Exclude Tree: Marks the hierarchy for exclusion or re-inclusion.
• Unexclude Tree: Unexcludes (re-includes) the tree.
• Add/Edit Annotation Tree: Adds an annotation tree.
• Delete Annotation Tree: Deletes the annotation tree.
• Save Exclusion Tree: Saves the exclusion tree.
Exclusion Management
12-5
Exclusion Toolbar
The exclusion toolbar has the following six buttons:
Exclude
Unexclude
Recalculate
Clear Exclusion
Load Exclusion
Save Exclusion
You can mark the items by first selecting them and then excluding or
including them either through the CSM or the main menus. You can
select and mark multiple items simultaneously.
In DVE detailed pane, you can select multiple items in List pane
using the Ctrl key for all coverage metric. In case of the line metric,
the multiple select option is possible only in the Source pane. The
same procedure can be followed for all metrics.
Exclusion Management
12-6
3. Open the condition metric coverage detailed pane.
4. Click on any expression or sub-expression in the expression list
pane.
5. Press the Ctrl key and clickon the desired expressions or sub-
expressions to select them.
6. Right-click and selectthe Exclude option in the menu to exclude
all the selected items.
7. Re-calculate.
Note:
For an excluded item, only the Include menus options are enabled.
When all of the selected item is included, only the Exclude menus
are enabled. If there is a mix of included and excluded items, both
menus are enabled.
Exclusion Management
12-7
Figure 12-3 Save Exclusion in Navigation Pane
Exclusion Management
12-8
Figure 12-4 Save Exclusion Option in Exclusion Menu
Exclusion Management
12-9
Figure 12-5 Save Exclusion Option in Exclude Tree Menu
Exclusion Management
12-10
Exclusion Modes in DVE
Strict mode - In the Strict mode, you can exclude only uncovered
objects. To enable the Strict mode, you can use the DVE command
line option -excl_strict. For example:
You can also choose the option Do not allow Covered Objects to
be excluded in the DVE Application Preferences window accessed
from the Edit > Preferences menu > Exclusion category. Using the
preferences menu option will require that you reload the database to
enable Strict mode.
After you have excluded objects in DVE, you can save those
exclusions to a file (also called elfile). For more information on
creating and managing exclusion files, see section “Using Exclusion
Files With DVE” .
Exclusion Management
12-11
The mode you are in (Default or Strict) when you create an exclusion
file is saved with the rest of that file's contents. If you load an
exclusion file in a different mode than the mode in which it was
created, a warning message will be printed, but the mode in which
you are currently in will be in effect.
For example, if DVE is in Strict mode and you load an exclude file
created in Default mode, you will see a warning, and only the
uncovered objects specified in the exclude file will actually be
excluded, since DVE is in Strict mode. In addition, a file
attempts.log will be created listing all the covered objects that
were in the exclude file but which could not be excluded.
You can create exclusions in DVE and save them in an exclusion file.
DVE saves exclusion files with a.el extension. The following
sections discuss the format used in the exclusion files to exclude
various coverage metrics.
Exclusion Management
12-12
5. Edit the design source.
6. Recompile the edited design.
Note:
This step is important to generate the new checksum.
Exclusion Management
12-13
MODULE:/INSTANCE:/covergroup specification is accompanied
with a checksum line that is prefixed with the CHECKSUM: keyword.
The format is as follows,
Example 12-1 and Example 12-2 show the format and contents of
the generated exclusion file.
Exclusion Management
12-14
Example 12-2 Scope Exclusions
CHECKSUM: “<mod_chksum>” // Notice that there isn’t any
variant checksum here – only <mod_chksum> is matched
MODULE: <module_name>
Exclusion Management
12-15
Backward Compatibility
Exclusion files generated with the previous release of VCS can be
used with the current release, thus ensuring backward compatibility.
Shape change detection may be less precise, but if the exclusion file
is reviewed first in the previous release, on the same DUT, it can be
imported into the new version of VCS and shape mismatches can be
suppressed.
Note:
Exclusion files that are manually edited to add new scopes and
exclusions without VCS-generated shape checksums cannot be
checked for source changes by VCS. These exclusions are
loaded without any version check.
You can view the exclusion markers in the Detail and Source
windows.
• Items that are partially marked or excluded are indicated with the
Partial Exclusion symbol, as follows:
Exclusion Management
12-16
• Items for which exclusion was attempted are indicated as follows:
Exclusion Management
12-17
Understanding Review Markers in DVE GUI
After you invoke DVE and load an exclude file with the Bypass
checks option deselected, markers are used to facilitate the review
of the exclusion changes. DVE denotes exclusions with different
markers based on their status in the review process.
Table 12-1 lists the marker icons for mappable exclusions and
explains what they mean.
Exclusion Management
12-18
Icon of Markers Review Status
Unmappable objects or scope.
Review accepted.
Table 12-2 lists the marker icons for unmappable exclusions and
explains what they mean.
Exclusion Management
12-19
Adding Exclusion Annotations in DVE
MODULE : top
ANNOTATION: "Unreachable signal"
Toggle a
In this example, the annotation Unreachable signal is added to
signal a of module top, which you want to exclude. You can add,
edit, and delete exclusion annotation of an excluded object or scope
in DVE.
Note:
You cannot add an annotation to a scope, container, or object that
is not excluded fully or partially, even if you have added it in the
exclusion file or edit it in the GUI before recalculation. Annotation
will only be set for a fully excluded object, scope, or container after
recalculation.
Exclusion Management
12-20
5. Right-click on the excluded object, scope, or container and select
Edit Exclude Annotation.
Figure 12-7 Edit Exclude Annotation Menu Item
Exclusion Management
12-21
Figure 12-8 Add Exclude Annotation Dialog Box
Exclusion Management
12-22
Figure 12-9 :Favorite Annotations as Preferences
If you save any annotation as your favorite, you can reuse these
annotation the next time you start DVE. Other recently used
annotations are not saved.
Exclusion Management
12-23
The following icon indicates that the item is annotated.
Within the source windows, items can be marked for exclusion in the
following ways:
• Edit Menu- Select the item to be excluded and use the CSM, Edit
menu as shown in Figure 12-1.
• Margin - Click in the left hand column of the margin to toggle the
Exclude mark. Depending upon the contents of the line being
marked the system will mark all related items. All exclude-able
items are initially marked with an empty green circle. Lines that
do not show this icon cannot be excluded.
Lines containing multiple exclude-able items are marked with a
special icon when the items on the line are at different exclusion
states. This line is referred to as being partially excluded. Exclude-
able items are marked with the icon.
Exclusion Management
12-24
Figure 12-10 Detail View Showing Markers in Source and List Windows
Within the list views, you can toggle the exclusion markers by
clicking them. The markers toggle as follows:
Exclusion Management
12-25
Filtering Coverage Objects Based on Exclusion Status
Use the exclusion browser in the toolbar to filter coverage items
based on their exclusion status.
You can exclude multiple objects in a single line of source code. This
feature is supported in all metrics.
Exclusion Management
12-26
Figure 12-11 Source View
Excluding Hierarchies
Exclusion Management
12-27
For hierarchical exclude-able items in toggle, condition, branch,
FSM, or assertion coverage, you can mark a branch of the hierarchy
simply by selecting the root of the branch. In such a case, all items
in the branch are marked, not just the root. This makes the exclusion
explicit.
Note:
Excluding an instance only excludes that specific instance itself,
not other instances within it. You can use the Exclude Tree/
Unexclude Tree options in the CSM to mark the hierarchy for
exclusion or re-inclusion.
Note:
If a module itself is excluded, coverable objects at the instance
level can not be later included through DVE. However, if the
module definition is not totally excluded, coverable objects at the
instance level, which were excluded in the module can later be
included in DVE.
Exclusion Management
12-28
Excluding Half Toggle Transitions
Toggle coverage for a bit is combination of two sequences 0 -> 1 and
1 -> 0, which gets counted in the final score of the toggle coverage.
The total count of toggle coverable objects for a signal is the number
of bits in that signal times two, where two is number of sequences
per bit.
Consider the following example, where p[0] goes from 0 to 1 and p[1]
goes from 1 to 0:
initial begin
reg [1:0] p;
p = 2'b10;
#1 p = 2'b01;
end
You can exclude the 1 to 0 transition for p[0] and the 0 to 1 transition
for p[1], since neither can occur in this code.
For this example, the toggle coverage exclude file will be as follows:
Module: top
Toggle 0to1 p[1]
Exclusion Management
12-29
3. Select any of the following sub-menu options as desired:
Figure 12-12 Excluding Toggle Transition
Exclusion Management
12-30
Excluding Covergroups
Exclusion Management
12-31
Figure 12-13 Covergroup Items in the Summary Pane
Exclusion Management
12-32
Note:
In Strict mode, you cannot exclude a cover point/cross once the
score is 100%. When the score is greater than 0 and less than
100, its uncovered children are excluded and covered children
are marked as attempted.
Variants of Covergroups
Variants are different shapes of the covergroup definition due to
module instances or parameterized covergroup instances.
Exclusion Management
12-33
Figure 12-14 Variants of Covergroup coin_fsm::Cvr
Exclusion Management
12-34
Excluding Auto-Cross Bins
You can exclude the auto cross bins either directly in the Detail
window or using the Edit Exclusion sub-menu.
Exclusion Management
12-35
The compressed MDA bits are visible.
Note:
If there are multiple dimensions (for example, A[1:3][4:7]),
DVE expands them, dimension by dimension and from left to right.
Exclusion Management
12-36
• Elfile 2 excludes a specific range of the MDA, as follows:
MODULE: test
Toggle mda1[1:16][7:4]
Excluding Cross-of-a-Cross
covergroup <scope_name>::<covergroup_name>
coveritem <cross-of-a-cross_name>
covergroup <scope_name>::<covergroup_name>
coveritem <cross-of-a-cross_name>
{bins_defn}
Exclusion Management
12-37
Based on Example 12-4, you can use the following elfile to exclude
cross-of-a-cross cr2 as a whole:
covergroup top::cov1
coveritem cr2
covergroup top::cov1
coveritem cr2
bins {{{auto[1]}, {auto[0]}}, {auto[0]}}
Exclusion Management
12-38
Based on Example 12-4, you can use the following elfile to exclude
the bin of cross-of-a-cross cr2, which is cross of user-defined bin b1
of coverpoint b, auto cross bin range of auto[0] – auto[15]
of coverpoint d, and auto-bin auto[0] of coverpoint a.
covergroup top::cov1
coveritem cr2
bins { {{b1}, {auto[1]-auto[15]}}, {auto[0]}}
coveritem cr3
bins {{ {{b1}, {auto[1]-auto[15]}}, {auto[0]}}, {B1}}
Exclusion Management
12-39
Enhanced Syntax of Covergroup Exclusion
For manually written exclusion files, you must specify a cross-of-a-
cross and its bins using the following syntax. In this syntax
description, the line highlighted in bold shows the enhancement
made to the syntax. The line highlighted in gray is replaced by the
line highlighted in bold from this version forwards.
Exclusion Management
12-40
[, cross_bin_dim | auto_cross_bin_spec ]
cross_bin_dim ::= {} | {cp_bin_list}
cp_bin_list ::= cp_bin_spec [, cp_bin_spec]
ex_identifier ::= simple_identifier | escaped_identifier
Exclusion Management
12-41
Figure 12-16 Save Exclusion Dialog Box
Exclusion Management
12-42
Loading Exclusions From an Exclusion File
To load exclusions from an exclusion file, use the following steps:
1. From the File menu, select Load Exclusions > From File....The
Load Exclusion dialog box appears as follows:
Figure 12-17 Load Exclusion Dialog Box
Exclusion Management
12-43
To load multiple exclusion file from a file list, use the following steps:
1. From the File menu , select Load Exclusions > From File List.
The Load Exclusion File List dialog box appears, as follows:
Figure 12-18 Load Exclusion File List Dialog Box
2. Select the file list in which you have stored multiple exclusion files
and click Open.The exclusion files are loaded.
Exclusion Management
12-44
Loading Excluded Covered Items in Strict Mode
In the Strict mode, covered items cannot be excluded. When you
load an exclude file containing covered items in the Strict mode, the
following warning is issued. You can either choose to continue
loading the exclusion file by clicking on Select continue, or you can
abort the loading of the exclude file by clicking the Abort option and
exit DVE.
You can also choose to view the details of the covered objects by
clicking on the Detail option.
Exclusion Management
12-45
Recalculating Coverage Scores
Once items are marked for exclusion, you need to recalculate the
The adaptive exclusion review flow works with all metrics, including
line, toggle, FSM, branch, assertion, condition, and covergroup.
Exclusion Management
12-46
This section discusses the following subsections:
Exclusion Management
12-47
2.2) If you do not select bypass_check, you can continue to Step
3.
7. Repeat steps 4 to 6 for every metric until all objects in the instance
or module are reviewed completely.
8. Recalculate to apply all reviewed results.
9. Save as a new exclusion file elfile (optional).
Note:
Once a reviewed exclusion is recalculated, it cannot be changed
back to the unreviewed state. To retrieve unreviewed exclusions,
click Clear Reviews button or use the menu command Edit
> Review > Clear Reviews, and then reload the exclusion file.
Exclusion Management
12-48
Enabling and Disabling Adaptive Exclusion Review
Mode
The following sections describe how you configure the adaptive
exclusion review mode:
DVE makes this mode as the default mode until you enable adaptive
exclusion review mode again.
Exclusion Management
12-49
Enabling Adaptive Exclusion Review Mode
You can enable the adaptive exclusion review mode by using the
-excl_resolve on option or by selecting the Interactive review
mode. This only takes effect after re-loading the exclusion file in the
Exclusion category of the DVE Application Preferences dialog
box, as shown in Figure 12-19:
Exclusion Management
12-50
Reviewing Exclusions in the Navigation Pane
Exclusion reviews at a high level of granularity (for example, module
or instance) are performed in the Navigation pane. Figure 12-20
shows the Navigation pane with review markers.
Exclusion Management
12-51
Figure 12-20, so you know if there are any unreviewed exclusions
remaining. If an exclusion is reviewed, then the total number should
decrease by 1. Once the total number becomes 0, it turns green.
Exclusion Management
12-52
• Review unmappable exclusions — Displays all unmappable
exclusions of the selected scope or module in the Unmappable
dialog box for further review. This is dimmed if not applicable.
• Accept All — Provides two options, All and Signatures
matching, to accept all exclusions or only those with matching
signatures, respectively (see Figure 12-22).
Figure 12-22 Options in Accept All Menu
Exclusion Management
12-53
Figure 12-23 All in this Metric Option in the Accept All Menu
Exclusion Management
12-54
Figure 12-24 Options in Reject All Menu
Mappable : a/b/c
Fsm: d
Condition: e
…
Unmappable: f/g
where,
Exclusion Management
12-55
• c is the amount of unresolved exclusions that are rejected by
users.
• d and e are total mappable numbers in each metric.
• f is the amount of exclusions that are not automatically resolved
or mapped.
• g is the amount of unresolved exclusions that are reviewed by
users.
Note:‘a’ + ‘f’ = Total exclusions tool attempted to automatically
resolve.
‘g’ <= ‘b’ + ‘c’
Exclusion Management
12-56
Icons in the Review Toolbar
You select an instance or module to populate the Detail pane by
clicking the Review detail icon in the context-sensitive menu
described in section “Reviewing Exclusions in the Navigation Pane”
. You can then click the icons in the Review toolbar (see Figure 12-
25) to walk through exclusions and review them one by one.
Exclusion Management
12-57
Figure 12-26 Confirmation Window for Clear Review Option
Click Yes to clear all the review marks (accept or reject mark along
with any condition open for review).
Note:
After clearing all reviews, you need to reload the exclusion to
continue the review process.
Figure 12-27 Metric, Scope and Cover group Menus in Review Toolbar
If you select Metric, then the Go to next button takes you to the next
metric of the current instance or module that contains unreviewed
exclusions. If there is no next metric to review, then the Go to Next
button is disabled.
If you select Scope, then the Go to next button takes you to the next
instance or module. It goes through instances first, then modules. If
there is no next scope or instance available to review, then the Go to
Exclusion Management
12-58
next button is disabled. When a new instance or module is
populated in the Detail pane, the Summary report is printed in the
console and the Detail pane switches to the first available metric for
review.
If you select Cover group, then the Go to next button takes you to
the next or previous cover group, which contains unresolved
exclusions.
If you select Any, then the Go to next button goes through any
unresolved exclusion. If you select Conflict, then the Go to next
button goes through an unresolved exclusion with mismatching
signature only.
Exclusion Management
12-59
Unmappable Exclusions
In some scenarios, there might be a module, instance, or expression
that has changed a lot. In such cases, the excluded objects in the
exclusion file cannot be mapped to the changed design. To display
unmappable exclusions, you can use the Unmappable exclusions
dialog box.
Exclusion Management
12-60
Figure 12-29 Unmappable Exclusion List Dialog Box
• Not reviewed
• Reviewed
The dialog box is synchronized with the current detail window and
only displays one metric at a time. When the metric in the detail
window changes, this dialog box is updated with the new metric.
The five buttons in the Unmappable Exclusion List dialog box are:
Exclusion Management
12-61
• Review All — Marks all exclusions in the dialog box as reviewed.
• Close — Closes the dialog box.
• Tips — Provides review tips.Examples
The following are some examples of unmappable exclusions:
Exclusion Management
12-62
Figure 12-30 Insertion of Another Block in Design 2
Design Design
version 1 version 2
module m;
…
always@y
module m; begin
… if (a && b)
always@x begin
begin …
if (v || x) end
begin end
... always@x
end if (v || x)
end begin
endmodule
…
end
end
endmodule
DVE allows the exclusion file generated using version 1 to hold the
checksum for the condition (v || x) computed from @x and
(v||x). For version 2, the checksum of the condition (v||x) is
also computed from @x and (v||x). When an exclusion file sis
loaded into DVE, the checksum of the excluded condition will be
matched against the checksum present in the database. As both the
checksums are same, the condition is excluded automatically.
Exclusion Management
12-63
Insertion of Code in the Same Block
This is similar to the first example, “Insertion of Another Block” , but
the new code is inserted inside the same always block as shown in
Figure 12-31.
Design Design
version 1 version 2
module m;
…
module m; always@x
… begin
always@x if (a && b)
begin begin
if (v || x) …
begin end
... if (v || x)
end begin
end …
endmodule end
end
endmodule
Exclusion Management
12-64
Deletion of Irrelevant Code
Two conditions are present inside an always block. Condition 2 has
been excluded in design version 1. In design version 2, condition 1
has been removed. By using checksum based approach, as there is
no change in the checksum for the target condition (v||x) between
both the versions, the object is excluded automatically.
Design Design
version 1 version 2
module m; module m;
… …
always@x always@x
begin begin
if (a && b) if (v || x)
begin begin
… ...
end end
if (v || x) end
begin endmodule
…
end
end
endmodule
Exclusion Management
12-65
Limitations
The following are the limitations with adaptive exclusion:
For example:
module m;
……
begin
A=0; #5 B=0; //written in a single line
end
endmodule
Exclusion Management
12-66
A=0 and #5 belong to the same block, whereas B=0 belongs to a
different block, but their signature will be the same ("A=0; #5
B=0;"). For example, consider the blocks to be b1 and b2. If you
change A=0 to A=1, the signature of both the blocks change. But the
checksum of b2 will not change. So, if an exclusion on b2 is applied
byan exclusion file, it will be excluded automatically even if the
signature is different.
You can view coverage objects that have been excluded using DVE
using URG reports. The following sections discusses how URG
displays exclusions:
Exclusion Management
12-67
Generating URG Reports Using Exclusion Files
You can use exclusion files with URG to remove excluded items from
the URG-generated reports. To do this, pass the exclusion file
(created using DVE or manually) to URG using the command-line
option -elfile, as follows:
Excluded items from the exclusion file are marked Excluded in the
generated URG reports, and are not taken into account for
computing coverage scores.The figure Figure shows a normal URG
report with the total coverage summary. This report displays the total
coverage numbers for the line, condition, toggle, FSM and branch
coverage.
Exclusion Management
12-68
Figure 12-33 Example of a Report without Exclusion
When you specify the exclusion file using the -elfile option, URG
generates the report as shown in Figure 12-34. The total coverage
numbers have increased since some of the uncovered coverage
metric items specified in the exclude file are omitted from the
coverage calculation, resulting in higher coverage numbers:
Exclusion Management
12-69
Figure 12-34 Example of a Report generated with an exclude file
Exclusion Management
12-70
You can specify bins level exclusion bylisting these identifiers.
For code coverage metrics, one line per excluded module is dumped
into the exclusion file and this line consists of the checksums of all
the metrics of excluded objects. This line starts with the prefix \\
MOD_CHKSUM,as shown in the following example:
Exclusion Management
12-71
Line Exclusion Format
The line exclusion format contains information on the checksum,
excluded block_ids, and the module or instance scope for which
the exclusion is carried out. This is illustrated in the following
example:
Exclusion Format
CHECKSUM: "3656021512 2564524589"
INSTANCE: test
Block 1 "802523853" "case (state)"
Block 3 "1605227561" "next_state = 3'b1;"
Block 7 "2054220958" "next_state = 3'b1;"
Verilog File
20 always @(data,state) begin
21 case(state)
22
23 3'b000:begin
24 if(data)
25 next_state=3'b001;
26 else
27 next_state=3'b000;
28 end
29 3'b001:begin
30 if(!data)
31 next_state=3'b010;
32 else
33 next_state=3'b001;
34 end
URG Report
6 always @(data,state) begin
7 excluded case(state)
8
9 3'b000:begin
101/1 ==>if(data)
11 excludednext_state=3'b001;
Exclusion Management
12-72
12 else
13 1/1 ==> next_state=3'b000;
14 end
15 3'b001:begin
16 1/1 ==> if(!data)
17 1/1 ==> next_state=3'b010;
18 else
19 excludednext_state=3'b001;
20 end
Verilog File
1 module top;
2 reg [26:10] top_var1;
3 reg [26:10] top_var2;
4 reg top_var3;
5 reg top_var4;
6 reg top_var5;
7
8 wire [26:10]top_net1, top_net2;
9 wire top_net3, top_net4, top_net5;
… …
endmodule
Exclusion Format
INSTANCE: top
Toggle top_net1
Toggle 0to1 top_net2[26:10]
Toggle 1to0 top_net3
Exclusion Management
12-73
URG Report
Net Details
Toggle Toggle 1->0 Toggle 0->1 Direction
Verilog File
reg [1:0] state,next;
parameter idle = 2'b00,
first = 2'b01,
second = 2'b10,
third = 2'b11;
... ...
always @ in
begin
next = state; // by default hold
case (state)
idle : if (in) next = first;
first : if (in) next = second;
second : if (in) next = third;
third : if (in) next = idle;
endcase
end
Exclusion Management
12-74
Exclusion Format
INSTANCE: top1
MODULE: dev
FSM state
State first
State second
State third
Transition idle->first
Transition first->second
Transition second->third
Transition third->idle
URG Report
State, Transition and Sequence Details for FSM :: state
states Covered
idle Covered
first Attempted
second Attempted
third Excluded
transitions Covered
idle->first Attempted
first->second Attempted
second->third Excluded
third->idle Excluded
...
Verilog file
56 input clk,in;
57 output [1:0] state;
58 wire e;
59 assign e = clk ? 1'b0:1'b1;
Exclusion Management
12-75
60 reg [1:0] state,next;
Exclusion Format
INSTANCE: top3.D3
Condition 1 (1)
Condition 1 (2)
URG Report
LINE 59
EXPRESSION (clk ? 1'b0 : 1'b1)
-1-
-1- Status
0 Excluded
1 Excluded
Verilog file
24 always@(posedge clk)
25 begin
26 // nested if's
27 if ( e && f)
28 begin
29 $display("s3");
30 if ( g && h)
31 $display("s4");
32 end
33 end
Exclusion Format
MODULE: test
Branch 2 (0)
Branch 2 (1)
Exclusion Management
12-76
URG Report
27 if ( e && f)
-1-
28 begin
29 $display("s3");
30 if ( g && h)
-2-
31 $display("s4");
==>
MISSING_ELSE
==>
32 end
MISSING_ELSE
==>
Branches
-1- -2- Status
1 1 Excluded
1 0 Excluded
0 - Covered
INSTANCE: tb.dut
MODULE: top.test
Assert a_one_yellow
Exclusion Management
12-77
Covergroup Exclusion Format
The following is a snapshot of covergroup code and various elfile
examples that can be used with it:
module M;
…
bit [3:0] x;
integer y;
integer z;
covergroup cov1;
cp1: coverpoint x;
cp2: coverpoint y {
bins b1 = {100};
bins b2 = {200};
bins b3 = {300};
bins b4 = {400};
bins b5 = {500};
}
cp3: coverpoint z {
covergroup cov2;
coverpoint cp1 {
…
}
coverpoint cp2 {
…
}
coverpoint cp3 {
…
Exclusion Management
12-78
}
cc1: cross cp3, cp2;
cc2: cross cp2, cp1;
endgroup
module top;
M i1();
M i2();
…
endmodule
Example elfile1
covergroup top.i1::cov1
covergroup top.i2.cov2_inst1
Example elfile2
covergroup top.i1::cov1
coveritem cp2
bins b1, b2 //Multiple bins grouped in a comma
separated list
coveritem cc2
Exclusion Management
12-79
covergroup top.i1::cov2
coveritem cp1, cp2 //Multiple coverpoints/crosses
grouped in a comma-separated list
Example elfile3
covergroup top.i1::cov1
coveritem cp1
bins auto[8], auto[10], auto[11], auto[12], auto[13]
coveritem cp2
bins b3, b5
coveritem cp3
bins zb2
coveritem cc1
bins cb1
coveritem cc2
bins {{auto[1], auto[4]}, {b2}, {zb1[13], zb1[14],
zb2}}
covergroup top.i2.cov2_inst1
coveritem cc1, cc2
Exclusion Management
12-80
The auto cross bins specification {{auto[1], auto[4]}, {b2},
{zb1[13], zb1[14], zb2}} subsumes six auto bins of the cross
cc2, corresponding to the following six combinations of coverpoint
bins:
Example elfile4
covergroup top.i1::cov1
coveritem cp2
coveritem cc1
bins {{auto[1], auto[ 8]}, {}, {zb1[18]}} // {} -
Consider all bins of cp2 in cross exclusion
coveritem cc2
Example elfile5
Consider the uncovered bins printed for the cross cc1 in the URG
report as follows:
covergroup top.i1::cov1
coveritem cc1
bins {{},{b3,b4,b5},{}}
Exclusion Management
12-81
Thus, URG automatically excludes these uncovered bins while
generating the URG report.
You can view the exclusion annotation in URG, in the last column of
each coverable object, in the table for Condition, FSM, Toggle, and
Branch. For Line coverage, you can see the annotation in the line
below the excluded line in the Line Coverage Report.
Note:
The existing annotation is overwritten when loading multiple
exclusion files if there are annotations in each file for a scope/
object. When the same coverage object is marked as excluded
but with different annotations, DVE/URG will keep all the
annotations, regardless of whether the annotation comes from the
same exclusion file or different exclusion file.
Exclusion Management
12-82
The ANNOTATION keyword is used for adding an annotation to a
single scope/object.The ANNOTATION_BEGIN/ANNOTATION_END
keywords are used for adding annotations for scopes or containers.
Example 1
MODULE: top
Example 2
INSTANCE: TOP.CPU.ALU
ANNOTATION_BEGIN: "unreachable"
Condition 1 (1)
Condition 1 (2)
Condition 1.1 (1)
Condition 1.1 (2)
ANNOTATION_END
Exclusion Management
12-83
Indicating Exclusion Status in URG
In the text reports, partially excluded scopes are annotated with (x)
and fully excluded scopes are annotated with(X).
Examples
Example-1: Module and Instance Partially Excluded HTML
Report
Exclusion Management
12-84
Figure 12-35 Modlist.html
Exclusion Management
12-85
Figure 12-37 modinfo.html
Exclusion Management
12-86
Example-2: Instance Completely Excluded
Exclusion Management
12-87
Dumping Full Exclusion Files in Commented Format
You can dump metric specific exclusion files at the instance and
module level using the -dump full_exclusions URG option.
Each metric specific exclusion file includes the exclusion entries for
all the corresponding coverable objects for each instance and
module of the design.
When the file is generated, the exclusion entry for each coverable
object of an exclusion file is commented out. You can edit the
exclusion file to uncomment the exclusion entries of the objects that
you want to exclude from the coverage report. The edited file can be
used either in the URG or the DVE exclusion flow.
This feature allows you to manage exclusions without using the DVE
interactive flow. The -dump full_exclusions option is used to
create exclusion files. The files are edited either manually or by user-
defined scripts or tools, and then loaded into URG or DVE or Verdi
to generate the final coverage report.
The following sections describe how you can dump and use full
exclusion files.
Exclusion Management
12-88
Dumping Full Exclusion Files
The supported metrics for dumping full exclusion files are line,
toggle, condition, branch, FSM, group (functional) and assert. To
dump the exclusion files for specific metrics, execute the following
command:
Note:
For the VHDL portion of the design, the metric checksum for line
and condition coverage is not dumped, as adaptive exclusion is
not supported for VHDL.
Exclusion Management
12-89
% urg -hier <hierFileName> -dump full_exclusions \
<other URG options>
The following sections discuss the full exclusion files for each metric.
Exclusion Management
12-90
Example 12-5 Design Used to Describe Line, Toggle, Condition, and Branch
Metrics
1
2 module top;
3 reg[3:1] x, y, z;
4
5 test t1();
6 test t2();
7
8 initial begin
9 if(x & y)
10 $display("x & y");
11 else if(y || z)
12 $display("y || z");
13 else
14 $display("Else block");
15 end
16 endmodule
17
18 module test;
19 reg a,b;
20 reg a1,b1,c1;
21 reg z;
22 wire w;
23 reg [1:0] m,n;
24 reg [3:0] p [3:0];
25 reg [3:0] q [3:0];
26
27 assign w = (a ? 1'b1 : 1'b0);
28
29 initial begin
30 $monitor($time,a,b);
31 #1;
32 a = 1'b0;
33 b = 1'b1;
34 if (a && b)
35 $display("a && b");
36 else if (m|n)
38 $display(" m|n ");
39 else
40 $display(" Else block ");
Exclusion Management
12-91
41
42 z = a1 ^ b1 | c1;
43 end
44 endmodule
fullexclude.line File
The fullexclude.line file includes all the excludable objects for
line coverage. To exclude any basic block from the line coverage
report, uncomment the corresponding exclusion entry in the
fullexclude.line file.
Exclusion Management
12-92
// if basic block's exclusion-info is:
// // Block 3 "3426792653" "$display(" a && b");
// then,
// block-id: 3
// block-checksum: "3426792653"
// block-signature: "$display(" a && b");
// (iii) Copy this file to a new file, uncomment necessary exclusions in
// the new file, and pass the new file as an argument to the option
// '-elfile'.
// (iv) The ANNOTATION containing source-info is for user's quick
// reference.
// It can be edited by users to add their own annotations. Users
// can as well delete the line containing the annotation.
//
// (NOTE:
// This file will be overwritten if '-dump full_exclusions' is
// enabled again.)
//========================================================================
Exclusion Management
12-93
// Block 7 "3242563609" "z = ((a1 ^ b1) | c1);"
fullexclude_module.line
In a fullexclude_module.line file, the header and the format
of dumping remains same as that of the fullexclude.line file,
but it contains exclusion entries of all the excludable objects for line
coverage at module level. You can edit this file to exclude the objects
for line coverage at module level (for all instances of the module).
fullexclude.tgl File
The fullexclude.tgl file includes the excludable objects for
toggle coverage. To exclude any signal, uncomment the
corresponding exclusion entry in the fullexclude.tgl file. You
can also edit the file to exclude bit-selects or part-selects at 0->1 or
1->0 transition levels as per the exclusion syntax.
Exclusion Management
12-94
Example 12-7 illustrates the fullexclude.tgl file.
Exclusion Management
12-95
// and a bit-select of bit [0][1] of the MDA can be excluded as:
// "Toggle a2 [0][1] "reg [3:0]a2[3:0]" "
//
// (b) Half toggles may also be excluded, by specifying the toggle
// after the keyword 'Toggle'.
// For e.g.,
// "Toggle 0to1 a1 [1:0] "reg a1[3:0]" "
// OR
// "Toggle 1to0 a1 [1:0] "reg a1[3:0]" ")
//========================================================================
Exclusion Management
12-96
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:21"
// Toggle w "net w"
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:22"
// Toggle m "reg m[1:0]"
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:22"
// Toggle n "reg n[1:0]"
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:23"
// Toggle p "reg [3:0]p[3:0]"
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:24"
// Toggle q "reg [3:0]q[3:0]"
fullexclude_module.tgl
In a fullexclude_module.tgl file, the header and the format of
dumping remains same as that of the fullexclude.tgl file, but it
contains exclusion entries of all the excludable objects for toggle
coverage at module level. You can edit this file to exclude the objects
for toggle coverage at the module level (for all instances of the
module).
Exclusion Management
12-97
Full Exclusion Files for Condition Coverage
You can use the -dump full_exclusions [cond] URG option
to dump fullexclude.cond and fullexclude_module.cond
exclusion files.
fullexclude.cond File
The fullexclude.cond file includes all the excludable objects for
condition coverage. To exclude specific conditions or condition
vectors from the condition coverage report, uncomment the
corresponding exclusion entry in the fullexclude.cond file.
Exclusion Management
12-98
// where, Condition Signature: "(<condition>) <condition-width>
// <bit-id>"
// (Here, <bit-id> is '-1' when it represents the full condition.)
// and,
// Vector Signature: <vector-id> "<vector>"
// For e.g.,
// if a condition's exclusion-info is:
// // Condition 3 "4094674079" "(m | n) 2 1" (2 "01")
// then,
// condition-id: 3
// condition-checksum: "4094674079"
// condition-signature: "(m | n) 2 1"
// condition: (m | n)
// condition-width: 2 (as both m, n are 2 bit vectors)
// bit-id: 1 (as the exclusion is for bit 1 of condition m|n)
// vector-signature: (2 "01")
// vector-id: 2
// vector: "01"
// (iii) Copy this file to a new file, uncomment necessary exclusions in
// the new file, and pass the new file as an argument to the option
// '-elfile'.
// (iv) The ANNOTATION containing source-info is for user's quick
// reference.
// It can be edited by users to add their own annotations. Users
// can as well delete the line containing the annotation.
// (NOTE:
// This file will be overwritten if '-dump full_exclusions' is
// enabled again.)
//========================================================================
Exclusion Management
12-99
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:41"
// Condition 6 "1274958896" "(a1 ^ b1) 1 -1"
// Condition 6 "1274958896" "(a1 ^ b1) 1 -1" (1 "00")
// Condition 6 "1274958896" "(a1 ^ b1) 1 -1" (2 "01")
// Condition 6 "1274958896" "(a1 ^ b1) 1 -1" (3 "10")
// Condition 6 "1274958896" "(a1 ^ b1) 1 -1" (4 "11")
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:27"
// Condition 7 "2290113809" "(a ? 1'b1 : 1'b0) 1 -1"
// Condition 7 "2290113809" "(a ? 1'b1 : 1'b0) 1 -1" (1 "0")
// Condition 7 "2290113809" "(a ? 1'b1 : 1'b0) 1 -1" (2 "1")
Exclusion Management
12-100
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:9"
// Condition 4 "149338110" "(x & y) 3 0"
// Condition 4 "149338110" "(x & y) 3 0" (1 "01")
// Condition 4 "149338110" "(x & y) 3 0" (2 "10")
// Condition 4 "149338110" "(x & y) 3 0" (3 "11")
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:9"
// Condition 3 "149338110" "(x & y) 3 1"
// Condition 3 "149338110" "(x & y) 3 1" (1 "01")
// Condition 3 "149338110" "(x & y) 3 1" (2 "10")
// Condition 3 "149338110" "(x & y) 3 1" (3 "11")
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:9"
// Condition 2 "149338110" "(x & y) 3 2"
// Condition 2 "149338110" "(x & y) 3 2" (1 "01")
// Condition 2 "149338110" "(x & y) 3 2" (2 "10")
// Condition 2 "149338110" "(x & y) 3 2" (3 "11")
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:11"
// Condition 5 "492599446" "(y || z) 1 -1"
// Condition 5 "492599446" "(y || z) 1 -1" (1 "00")
// Condition 5 "492599446" "(y || z) 1 -1" (2 "01")
// Condition 5 "492599446" "(y || z) 1 -1" (3 "10")
fullexclude_module.cond File
In a fullexclude_module.cond file, the header and the format
of dumping remains same as that of the fullexclude.cond file,
but it contains exclusion entries of all the excludable objects for
condition coverage at module level. You can edit this file to exclude
the objects for condition coverage at the module level (for all
instances of the module).
Exclusion Management
12-101
Full Exclusion Files for Branch Coverage
You can use the -dump full_exclusions[branch] URG to
dump fullexclude.branch and
fullexclude_module.branch exclusion files.
fullexclude.branch File
The fullexclude.branch file includes all the excludable objects
for the branch coverage. To exclude any specific branch or branch
vectors from the branch coverage report, uncomment the
corresponding exclusion entries in the fullexclude.branch file.
Exclusion Management
12-102
// if a branch's exclusion-info is:
// // Branch 1 "1966633406" "(a && b)" (1) "(a && b) 0,1"
// then,
// branch-id: 1
// branch-checksum: "1966633406"
// branch-signature: "(a && b)"
// vector-id: (1)
// vector-signature: "(a && b) 0,1"
// (iii) Copy this file to a new file, uncomment necessary exclusions in
// the new file, and pass the new file as an argument to the option
// '-elfile'.
// (iv) The ANNOTATION containing source-info is for user's quick
// reference.
// It can be edited by users to add their own annotations. Users
// can as well delete the line containing the annotation.
//
// (NOTE:
// This file will be overwritten if '-dump full_exclusions' is
// enabled again.)
//========================================================================
Exclusion Management
12-103
// ANNOTATION: "FileName: /remote/xxxx/yyyy/zzzz/test.v, LineNumber:9"
// Branch 0 "14865438" "(x & y)"
// Branch 0 "14865438" "(x & y)" (0) "(x & y) 1,-"
// Branch 0 "14865438" "(x & y)" (1) "(x & y) 0,1"
// Branch 0 "14865438" "(x & y)" (2) "(x & y) 0,0"
fullexclude_module.branch File
In a fullexclude_module.branch file, the header and the
format of dumping remains same as that of the
fullexclude.branch file, but it contains exclusion entries of all
the excludable objects for branch coverage at module level. You can
edit this file to exclude the objects for branch coverage at the module
level (for all the instances of the module).
fullexclude.fsm File
The fullexclude.fsm file includes all the excludable objects of
FSM coverage – states and transitions. To exclude any specific
state, transition of a FSM or the whole FSM from the FSM coverage
report, uncomment the corresponding exclusion entries in the
fullexclude.fsm file.
Exclusion Management
12-104
6 endmodule
7
8 module fsm1();
9 reg clk;
10 reg [9:0] current;
11 reg [9:0] next;
12 integer j;
13
14 initial begin
15 current=10'b0000000001;
16 clk = 0;
17 #20 $finish();
18 end
19
20 always #1 clk = ~clk;
21
22 always @(posedge clk)begin
23 case (1'b1)
24 current [0] : next=2;
25 current [1] : next=4;
26 current [2] : next=8;
27 current [8] : next=2;
28 endcase
29 current=next;
30 end
31 endmodule
32
33 module fsm2 ();
34 wire clk,in;
35 reg [1:0] state,next;
36
37 parameter idle = 2'b00, first = 2'b01,
38 second = 2'b10, third = 2'b11;
39
40 initial begin
41 state=idle;
42 next=idle;
43 end
44
45 always @ in
46 begin
Exclusion Management
12-105
47 next = state; // by default hold
48 case (state)
49 idle : if (in) next = first;
50 first : if (in) next = second;
51 second : if (in) next = third;
52 third : if (in) next = idle;
53 endcase
54 end
55
56 always @ (posedge clk)
57 state=next;
58
59 endmodule
Exclusion Management
12-106
// (ii) The exclusion-info for fsm is of the form:
// Fsm <fsm-name> "<fsm-checksum>"
// The exclusion-info for state is of the form:
// State <state-name> "<state-signature>"
// The exclusion-info for transition is of the form:
// Transition <transition-name> "<transition-signature>"
// For e.g.,
// if an fsm's exclusion-info is:
// // Fsm current "4059198254"
// // State 'h1 "1"
// // State 'h2 "2"
// // Transition 'h1->'h2 "1->2"
// then,
// fsm-name: current
// fsm-checksum: "4059198254"
// state-name: 'h1
// state-signature: "1"
// transition-name: 'h1->'h2
// transition-signature: "1->2"
// (iii) Copy this file to a new file, uncomment necessary exclusions in
// the new file, and pass the new file as an argument to the option
// '-elfile'.
// (iv) The ANNOTATION containing source-info is for user's quick
// reference.
// It can be edited by users to add their own annotations. Users
// can as well delete the line containing the annotation.
// (NOTE:
// This file will be overwritten if '-dump full_exclusions' is
// enabled again.)
//========================================================================
Exclusion Management
12-107
// State first "1"
// State second "2"
// State third "3"
// Transition idle->first "0->1"
// Transition first->second "1->2"
// Transition second->third "2->3"
// Transition third->idle "3->0"
The exclusions that are possible using a fullexclude.fsm file
are,
• “State Exclusion”
• “Transition Exclusion”
• “FSM Exclusion”
State Exclusion
In Example 12-11, to exclude the state first of the FSM state of
the instance top.fsmTwo, uncomment the following lines:
Transition Exclusion
In Example 12-11, to exclude the transition first->second of the
FSM state of the instance top.fsmTwo, uncomment the following
lines:
FSM Exclusion
In Example 12-11, to exclude the whole FSM of the FSM state of
the instance top.fsmTwo, uncomment the following line:
Exclusion Management
12-108
fullexclude_module.fsm File
In a fullexclude_module.fsm file, the header and the format of
dumping remains same as that of the fullexclude.fsm file, but it
contains exclusion entries of all the excludable objects for FSM
coverage at the module level. You can edit this file to exclude objects
for FSM coverage at the module level (for all instances of the
module).
Example 12-12 is the design source code for which group coverage
is monitored.
module mod;
int v,u,r,a,b;
reg x, y, z;
covergroup cg(int a, int b);
option.auto_bin_max=b;
coverpoint v;
coverpoint u{
bins sabin_u = {6,7,8} iff(a>0);
}
coverpoint r{
bins sabin_r = {1,2,3};
}
cross u,v{
bins b = binsof(u) iff(a);
bins b1 = binsof(v) iff(!a);
}
option.per_instance = 1;
Exclusion Management
12-109
endgroup
bins b = {2,3};
}
option.per_instance = 1;
endgroup
cg cg1;
cg cg2;
cov cov1;
cov cov2;
initial begin
a=2;b=3;
cg1 = new(1, 64);
cg2 = new(0, 32);
v = 2;
cg1.sample();
u = 6;
cg1.sample();
cov1 = new(4);
cov1.sample();
cov2 = new(5);
cov2.sample();
end
endmodule
fullexclude.tb_inst file
The fullexclude.tb_inst file includes all the exclusion entries
for all the instances of all the covergroups along with their
coverpoints, crosses and bins. These exclusion entries will be in
their commented form. To exclude any specific entry from the
functional coverage report, uncomment the corresponding exclusion
entries in the fullexclude.tb_inst file.
Exclusion Management
12-110
Example 12-13 fullexclude.tb_inst File
//==================================================
// // This file contains the Excludable objects for group coverage
// Generated By User: xyz
// Format Version: 2
// Date: Thu May 29 23:53:54 2014
// ExclMode: default
// Version: J-2014.12-Beta0
// Usage:
// (i) For each Definition, the following is dumped:
// <Definition-checksum> <Shape-checksum>
// <ANNOTATION containing Covergroup's file name and line number>
// <Definition name of covergroup>
// <Coverpoint/Cross List>
// <Name of coverpoint/cross>
// <bins keyword Bins Name List>
// For e.g.,
// CHECKSUM: "1529104392 4145108059"
// ANNOTATION: "test.v, LineNumber:6"
// covergroup mod::cg::SHAPE{b=64,Guard_ON(u.sabin_u)}
// coveritem "v","cg_cross"
// coveritem v
// bins sabin_v
// coveritem cg_cross
// bins b_cross1, b1_cross2
// (ii) For each instance, the following is dumped:
// <Definition-checksum> <Shape-checksum>
// <Covergroup Instance name List>
// <Definition-checksum> <Shape-checksum>
// <ANNOTATION containing Covergroup Instance's file name and line number>
// <Instance name of covergroup>
// <Coverpoint/Cross List>
// <Name of coverpoint/cross>
// <bins keyword Bins Name List>
// For e.g.,
// CHECKSUM: "1529104392 2053810295"
// covergroup mod.cg2, mod.cg1
// CHECKSUM: "1529104392 2053810295"
// ANNOTATION: "test.v, LineNumber:25"
// covergroup mod.cg1
// coveritem "v","cg_cross"
// coveritem v
// bins sabin_v
// coveritem cg_cross
// bins b_cross1, b_cross2
// (iii) Copy this file to a new file, uncomment necessary exclusions in
// the new file, and pass the new file as an argument to the option '-elfile'.
// (iv) The ANNOTATION containing source-info is for user's quick reference.
// It can be edited by users to add their own annotations. Users can as well
// delete the line containing the annotation.
// (NOTE:
// This file will be overwritten if '-dump full_exclusions' is enabled again.)
//==================================================
// CHECKSUM: "1529104392 114556960"
// ANNOTATION: "/remote/xxxxx/xxxx/dump_full_exclusion/Group/test.v, 4"
// covergroup mod.cg1
// CHECKSUM: "1529104392 114556960"
// ANNOTATION: "test.v, 32"
// covergroup mod.cg1
// coveritem "v", "u", "r", "cg_cc"
// coveritem "v"
// bins auto[-2147483648:-2080374785]-auto[2080374784:2147483647]
// coveritem "u"
Exclusion Management
12-111
// bins "sabin_u"
// coveritem "r"
// bins "sabin_r"
// coveritem "cg_cc"
// bins "b", "b1"
// CHECKSUM: "1529104392 1386083047"
// ANNOTATION: "/remote/xxxxx/xxxx/dump_full_exclusion/Group/test.v, 4"
// covergroup mod.cg2
// CHECKSUM: "1529104392 1386083047"
// ANNOTATION: "test.v, 33"
// covergroup mod.cg2
// coveritem "v", "u", "r", "cg_cc"
// coveritem "v"
// bins auto[-2147483648:-2013265921]-auto[2013265920:2147483647]
// coveritem "u"
// bins "sabin_u"
// coveritem "r"
// bins "sabin_r"
// coveritem "cg_cc"
// bins "b", "b1"
// CHECKSUM: "1712407508 2539924183"
// ANNOTATION: "/remote/xxxxx/xxxx/dump_full_exclusion/Group/test.v, 20"
// covergroup mod.cov2, mod.cov1
// CHECKSUM: "1712407508 2539924183"
// ANNOTATION: "test.v, 40"
// covergroup mod.cov2
// coveritem "a"
// coveritem "a"
// bins "b"
// CHECKSUM: "1712407508 2539924183"
// ANNOTATION: "test.v, 38"
// covergroup mod.cov1
// coveritem "a"
// coveritem "a"
// bins "b"
fullexclude.tb_def file
In a fullexclude.tb_def file, the header and the format of
dumping remains same as that of the fullexclude.tb_inst file,
but it contains exclusion entries of all the excludable objects for all
the shapes/definitions of covergroups along with their coverpoints as
shown in Example 12-14.
Exclusion Management
12-112
// coveritem "cg_cc"
// bins "b", "b1"
// CHECKSUM: "1529104392 1386083047"
// ANNOTATION: "/remote/xxxx/xxx/dump_full_exclusion/Group/test.v, 4"
// covergroup mod::cg::SHAPE{b=32}
// coveritem "v", "u", "r", "cg_cc"
// coveritem "v"
// bins auto[-2147483648:-2013265921]-auto[2013265920:2147483647]
// coveritem "u"
// bins "sabin_u"
// coveritem "r"
// bins "sabin_r"
// coveritem "cg_cc"
// bins "b", "b1"
// CHECKSUM: "1712407508 2539924183"
// ANNOTATION: "/remote/xxxx/xxx/dump_full_exclusion/Group/test.v, 20"
// covergroup mod::cov
// coveritem "a"
// coveritem "a"
// bins "b"
Exclusion Management
12-113
Full Exclusion Files for Assertion Coverage
You can use the -dump full_exclusions assert URG option
to dump fullexclude.assert and
fullexclude_module.assert exclusion files.
module bot;
int x,y,z,w;
reg clk;
always_comb begin : b1
f(x,y);
end
always_comb begin : b2
f(z,w);
end
initial begin
base_rule1: assert property (@clk x) $display("%m, passing");
else $display("%m, failed");
end
endmodule
module top;
bot b1();
bot b2();
endmodule
Exclusion Management
12-114
fullexclude.assert File
Exclusion Management
12-115
// CHECKSUM: "4150909837"
// INSTANCE: top.b2
// ANNOTATION: "FileName: assert_test.v, LineNumber: 18"
// Assert base_rule1 "assertion"
// ANNOTATION: "FileName: assert_test.v, LineNumber: 6"
// Assert f.a1 "assertion"
fullexclude_module.assert
Exclusion Management
12-116
Managing Exclusions in UCAPI
-tree top.d1
See the VCS Coverage Metrics User Guide for the complete
description of the hierarchy exclusion file syntax.
Exclusion Management
12-117
Hierarchy exclusion files are loaded using the covdb_loadmerge
function with an already-loaded design handle, as follows:
Exclusion bits set using the covdb_set function are not saved to
the main UCAPI database or to test files – they are saved to a
separate exclusion file. Exclusion files are saved using the
covdb_save_exclude_file function, as follows:
Exclusion Management
12-118
Exclusion files can be saved with mode w to write a new file,
overwriting the existing or with mode a to append the exclusion data
into an existing file.
covdb_load_exclude_file(testHdl, “projectexcl.el”);
covdb_unload_exclusion(designHdl);
UCAPI has two exclusion modes - Default and Strict, similar to DVE.
In Default mode,youcan exclude object regardless of whether it is
covered or not.
Exclusion Management
12-119
In strict mode, UCAPI keeps track of the covered objects that were
in regions or containers that were excluded - theseobjects are called
attempted exclude objects. The list of such objects can be saved to
a file using the covdb_save_attempted_file function, as
follows:
Exclusion Management
12-120
Saving Exclusions in UCAPI
For line, condition, branch and FSM metrics, when an exclusion file
is loaded into DVE, the checksum is compared with the checksum of
coverage objects in the database.
Exclusion Management
12-121
Calculating Checksum for Condition Coverage
The checksum used for a top-level condition is that condition itself.
But if the condition is nested inside other code, the enclosing
conditions are also taken into consideration which calculating the
checksum.
Exclusion Management
12-122
108: if (kp_hold || (x_not && y_tot))
Exclusion Management
12-123
An exclusion review of line 110 may seem unnecessary in this
example, but consider that the checksum change occurred because
the signals gtr, dim, or nck were given different assignments in the
code. In this case, a review is important.
The signature for an excluded statement for line coverage is the text
of the starting line of the block in the source code.
Multiple basic blocks can appear on a single line of text. In this case,
the signature of an excluded statement still includes the entire
source text of the line.
Exclusion Management
12-124
The checksum is as follows:
Example 1
Input in[3:0];
CHECKSUM: "297701905 1142099701"
INSTANCE: memsys_test_top.dut.Umem
ANNOTATION: " Signal Excluded "
Toggle adxStrb "net adxStrb"
Exclusion Management
12-125
Example 2
• Whole FSM
• State
• Transition
The signature for an FSM state exclusion is as follows:
Exclusion Management
12-126
The signature for an FSM transition exclusion is as follows:
FSM exclusions are mapped using the current state signal name and
the names of the states involved. If an exclusion exists for a state
signal that no longer exists, or a state whose name no longer exists,
the exclusion is categorized as unmappable. For example, for
transition third->idle, it should be 8->1, where 8 is the value of
third and 1 is idle.
Exclusion Management
12-127
Calculating Checksum for Branch Coverage
For branch coverage, all the controlling expressions inside a branch
and enclosing scopes (event expression of always block), if any,
becomes a part of checksum computation.
if(a1==1'b1)
begin
out = a1 && a2;
end
else
begin
if(reset==1)
begin
q=4'b0000;
end
else
q=q+1;
end
Checksum:
Exclusion Management
12-128
ANNOTATION: "branch excluded for testing"
Branch 0 "24436355" "(reset == 1'b1)" (0) "(reset == 1'b1) 1"
Branch 1:
"24436355" "(reset == 1'b1)" (0) "(reset == 1'b1) 1"
Branch 2:
"24436355" "(reset == 1'b1)" (1) "(reset == 1'b1) 0"
case(state)
S0: if(count<4'b1001)
begin
state<=S0;
count<=count+4'b0001;
end
Signature:
Exclusion Management
12-129
Calculating Checksum for Assertion Metric
The signature for an assertion exclusion is the name and type
(assertion, cover property, cover sequence) of the assertion.
Note:
Changes in assertion content are not detected, because they are
not part of the signature.
For example,
CHECKSUM: "3172832887"
INSTANCE: dut
Assert A1 "assertion"
Exclusion Management
12-130
Calculating Checksum for Covergroup Metric
Covergroup bins also contain unique names that are used for
coverage exclusion. The signature of a covergroup bin is its name.
User-defined bins have user-defined names. Automatically created
bins have names generated according to the LRM rules.
For example:
covergroup cg;
cover_point_y : coverpoint y;
endgroup
Exclusion Management
12-131
Remapping Exclusions From the Block Level to the
System Level
When large designs are verified, often lower-level blocks or units are
first verified independently and then integrated into a larger chip or
system-level verification. As a block/unit level design is verified, it is
often needed to waive or exclude objects from the coverage model.
Usually those objects should also be excluded at the system level.
This section describes how to import block-level exclusions to the
system level. The technique used is based on the same feature —
mapping — that enables block-level coverage to be imported into
system-level coverage analysis. You can map both coverage and
exclusions at the same time if required.
Use Model
Exclusion Management
12-132
In the figure, the block-level instance md1 of the mod1 module is
mapped with the system-level instances, namely md1a and md1b of
the mod1 module. Therefore, exclusions associated with the block-
level instance md1 can be reused at the system-level instances md1a
and md1b.
There are two ways to remap exclusions from the block level to the
system level:
Exclusion Management
12-133
-map and -elfile Options
When using the -map option, a module is identified by name and all
of its instance exclusions are mapped to all of its instance at the
system level. For mapping, use the -map option with the urg
command. The rules for mapping exclusions using the -map option
are as follows:
To map exclusions for a module from the block level to the system
level, use the -elfile option along with the following -map option:
CHECKSUM:1002196755 756496780"
INSTANCE:mod1.md1
Toggle a "reg a”
Exclusion Management
12-134
-mapfile and -elfile Options
To map instance exclusions at the block level with those at the
system level using a mapping configuration file, use the -mapfile
option with the urg command. An example of the mapping
configuration file is as follows:
MODULE: mod1
INSTANCE:
SRC: mod1.md1
DST: top1.mod1.md1a
SRC: mod1.md1
DST: top1.mod1.md1b
With the -mapfile option, you can specify about the instances that
receive exclusions from instances at the block level. Therefore, you
can map exclusions from the block level instead of merging
exclusions instance-by-instance.
Exclusion Management
12-135
The following example shows how to map exclusions given in the
elfile.el file for the map1 file from input.vdb to base.vdb using
the following urg command:
urg -dir base.vdb -dir input.vdb -mapfile map1 -elfile
elfile.el
Exclusion Management
12-136
13
Constant Analysis 1
This chapter discusses how you can find coverage targets that are
unreachable and helps reduce the coverage denominator. This
allows you to focus on the reachable coverage targets. This chapters
has the following sections:
• “Filtering Constants”
• “Dumping Annotations for Automatically Excluded Coverage
Targets”
Filtering Constants
Many designs have a number of HDLs and IP’s derived from different
sources, which are used to build a SoC. However, often many parts
of the design may not be used in the real chip because of the
unreachable targets. Constant analysis finds coverage targets that
Constant Analysis
13-1
cannot be reached by any test and helps reduce the coverage
denominator and allows you to focus on the reachable coverage
targets.
Constant Analysis
13-2
The -cm_constfile option is used to inform VCS MX to treat
specified signals, nets, and variables, as permanently at 1 or 0
constant values. You can specify the list of signals in the text file
passed as an argument to the -cm_constfile option.
In Example 13-1 there are conditions that will never be met, lines that
will never execute, and nets that will never toggle between true and
false.
Constant Analysis
13-3
There are a number of ways that a net can be permanently at 1 or 0,
but the analysis performed by the -cm_noconst option can only
recognize this in the following cases:
assign G = 1;
assign H = 0;
assign I = 3’b0;
assign J = 1’b1;
Constant Analysis
13-4
No matter how you assign these 0 or 1 values, when you use the
-cm_noconst option, VCS MX will not monitor the pertinent
conditions or lines.
Constant Analysis
13-5
If there is more than one continuous assignment statement of the 1
or 0 value to a net, VCS MX does not omit monitoring for conditions
or lines specified or controlled by the value of that net. This is true
even when the multiple continuous assignments are assigned to
different bits of a vector net. For example:
always @ r1
VCS monitors for when w1 is both 1 and 0
begin
r2 = (w1 && r1);
r3 = (w2[0] && r1);
end
VCS monitors for when w2[0] is both 1 and 0
Top.M1.my_case_var 2'b10
Constant Analysis
13-6
Next, consider the code shown in Example 13-3.
Top.M1.x 1’b1
Constant Analysis
13-7
VCS MX also supports marking a condition in ternary condition as
unreachable if that condition is never evaluated, as ternary condition
evaluates to be constant. For example, consider the following code:
Constant Analysis
13-8
Analyzing Assignments in Sequential Code
Consider a simple flip-flop as shown in Figure 13-1. The data input
is known to be “always 0” - say, due to a continuous assignment to a
wire. And while the output is initially X, the output can never be 1.
Constant Analysis
13-9
input data, clk, reset;
output q;
reg q;
endmodule
module top;
wire d1, /* always 0 */
d2, /* never 1 */
d3, /* never 1 */
d4; /* never 1 */
reg clk;
dff_sync ff1(d1, clk, d2);
dff_sync ff2(d2, clk, d3);
dff_sync ff3(d3, clk, d4);
if (d4)
… // this line will be marked unreachable
else
…
Constant Analysis
13-10
The same analysis is performed for vector signals. In the following
example, even though you do not have any information about the
value of data, you can see that q[3:0] will never be 1, because
both of its assignments are from constant 0.
endmodule
assign b = 1'b1;
always@(posedge clk)
begin
a <= b; // a should be 'never 0'
end
Constant Analysis
13-11
initial
begin
a <= 1;
end
The same analysis is performed for vector signals. In the following
example, qout[15:2] is “never 1”.
assign d = 0; /* d is always 0 */
assign e = 0; /* e is always 0 */
assign #5 c = 1'b0;
Constant Analysis
13-12
coverage target. This section discusses, for each metric, any
differences between always and never constants and how they are
used to identify unreachable coverage targets.
Toggle Coverage
In toggle coverage, “never 0” and “always 1” are the same. Because
toggle only cares about value changes from 0 ->1, a given toggle bit
becomes unreachable for any constant status.
For example,
wire a, b, c, d;
assign a = 1'b0;
assign b = 1'b1;
assign #5 c = 1'b0;
assign #5 d = 1'b1;
Signal Details
Toggle Toggle 1->0 Toggle 0->1
a Unreachable Unreachable Unreachable
b Unreachable Unreachable Unreachable
c Unreachable Unreachable Unreachable
d Unreachable Unreachable Unreachable
Constant Analysis
13-13
bit a;
assign #5 a = 1'b1;
Although signal a appears to be of “never 0” value, it is not because
of its being of type bit.
Line Coverage
In Verilog, any expression with an X value in it evaluates to X, and
any conditional test of an X value is treated as false.
For example, consider the following “if” statements when the value
of myx is X:
if (myx)
$display("myx");
else
$display("else myx");// will execute if 'myx' is 1'bx
if (!myx)
$display("!myx");
else
$display("else !myx");// will execute if 'myx' is 1'bx
In both the “if” statements the “else” branch will execute when myx is
1'bx, even though the values myx and !myx are tested, which
appears to be opposite values. This is because myx and !myx both
evaluate to the unknown X value, which is treated as false.
The following table shows what can be concluded for the reachability
of the “if-then-else” branches for a simple “if” statement on a variable
“s”. For the “always” cases, either the true or the false branch will be
unreachable. For the “never 0” case, nothing can be concluded
because “never 0” is same as “X or 1”. Since X will be treated as
Constant Analysis
13-14
false, either branch could be reached. And for “never 1”, it can be
concluded that the “then” case is unreachable, because “never 1”
means “X or 0”, both of which are treated as false.
Value of s
if (s)
Always 0 Always 1 Never 0 (X or 1) Never 1 (X or 0)
a = 1'b0;
else unreachable reachable reachable unreachable
a = 1'b1; reachable unreachable reachable reachable
Value of s
if (!s)
Always 0 Always 1 Never 0 (X or 1) Never 1 (X or 0)
a = 1'b0;
else reachable unreachable unreachable reachable
a = 1'b1; unreachable reachable reachable reachable
Value of s
Always 0 Always 1 Never 0 (X or 1) Never 1 (X or 0)
assign x = s; unreachable unreachable reachable reachable
Constant Analysis
13-15
Case Statements
case (a)
2’b00: ..bold lines are unreachable if ‘a’ is always 01
2’b01: ...
2’b10: ...
2’b11: ...
2'b0x: ...
2'b1x: ...
2'bx0: ...
2'bx1: ...
2'bxx: ...
endcase
But when a is known to be either 2'b01 or X, the case statement is
as follows:
case (a)
2'b00: ... red lines are unreachable if 'a' is 01-or-X
2'b01: ...
2'b10: ...
2'b11: ...
2'b0x: ...
2'b1x: ...
2'bx0: ...
2'bx1: ...
2'bxx: ...
endcase
Also, consider the casex statement. The casex statement treats
any X or Z value as don't-care when comparing. The X or Z values
can appear either in the argument to casex or in any of the case
values.
For example,
casex (a)
Constant Analysis
13-16
2'b1x: …
…
endcase
It appears that the first case can only happen if a's first bit is 1. But it
will also match if a's value is 2'bxx, because the X's in a will be
treated as don't-cares. So when VCS MX is comparing a const-or-X
value for the casex statements, it is assumed that any bit can be X,
and therefore any case value can be matched. Because Verilog
evaluates casex statements in the first-match order, the first case is
always reachable.
Condition Coverage
In some cases of condition coverage, VCS MX considers an X value
to be equivalent to false but in other cases it will not. If the operator
of the conditional expression is a “relational” operator, an X value is
treated as false.
== equality
!= inequality
=== case equality
!== case inequality
> greater that
>= greater that or equal to
< less than
<= less than or equal to
Constant Analysis
13-17
if (b[1:0] == b[1:0]) … //will be executed when b == 2'b00
LINE 27
EXPRESSION (b[1:0] == b[1:0])
---------1--------
-1- Status
0 Covered
1 Covered
But for non-relational operators, VCS MX treats X as its own
separate value.
For example,
if (a || b)
...
else
...
Value of s
Always 0 Always 1 Never 0 (X or 1) Never 1 (X or 0)
a=1, b=0
reachable unreachable unreachable reachable
a=0, b=1 unreachable reachable reachable unreachable
a=0, b=0 reachable unreachable unreachable reachable
unreachable reachable reachable unreachable
a=1, b=1
Constant Analysis
13-18
Conditions inside the ternaries are not affected by the “never”
uncertainty. So in the following example, VCS MX can mark the "q &
z" condition as unreachable, as it knows bus b can never be 2'b00:
assign #5 b = 2'b11;
req = (b[1:0] == 0) ? (q & z) : (q | z);
Constant Analysis
13-19
Limitations
wire [2:0] w;
Constant Analysis
13-20
assign w = 2'b01;
initial
begin
casex (w)
2'b00 : $display("00");
2'b0x : $display("0x");
default : $display("default");
endcase
end
• VCS does not detect constant signal values when cross module
references (XMRs) are involved.
For example,
module m;
assign top.p = 1'b0;
endmodule
module top;
wire p;
endmodule
In the above example, VCS will not find that top.p is constant 0
with either -cm_noconst or -cm_seqnoconst option.
Therefore, the generated constfile.txt file does not include
an entry for the top.p signal.
For example,
module m;
wire q;
assign q = top.d;
endmodule
module top;
Constant Analysis
13-21
wire d;
assign d = 1'b0;
m m1();
endmodule
assign p1 = 1'b1;
typedef struct {
reg [3:0] i1;
bit i2;
}str;
str s1;
Constant Analysis
13-22
endmodule
Port Details
Toggle Toggle 1->0 Toggle 0->1 Direction
clock Yes Yes Yes INPUT
MRE Unreachable Unreachable Unreachable INPUT
Signal Details
Toggle Toggle 1->0 Toggle 0->1
r1[31:0] Unreachable Unreachable Unreachable
p1 Unreachable Unreachable Unreachable
s1.i2 No No Yes
s1.i1[3:0] No No No
Port Details
Toggle Toggle 1->0 Toggle 0->1 Direction
clock Yes Yes Yes INPUT
i1[1:0] No No No INPUT
i2 No No No INPUT
Constant Analysis
13-23
Limitation With the -cm_seqnoconst Option
With the -cm_seqnoconst option, VCS MX does not find every
unreachable coverage target in the design. For example, consider
that there are only two assignments to the signal b in the following
design:
Constant Analysis
13-24
always@(posedge clk or reset)
if (reset == 1'b0)
q <= 1'b0; // 'q' will be treated as constant
else // because 'd' is 0 and
q <= data; // the reset is also value 0
Constant Analysis
13-25
Propagating Constants Through Instance Arrays
Case 1
For each port or terminal where the bit length of the instance array
port expression is the same as the bit length of the single-instance
port, the instance array port expression is connected to each single-
instance port.
Example
Here, if the widths of abc and def are equal, then it is interpreted as:
Constant Analysis
13-26
and,
If the widths of abc and def are equal (both have width 4), then it is
interpreted as:
Case 2
If bit lengths are different, then each instance gets a part-select of the
port expression as specified in the range, starting with the right-hand
index.
Example
Case 3
Too many or too few bits to connect to all the instances is reported
as a syntax error during Verilog parsing.
Constant Analysis
13-27
Examples
Example 13-4 shows identification of a constant in instance array/up
and downward constant propagation through an instance array. In
Example 13-4:
Constant Analysis
13-28
Example 13-5 shows passing constants to and from an instance
array according to the port connection rule for instance array. In
Example 13-5:
You can also tell VCS MX to treat specified signals, nets, and
variables, as permanently at 1 or 0 constant values by specifying the
list of signals in a text file passed as an argument to the
-cm_constfile option. VCS MX will not monitor the specified
signals, nets, or variables for toggle coverage (Verilog only), or
vectors for conditions that cannot be covered and lines that would
not be executed considering the information in <constfile>.
However, <constfile> does not really affect the values of signals,
nets, or variables during simulation.
Constant Analysis
13-29
When compiled with the -cm_constfile option, VCS MX treats
the following as constants:
top.a 2’b10
then VCS MX Coverage considers the value of "b" as
8’b10x11x01 for constant filtering.
Constant Analysis
13-30
Specifying Instance-Specific Constant Signals in
Constant Configuration File
VCS MX allows you to specify instance-specific constant signals
within a constant configuration file (-cm_constfile option).
Following are the syntaxes:
Syntax 1
Top.M1.x 1'b0
Syntax 2
Constant Analysis
13-31
Syntax 1
For example, to make signal “x” a constant 0 for module M and if the
module is inside library LIB, specify the following in the
<constfile>:
\LIB.M .x 1'b0
Syntax 2
For example, to make signal “x” a constant 0 for module M and if the
module is inside library LIB, specify the following in <constfile>:
Constant Analysis
13-32
For a particular signal, if both module-specific and instance-specific
constant signals are specified in the constant configuration file, the
instance-specific constant value is given preference for the particular
instance.
\LIB.M .x 1’b0
Top.M1.x 1’b1
Top.M1.x 1’b1
\LIB.M .x 1’b0
Then signal x gets value 1’b1 for instance M1, because the
instance-specific constant is specified first in the constant
configuration file.
Constant Analysis
13-33
And you initialize it at the beginning of an initial block as follows:
initial
begin
my_case_var = 2'b10;
Top.M1.a 1’b1
• Control flow constructs such as while or for are not supported for
control flow-based reachability for condition coverage.
Constant Analysis
13-34
Using the <constfile>, you can:
• Single line comments should start with "//". You can also
comment a block, by enclosing it within "/*" and "*/".
• Specify a list of signals, nets, or variables, and their corresponding
constant values.
For example:
top.t1.a 1
top.b 4’b1010 //test is the module name and for all the
instances of module test “b” is tied to 4’b1010
Note:
Instance specific constants are given preference over module
specific constants if they both refer to the same variable and have
different constant values.
top.b1.x1 1’b0
bot.x1 1’b1
top.b2.x1 1’b0
For above, both the instances b1, b2 will get value 1’b0 and for
instances b3, variable x1 will get value 1’b1.
Constant Analysis
13-35
For example:
top.c 1’sb1
top.c 4’b101U1111
For example:
top.d 9’o3U4
top.e 12’h5U8A
Constant Analysis
13-36
VCS MX expands above declarations as:
top.d 9’b011UUU0100
top.e 12’b0101UUUU10001010
Instead of a constant value, you can also specify an expression as
follows:
Note:
If the specified expression contains "U", VCS MX replaces "U" with
"x" as in Verilog during evaluation, and the evaluation follows
Verilog semantics.
Constant Analysis
13-37
The following table lists the supported operators:
Constant Analysis
13-38
Table 13-1 Supported Operators (Continued)
^ reduction xor One
^~ or ~^ reduction xnor One
Shift >> Right shift Two
<< Left shift Two
>>> Arithmetic Right Shift Two
<<< Arithmetic Left Shift Two
Concatenation { } Concatenation Any number
Replication {{}} Replication Any number
Conditional ?: Conditional Three
Parentheses () Change Precedence --
constfile_statement_declarations ::=
constfile_statement_declarations constfile_statement
|
;
constfile_statement ::= full_signal_name
constant_expression
| module '{'module_name'}' '{'signal_identifier'}'
'{'constant_expression'}'
| instance '{'full_instance_name'}'
'{'signal_identifier'}' '{'constant_expression'}'
full_signal_name ::= full_instance_name.signal_identifier
| module_name.signal_identifier
full_instance_name ::= hierarchical_path_of_instance
constant_expression::=
[ sign ] decimal_number
| [ sign ] octal_number
| [ sign ] binary_number
| [ sign ] hex_number
| expression_with_operator
expression_with_operator ::=
'(' constant_expression ')
| constant_expression BIN_OP constant_expression
| '{' list_of_constant_expression '}'
| '{' constant_expression '{' constant_expression '}' '}'
Constant Analysis
13-39
| UNI_OP constant_expression
Note:
Embedded spaces are illegal.
Constant Analysis
13-40
Dumping Annotations for Automatically Excluded
Coverage Targets
if (a && b)
$display("this can't happen");
If you enable -diag noconst, VCS MX will, in the output file, say
if it was “a” that was determined to be constant 0, or “b”, or both.
top.d1'b0
Then, for the following code, the constant analysis is done as shown
in the comments and in the given order:
Constant Analysis
13-41
1 module dff_sync(data, clk, reset, q);
2 input data, clk, reset;
3 output q;
4 reg q;
5 always@(posedge clk or reset)
6 if (reset == 1'b0)
7 q <= 1'b0; /* 2. q is only 0 or X */
8 else
9 q <= data; /* 2. q is only 0 (data) or X */
10 endmodule d is const So d is
11 0 from always
12 module top; constfile 0
13 wire d, qout;
14 reg clk, rst;
15 dff_sync d1(d, clk, rst, qout); /* 1. data is always 0 */
/* 3. qout is only 0 or X */
16
17 wire t;
18 assign t = d | qout; /* 4. t can only be 0 or X */
19 endmodule
Constant Analysis
13-42
For more information about what the “0 or X” value means, see
the “Constant Analysis With the -cm_seqnoconst Option” section.
Use Model
Note:
You must enable constant analysis using the appropriate constant
propagation analysis option, such as -cm_noconst,
-cm_constfile, or -cm_seqnoconst in the command line.
The following is the constant analysis information dumped into
constfile.txt for the example mentioned in the previous
section.
constants:
- module: top
expression: d
declaration: file.v:13
value: always 0
locations:
- location: myconsts.txt:1
- instance: top.d1
expression: data
declaration: file.v:2
value: always 0
locations:
- location: file.v:15
Constant Analysis
13-43
inputs:
- input: d
- instance: top.d1
expression: q
declaration: file.v:4
value: 0 or X
locations:
- location: file.v:7
- location: file.v:9
inputs:
- input: data
- module: top
expression: qout
declaration: file.v:13
value: 0 or X
locations:
- location: file.v:15
inputs:
- input: q
- module: top
expression: t
declaration: file.v:17
value: 0 or X
locations:
- location: file.v:18
inputs:
- input: d
- input: qout
Constant Analysis
13-44
If the scope is a module, it means VCS MX has found that the
expression is constant based on the module itself, independent of
the parameter values or the values passed to only some
instantiations but not others.
Note:
• There can be more than one location involved. For the signal
top.d1.q, there are two assignments that are considered.
Constant Analysis
13-45
• There can be more than one input for a signal. For the signal
top.t, “d” and “qout” are inputs.
• Only signals and signal expressions are listed as inputs; there will
be no inputs listed if the only source s for the expression are literal
constants.
Examples
The “1” bits of vec are listed separately. The contiguous 0 part of
vec is listed as a 2-bit part-select:
- module: top
expression: vec[3]
declaration: file.v:13
value: always 1
locations:
- location: file.v:15
- module: top
expression: vec[2]
declaration: file.v:13
value: always 1
Constant Analysis
13-46
locations:
- location: file.v:15
- module: top
expression: vec[1:0]
declaration: file.v:13
value: always 0
locations:
- location: file.v:15
The output consists of two expressions - one for data[3] and one for
all of data[2:0], each of which will have "always 1" as its constant
value:
- module: top
expression: data[3]
declaration: file.v:13
value: always 1
locations:
- location: file.v:15
- module: top
expression: data[2:0]
declaration: file.v:13
value: always 1
locations:
- location: file.v:15
Constant Analysis
13-47
Note:
Because of this grouping no explicit 0 values are shown, as
data[2:0] having the value 001 implies that data[2] and
data[1] are both 0.
Bit-Select Inputs
The constants can be derived from bits of constant expressions. For
example, assume that r[0] and r[1] are both known to be “always
1”. Now consider this assignment to one bit of a vector “c”:
- instance: L2Inst
expression: c[0]
declaration: Source/seqNoConst/concatWidth.v:49
value: 0 always
locations:
- location: Source/seqNoConst/concatWidth.v:51
inputs
- input: r[0]
- input: r[1]
Note that both r[0] and r[1] are listed in the inputs.
Bit Padding
Consider the following assignment:
Constant Analysis
13-48
The myfile[25:6] expression is flagged as constant 0 because
the six-bit concat expression is padded out to the left with zeroes (the
lowest six bits of myfile are not constant). So the report is as
follows:
- instance: top
expression: foo[25:6]
declaration: file.v:1
value: 0 or X
locations:
- location: file.v:12
Note that there are no inputs listed, as only constant (padding) 0s
feed this constant expression.
module simple;
wire [5:0]w;
endmodule
When simple.w 5'b00101 is input using the myconst1.txt file
with the -cm_constfile option, zero padding occurs for bit w[5]
and is reported as:
- instance: simple
expression: w[1:0]
declaration: test_const_padding.v:3
value: 1 always
locations:
- location: myconst1.txt:1
- instance: simple
expression: w[4:2]
declaration: test_const_padding.v:3
value: 1 always
Constant Analysis
13-49
locations:
- location: myconst1.txt:1
- instance: simple
expression: w[5]
declaration: test_const_padding.v:3
value: 0 always
locations:
- location: myconst1.txt:1
- instance: simple
expression: w[1:0]
declaration: test_const_padding.v:3
value: 1 always
locations:
- location: myconst2.txt:1
- instance: simple
expression: w[5:2]
declaration: test_const_padding.v:3
value: 1 always
locations:
- location: myconst2.txt:1
Constant Analysis
13-50
A
Unified Coverage API 1
The Unified Coverage Application Programming Interface, or
UCAPI, provides a single, consistent, and extensible interface to
access coverage data generated by Synopsys tools. With this API,
you can create custom reports and tools for displaying and analyzing
coverage data.This chapter contains the following sections:
• “Overview”
• “Data Model”
• “Predefined Coverage Metrics”
• “Loading a Design”
Inside each region in the design, the coverage data for a given metric
is made of UCAPI building blocks. These represent the objects that
were monitored for coverage in that region. Since each metric has its
own separate collection of such objects, this is called metric-qualified
data.
• “Database Contents”
• “Persistence”
• “UCAPI Setup and Compilation Requirements”
• “Dynamic UCAPI Library”
Database Contents
Persistence
#!/bin/csh
#
# Common env var setup script for UCAPI examples
#
# A Summary
echo UCAPI Setup Complete
echo " VCS_HOME : " $VCS_HOME
echo " ARCH : " $ARCH
echo " LD_LIBRARY_PATH : " $LD_LIBRARY_PATH
As shown in the script, Redhat and SuSE require the -m32 option to
be passed to the C compiler, while Solaris requires the -lsocket
and -lnsl libraries to be included. The script also verifies that
VCS_HOME and the OS specific install of VCS is present on the
system before attempting to compile. This is required as the UCAPI
library is precompiled for different OS's and included within the VCS
install.
After the setup is complete, the c compiler, cc, is called with the
following arguments:
covdb_configure(covdbDisplayErrors, "true");
// setting to "false" disables / default
It is recommended that the above line of code be added to the
beginning of your UCAPI program.
Usage Model
To link the UCAPI library dynamically, use the following commands:
UCAPI Object
Any UCAPI object may have string or integer annotations on it, which
can be retrieved by using the covdb_get_annotation,
covdb_get_integer_annotation, and
covdb_get_qualified_annotation functions described in the
“Reading Annotations” section of the Coverage Technology
Reference Manual.
• covdbLineNo – the line in the source file where the object’s text
begins.
• covdbName – the name of the object
• covdbFullName – the full name (including hierarchical name, if
applicable)
• covdbFileName – the source file in which this object is defined
The following properties may only be read from metric-qualified
objects, but does not require a test handle:
• covdbStatusCovered – covered
• covdbStatusUnreachable – can never be covered, as when
a formal tool has proven it is impossible to cover
• covdbStatusIllegal – should be considered an error if the
object was covered
• covdbStatusExcludedAtCompileTime – the object was
marked excluded at compile time
Note that, while all of these properties may be retrieved from any
coverable object handle, all objects may not have useful information.
For example, a container object may have no associated file name
or line number, but that information may be retrieved from the objects
it contains. Whether or not this information is present for a given
object depends on the metric and the coverage tool that created that
object.
Coverable objects are assigned names that are unique within the
region or container in which they are defined. Named objects, such
as signal bits, may contain a list of lower-level objects - for example,
a signal bit "x[1]" can have toggle objects representing the toggle
from 0 to 1 and the toggle from 1 to 0. In this example, the names of
those objects in UCAPI are "0 > 1" and "1 > 0".
Variant names are assigned by UCAPI using the name of the module
plus a parenthesized list of its parameter/generic values. For
example, if a module M has two variants for a given metric, its variant
names might be "M(p = 1)" and another variant "M(p = 2)". The
name of the unqualified module is "M". See the section titled “Source
Definition and Source Instance” for more information on variants.
In the diagrams for coverable objects in this section, only the special
properties and relations for each type are shown below.
Block
A block represents an atomic coverable object. The covdbType
property for a block object is covdbBlock. Block objects have no
additional relations on them. Depending on the metric, they may
have covdbFileName, covdbLineNo, and covdbName
properties.
For example:
covdbIntegerValue
covdbFromValue covdbValue: 0
covdbIntervalValue
covdbToValue covdbIntegerValue
covdbValue: 10
Vector Values
An object of type covdbVectorValue supports the
covdbValueName string property, which indicates the represented
value or range as a string.
Sequence
An object of type covdbSequence contains an ordered collection of
other coverable objects and represents the sequential coverage of
each member object. For example, a sequence of value sets might
represent a signal taking on the specified sequence of values.
”t1”
covdbSequence
covdbObjects
covdbIntegerValue
covdbValue: 1
covdbIntegerValue
covdbValue: 3
covdbIntervalValue
covdbRepeat
covdbInterval
covdbObjects
optional
covdbRepeat
relation goes from covdbIntegerValue
sequence member
covdbFromValue covdbValue: 2
to repeat count
covdbIntegerValue
covdbToValue covdbValue: 3
• covdbGoto
• covdbConsecutive
Cross
An object of type covdbCross has the same structure as a
sequence, but the objects in the covdbObjects iterator are in no
particular order. A covdbCross object represents the simultaneous
coverage of its member objects.
The stable names for coverable objects feature allows you to specify
stable names for coverable objects, whose names are unstable by
default.
//coverage name a1
if (a || (b && c))
You can attach a tag to a statement, but that statement may contain
multiple conditions. Each condition may also contain subconditions,
and each condition or subcondition will have a list of vectors.
//coverage name a1
if (a || (b && c)) {
…
}
The top-level condition is a || (b && c). It is broken down by code
coverage into two terms. Its name is a1:
a || (b && c)Condition a1
1 --2---
VCS will assign names based on the name. The first condition is
named as mycond:
//coverage name a2
x <= (a || b) ? 1’b0 : 1’b1; y = (c && d) ? 1’b0 : 1’b1;
a || b Condition a2
1 2
There is no name for the second condition c && d, since it occurs
in another statement that has no pragma preceding it. If you want to
assign a name to c && d, then you should put the statement on a
separate line:
//coverage name a2
x <= (a || b) ? 1’b0 : 1’b1;
//coverage name a3
y = (c && d) ? 1’b0 : 1’b1;
a || b Condition a2
1 2
c && d Condition a3
1 2
LINE 12
CONDITION_ID 1
STATEMENT if ((a || (b && c)))
1 --2---
EXPRESSION -1- -2-
0 0 | Not Covered
0 1 | Not Covered
1 0 | Not Covered
If the condition was named with a pragma in the source, then the
name will appear instead:
LINE 12
CONDITION_ID a1
STATEMENT if ((a || (b && c)))
1 --2---
EXPRESSION -1- -2-
0 0 | Not Covered
0 1 | Not Covered
1 0 | Not Covered
Subconditions will be named as described above. For example, the
subcondition b && c is labeled as a1.1:
LINE 12
CONDITION_ID a1.1
STATEMENT if ((a || (b && c)))
1 2
EXPRESSION -1- -2-
1 1 | Not Covered
0 1 | Not Covered
1 0 | Not Covered
Design Objects
After tests are loaded, applications can iterate over the list of loaded
tests from a design handle using the covdbLoadedTests relation:
Unqualified regions are the skeleton of the design. You cannot see
any coverable objects in them because the list and shape of
coverable objects depend on a particular metric.
source instance
or definition
str: covdbFileName
int: covdbLineNo
int: covdbIsVerilog
int: covdbIsVhdl
covdbSourceInstance
covdbInstances
covdbParent
covdbIdentity metricHdl,
covdbIdentity
covdbInstances
covdbParent
covdbSourceInstance
metric-qualified
unqualified design
covdbInstances
covdbDesign
covdbInstances
covdbSourceInstance
covdbDefinitions
covdbInstances
covdbSourceDefinition
covdbParent
covdbDefinition
covdbIdentity
metricHdl,
covdbIdentity
metricHdl,
covdbDefinitions
covdbIdentity
covdbDefinition
covdbSourceDefinition
covdbDefinitions
metricHdl,
covdbInstances
covdbSourceInstance
covdbParent
covdbInstances
metric-qualified design
Container
Objects of type covdbContainer are abstractions that represent a
collection of coverable objects that logically belong together.
Containers may have two different lists in them:
basic block
covdbContainer
statement
covdbObjects
covdbBlock
1 always@(posedge clk)
2 begin
3 if (x)
4 begin
5 a <= b;
6 c <= d;
7 end
8 else
9 begin
10 a <= d;
11 c <= b;
12 end
13 z <= w;
14 end
This is represented in UCAPI as follows:
Condition Coverage
table
source
instance or covdbContainer
definition covdbObjects
covdbObjects
condition
covdbObjects
covdbContainer
vector
covdbObjects
covdbCross value set
if (a && (b || c))
“0 1”
“a && (b || c)”
“1 0”
covdbCross
“1 1”
covdbCross
“b || c”
subcondition “b || c”
covdbContainer covdbCoverable = 3
“0 0”
covdbCross
covdbObjects
covdbCross
“1 0”
covdbCross
x = y & z;
covdbComponents
width is number
of branch terms
covdbObjects
branch term
covdbBlock
branch vector
covdbCross
term value
value set or
covdbBlock
The coverable objects for branch coverage are all crosses of value
sets. For example, consider a branch that is covered when the
following expression is true:
(r1 == 1’b1) && (r2 && r3) && (r5 && r6)
That branch would be modeled as a cross of these three terms, each
of which is a covdbIntegerValue value set:
cross for
covdbCross (r1 == 1’b1) && (r2 && r3) && (r5 && r6)
covdbValue = 1
covdbIntegerValue covdbName = “1’b1 ”
covdbValue = 1
covdbIntegerValue
covdbName = “1 ”
covdbValue = 1
covdbIntegerValue covdbName = “1 ”
1 initial
2 begin
3 case (r1) First top-level statement
4 1'b1 : if (r2 && r3)
5 r4 = 1'b1;
6 1'b0 : if (r7 && r8)
7 r9 = r10 ? 1'b0 : 1'b1;
8 1'bx : $display("x");
9 default : $display("no op");
10 endcase
11
12 r9 = (r10 && r11) ? 1'b0 : 1'b1; Second top-level
statement
13 end
For the sample code shown above, the UCAPI model is:
case(1)
vec[0]: …
vec[1]: …
vec[2]: …
endcase
In this example, the case alternatives are not constant values, and
therefore cannot be modeled as value sets. In this case,
covdbBlock handles are used for the case alternatives. Note that
the argument to the case conditional (“1”) is when possible modeled
as a value set:
branch-qualified
instance or variant
covdbComponents
covdbValue = 1
covdbContainer
covdbObjects
9 if (z)
10 x <= a ? b : c;
11 else
12 x <= 1’b0;
branch-qualified
covdbComponents
instance or variant
covdbBlock “z”
covdbObjects
covdbBlock “a”
covdbContainer
covdbObjects
covdbIntegerValue
covdbValue = 1
covdbName = “1”
covdbIntegerValue covdbValue = 1
covdbName = “1”
covdbIntegerValue
covdbValue = 0
covdbName = “0”
covdbScalarValue covdbValue = covdbValueX
covdbName = “-”
state states
covdbObjects
covdbObjects
value set covdbContainer
covdbObjects
transition transitions
covdbObjects
covdbSequence covdbContainer
sequence sequences
covdbObjects
covdbSequence covdbContainer
States:
IDLE
READ
DLY
DONE
states
covdbCoverable = 4
covdbContainer
covdbName “IDLE”
covdbIntegerValue covdbIntValue 0
covdbObjects
covdbName “READ”
covdbIntegerValue covdbIntValue 1
covdbName “DLY”
covdbIntegerValue covdbIntValue 2
covdbName “DONE”
covdbIntegerValue covdbIntValue 3
covdbName
covdbSequence “IDLE -> READ”
covdbName “IDLE”
covdbIntegerValue covdbIntValue 0
covdbName “READ”
covdbIntegerValue covdbIntValue 1
covdbName
covdbSequence “READ -> IDLE”
covdbName “READ”
covdbIntegerValue covdbIntValue 1
covdbName “IDLE”
covdbIntegerValue covdbIntValue 0
other five
transitions …
covdbContainer
covdbName
covdbSequence “READ -> DLY -> IDLE”
covdbName “READ”
covdbIntegerValue covdbIntValue 1
covdbName “DLY”
covdbIntegerValue covdbIntValue 2
covdbName “IDLE”
covdbIntegerValue covdbIntValue 0
other sequenc es …
covdbObjects
covdbBlock
reg x[3:0];
input y;
wire y;
Table A-1
Signals 0->1 1->0
x[3] Y N
x[2:1] Y Y
x[0] N Y
y Y N
The toggle coverage structure would look like the following diagram.
(In this figure, only some of the covdbSequence and value set
children are shown.)
The data looks like the following (only the handles containing
mda[1][0][2] are shown):
typedef enum {
ASSERTION_TYPE_UNKNOWN = -1,
ASSERTION_TYPE = 0,
COVER_PROPERTY = 1,
COVER_SEQUENCE = 2
} AssertionType;
/**
*/
In this example that only the paths where the first range (#[1..])
had value 1 or 2 was the assertion covered. It was covered one time
for the value 1 and three times for the value 2. You can see this as
the covdbCovCount of the individual covdbCross bin handles.
property p;
int var_l;
@clk
a ##[2:4] b or
(a, var_l=ex) ##1 c[*1:$] ##1 !a && (ex==var_l)[*1:8]
##1 a;
endproperty
Since this property has a top-level or, it will have two containers for
paths under the assertion container. Also, since the second term has
two time intervals in it, the crosses contains two values each.
covdb_qualified_configure(designHdl,
covdbShowGroupsInDesign, "1");
<Hierarchical_scope_name>::<class_name>::<CG_name[SHAPE{…}
]>
<scope_name>::<class_name>::<CG_name[SHAPE{…}]>
In case of a package and top module, the first part of both the formats
is same as there is no difference between its scope name and
hierarchical scope name. However for other cases, its scope name
and hierarchical scope name are different.
To look for the difference between the names of the shapes, you
need to look at their variants. For example, see the variants name of
cg_fsm in the code snippet below:
Parent is s
Parent is s
Parent is top.dut
Parent is fsm
Parent is top
Usage
covdb_set(binHandle, coverGroupHandle, testHandle,
covdbCovCount, hitCount)
covdb_get(binHandle, coverGroupHandle, testHandle,
covdbCovCount)
Hit count can be set on bin handles at definition or instance level.
You can set hit count on instance level bin handles. The increase or
decrease in hit count is populated to the corresponding bin at the
definition level.
Set covdbStatusCovered
To mark a bin as covered, increment the hit count of that bin to the
coverpoint's least value.
Usage
covdb_set(binHandle, coverGroupHandle, testHandle,
covdbCovStatus,covdbStatusCovered)
covdb_get(binHandle, coverGroupHandle, testHandle,
covdbCovStatus)
You can use following code snippet to access the name of an auto
cross bin.
Loading a Design
Note that when using VCS, designs are loaded with the
covdb_load() function. The following function, loadDesign,
accepts a string argument representing the path to the design and
then loads the design.
Loading a design does not load the test(s) associated with a design.
Given a valid design handle, the available tests can be accessed.
Loading a single test requires that a valid design handle and test
name string be available:
while((availableTestName =
covdb_scan(availableTestNameIterator)))
{
mergedTest = covdb_loadmerge(covdbTest, mergedTest,
availableTestName);
if(!mergedTest)
printf("Could not load test %s\n",
covdb_get_str(availableTestName, covdbName));
else
printf("Successfully loaded and merged test %s\n",
covdb_get_str(availableTestName,
covdbName);
}
covdb_release_handle(availableTestNameIterator);
return mergedTest;
}
The UCAPI method covdb_release_handle() function is called
to release the iterator availableTestNameIterator. This is
done because a handle returned from a covdb_iterate() call is
persistent. Releasing the handle frees the associated memory and
prevents a memory leak.
Note:
This feature is limited to testbench and assertion coverage metrics
only.
For example:
test hits
mysimv/test15
mysimv/test20
mysimv/test32
mysimv/test40
Then the above code would print the following for b1:
The tests that did not cover the bin are not given in the iterator. All
the metrics and modes do not track the hit counts. Some will only
record that a given object was covered or not covered in a given test.
In this case, each test in the list will have a count value of 1 or it will
not be in the list.
Metrics or modes that do not support this relation will return a NULL
iterator handle when covdb_qualified_iterate is called.
However, no error will be flagged. Once a merged test handle is
saved using covdb_save, the information about which of the tests
that were loaded or loadmerged covered which object, is discarded
by default. That is, if you then reload the saved test, no data about
the individual tests that were merged to create it will have been
retained. You can change this behavior by using
covdb_configure to set covdbKeepTestInfo to true before you
load the initial design as follows:
covdb_configure(design, covdbKeepTestInfo,
“true”);
1
report-time exclusion 120 -flex_merge reference 31
Coverage Detail Window 21 forever statement
Coverage Map Window 19 in line coverage 9
coverage report, FSM 37 fsm argument to the -cm option 4, 48
Coverage Table Window 16 FSM coverage 37
coverage, toggle report 23 criteria for an FSM 27
coverage, viewing results 15 specifying 4, 48
coveritem 37 FSM transition mode 34
CPUtime 61 fullexclude_lp.tb_def 113
Customizing URG Charts 5 fullexclude_module.assert 114, 116
fullexclude.assert 114, 115
fullexclude.branch 102
D fullexclude.cond 98
-dbname 65 fullexclude.fsm 104
-diag noconst 43 fullexclude.line 92
drop 31 fullexclude.tb_def 109, 112
-dump full_exclusions 88 fullexclude.tb_inst 109, 112
-dump full_exclusions assert 114 fullexclude.tgl 94
-dump full_exclusions group 109
DVE 20
detail pane 56
G
starting 9, 3 generate 43
Generating Trend Charts 3
-grade cost 6
E gradedtests.txt 14
environment variable groups
URG_FAKE_TIME 10 creating coverage 22
environment variables
URG_NO_SESSION_XML 10
-excl_resolve on 49 H
exclusion files 88 Hierarchical Linkage 21
exclusion, commands 4
I
F if statement
filter coverage display 59 in line coverage 4, 8
-flex_merge 18 if-else statement
-flex_merge drop 33 in line coverage 8
invokingDVE 9, 3
2
L P
line argument to the -cm option 4, 47 pages, report generated 2
line coverage –parallel –grade 11
defined 3 port connection in Instance Arrays 26
difference from statement coverage 7 procedural assignment statement
line coverage, displaying 26 in condition coverage 13
load coverage session 11 procedural assignment statements
Loading and Saving Sessions 11 in condition coverage 15
propagation of constants 26
M
macro instantiations R
Coverage 13 recalculate the coverage 46
map window, coverage 19 report pages 2
-map_merge_union 60 reported code coverage metrics 2
mapping coverage for subhierarchies also reports
used in another design 54 generating 10
Metric-wide Breakdown Linkage 16 -reset_coverage 39, 8
module reuse of exclusion file 46
displaying coverage results by 18 review markers 51
monitoring for coverage 5 Running a Quick Start Example 4
multiple macros
annotation 18
S
N save exclusion state 41
sequences view
Navigating Trend Reports 11 FSM 35
navigation pane 51 -show brief 85
nested expressions 35 -show tests
nested macros line, tgl, fsm 64
annotation 17 Signature of exclusion 123
net and register coverage results 27 Simtime 61
simulating while monitoring for coverage 5
O source code
displaying 26, 37
objects tables 7
-srcmap 63
Older Session URG Links 24
start coverage mode 3
Organization of Trend Charts 11
starting DVE 9, 3
statement coverage
3
difference from line coverage 7 U
statistics table, formatting 7
UCAPI 120
streaming operators 43
uniquetests.txt 14
SVA coverage 39
unknown value 39
unmappable exclusions 60
T unpacked dimensions 42
task definition URG 40
in line coverage 8 annotating exclusion 82
TCL scripts 58 urg –metric 85
ternary expression 31, 37 URG_FAKE_TIME environment variable 10
ternary operator 31 URG_NO_SESSION_XML environment
variable 10
test correlation
macros 19 user-defined coverage groups 22
test run metrics 62
testfile 14 V
tgl argument to the -cm option 4, 47
Viewing Coverage Results 15
The 7
toggle coverage 23
specifying 4, 47 W
Top Level Chart 12 wait statement
-trend option 2 procedural delay is interpreted as 7
while statement
in line coverage 4, 8