Cross coverage with ignore bin

Hi,
I have cover point as given below.

covergroup cg1 ;
 cA: coverpoint myenumA  {
   bins a_bin[] = {[1:2]};
 } 
 cB: coverpoint myenumB {
  bins b1 = {[1:33]};
  bins b2 = {[34:50]};
 } 
 cC: coverpoint myenumC {
 bins c1 = {[1:33]};
  bins c2 = {[34:50]};
 }  

 cD: coverpoint myenumD {
 bins d1 = {[1:33]};
  bins d2 = {[34:50]};
 }  
endgroup

I want to get cross coverage of cA,cB ,cC and cD for bin a_bin value 1 or 2 i.e cross of a_bin[1]/a_bin[2] x cB x cC x cD . and ignore cross of bins b1 of cB with bins c2 of cC
How to do it?
please help.

You can use the intersect operator:


cross cA, cB, cC, cD {
  ignore_bins my_ignore = binsof(cA) intersect {1, 2} &&
    binsof(cB) intersect { cB.b1 } && binsof(cC) intersect { cC.c1 };
}

I’m not sure if instead of intersect { 1, 2 } you could say intersect { cA.a_bin }, so you’re just going to have to try it out. Would be nice of you to post the conclusion, too.

More info in section 19.6.1 Defining cross coverage bins of the SV-2012 LRM.

In reply to Tudor Timi:

Hi Todor,
Thanks for the help.
When I am using binsof(cB) intersect { cB.b1 } , I am getting hierarchical name component lookup failed at cB.

In reply to sidharth.sankar77:

This is a limitation of your simulator then, since the code I posted is based on the example from the LRM. You can just get away with copying the ranges for b1 and so on in the cross definition. I know it’s not nice since you have the same thing defined in two places, but it’s the only thing you can do until your simulation vendor implements the full SV standard.

In reply to Tudor Timi:

sidharth.sankar77,

Can you post a complete short example to see if you’ve made any mistakes. Also, I do not think the first term “binsof(cA) intersect {1, 2} &&” because that would be true for any bin tuple.

In reply to dave_59:

I can figure out only first part, for which information is complete.

cross cA, cB, cC, cD {
  // Your requirement is (a_bin[0] or a_bin[1]) x cB x cC x cD.
  // i.e either a_bin[0] x cB x cC x cD 
  //         or a_bin[1] x cB x cC x cD should be considered. 
  //         
  // So, it seems me there must a condition (Decoding) for it. 
  // This conditions should be passed while creating this cg.
  ignore_bins my_ignore = { (<condition>) ?  binsof(cA) intersect {0} : binsof(cA) intersect {1} }; 
}

In reply to sidharth.sankar77:

This approach will work.

cross cA, cB, cC, cD {
ignore_bins my_ignore = binsof(cA) intersect {1, 2} && binsof(cB.b1) && binsof(cC.c1);
}