User guide
21-49
OpenVera Native Testbench
Measuring Coverage
VCS computes a coverage number (or percentage) for the testbench
run as a whole. Here, the coverage number is referred to as
“coverage”. The coverage for the testbench is the weighted average
of the coverages of every coverage_group in the testbench. When
per-instance data is available, VCS also computes an instance
coverage for the testbench. That number is the weighted average of
the coverages of every coverage_group instance.
The cov_weight attribute of a coverage_group determines the
contribution of that group to the testbench coverage. The Coverage
Attributes section in the OpenVera LRM: Native Testbench book
describes coverage_group attributes and mechanisms for setting
them.
The coverage for each coverage_group is the weighted sum of that
group’s sample and cross coverage numbers. The cov_weight
attribute of a sample determines the contribution of that sample to
the coverage of the enclosing coverage group. Similarly, the
cov_weight attribute of a cross determines the contribution of that
cross to the coverage of the enclosing coverage group. Both
attributes have a default value of 1. The Coverage Attributes section
in the OpenVera LRM: Native Testbench book describes sample and
cross attributes and mechanisms for setting them.
VCS computes the coverage number for a sample as the number of
bins with the at_least number of hits divided by the total number of
possible bins for the sample (multiplied by 100). When the sample is
auto-binned (that is, there are no user-defined state or transition
bins), the total number of possible bins for the sample is the
minimum of the auto_bin_max attribute for that sample and the
number of possible values for the coverage point.