User guide

21-48
OpenVera Native Testbench
Example 21-1 shows a standalone coverage_group definition and its
instantiation.
Example 21-1 Defining and Instantiating a Standalone Coverage Group
interface ifc
{
input clk CLOCK;
input sig1 PSAMPLE #-1;
}
coverage_group CovGroup
{
sample_event = @ (posedge CLOCK);
sample var1, ifc.sig1;
sample s_exp(var1 + var2);
}
program covTest
{
integer var1, var2;
CovGroup cg = new();
}
In this example, coverage_group CovGroup defines the coverage
model for global variable var1, the signal ifc.sig1, and the
expression composed of global variables var1 and var2. The name
of the sampled expression is s_exp. The two variables and the
expression are sampled upon every positive edge of the system
clock. The coverage_group is instantiated using the new() system
call.
For details on the syntax of both standalone and embedded
coverage_groups and how to instantiate them, see the OpenVera
LRM: Native Testbench book.