Hi all ,
I have a few question regarding default bins for following 4 scenarios ::
(A) Coverage Calculation for coverpoint with only default bins
bit [1:0] a ;
covergroup cg ;
ac: coverpoint a
{
bins other = default ; // ONLY default bins
}
endgroup
cg cg1 = new() ;
[Q1] Since default bins don’t contribute to coverage , will instance cg1 have 100% coverage always ?
(B) cross bins with coverpoint a
bit [1:0] a , b ;
covergroup cg ;
ac: coverpoint a
{
bins other = default ; // ONLY default bins
}
X : cross a , b ; // SystemVerilog would generate 4 Automatic bins for b
endgroup
cg cg2 = new() ;
[Q2] Since default bins are excluded from Cross coverage , what will be the total bins generated for Cross X ?
**What's the criteria for 100% cross coverage ?**
(C) Dynamic bins for default bins
bit [1:0] a ;
covergroup cg ;
ac:coverpoint a
{
bins bb = { [0:1] } ;
bins other[] = default ; // How many Dynamic bins created ?
}
endgroup
cg cg3 = new() ;
initial begin
#1 ; a = 1 ; cg3.sample() ;
end
[Q3] Shouldn’t 2 dynamic bins be generated for bins ’ other ’ covering values 2 and 3 ?
I observe 100% coverage for instance cg3 as bin **bb** is hit .
(D) default bins within cross coverage
bit [1:0] i,j;
covergroup ct;
coverpoint i { bins i[] = { [0:3] }; }
coverpoint j { bins j[] = { [0:3] }; }
xx: cross i,j
{
wildcard bins even = binsof(i) intersect { 2'b?0 } && binsof(j) intersect { 2'b?0 } ;
wildcard bins odd = binsof(i) intersect { 2'b?1 } && binsof(j) intersect { 2'b?1 } ;
// Want ALL other cross products to be Ignored
bins other = default ; // Legal ??
}
endgroup
[Q4] Are default bins and wildcard bins within cross coverage legal ?