|
事件覆盖:
program test;
bit [0:3] y;
bit [0:2] values[$]= '{3,4,5,6};
covergroup cg0;
cover_point_y : coverpoint y {
bins tran_34 = (3=>4);
bins tran_35 = (3=>5);
bins tran_56 = (5=>6);
}
endgroup
cg0 cg_inst = new();
initial
foreach(values[i])
begin
y = values[i];
cg_inst.sample();
$display("\n 001 -_- Now coverage is %00d",cg_inst.get_coverage());
end
endprogram
# 001 -_- Now coverage is 0
#
# 001 -_- Now coverage is 33
#
# 001 -_- Now coverage is 33
#
# 001 -_- Now coverage is 67
COVERGROUP COVERAGE:
------------------------------------------------------------------------------------
Covergroup Metric Goal/ Status
At Least
------------------------------------------------------------------------------------
TYPE /test/cg0 66.6% 100 Uncovered
Coverpoint cg0::cover_point_y 66.6% 100 Uncovered
bin tran_34 1 1 Covered
bin tran_35 0 1 ZERO
bin tran_56 1 1 Covered
TOTAL COVERGROUP COVERAGE: 66.6% COVERGROUP TYPES: 1