The following coverage methods are provided for the covergroup. These methods can be invoked procedurally at any time.
void sample():
Description : Triggers sampling of the covergroup
real get_coverage()
real get_coverage(ref int, ref int)
Description : Calculates type coverage number (0...100)
The get_coverage() method returns the cumulative (or type) coverage, which considers the contribution of all instances of a particular coverage item. and it is a static method that is available on both types (via the :: operator) and instances (using the "." operator).
The get_coverage() method both accept an optional set of arguments, a pair of int values passed by reference. When the optional arguments are specified, the get_coverage() method assign to the first argument the value of the covered bins, and to the second argument the number of bins for the given coverage item. These two values correspond to the numerator and the denominator used for calculating the particular coverage number (i.e., the return value before scaling by 100).
real get_inst_coverage()
real get_inst_coverage(ref int, ref int)
Description : Calculates the coverage number (0...100)
get_inst_coverage() method returns the coverage of the specific instance on which it is invoked, thus, it can only be invoked via the "." operator.
The get_inst_coverage() method both accept an optional set of arguments, a pair of int values passed by reference. When the optional arguments are specified, the get_inst_coverage() method assign to the first argument the value of the covered bins, and to the second argument the number of bins for the given coverage item. These two values correspond to the numerator and the denominator used for calculating the particular coverage number (i.e., the return value before scaling by 100).
void set_inst_name(string)
Description : Sets the instance name to the given string
void start()
Description : Starts collecting coverage information
void stop()
Description : Stops collecting coverage information