Cross coverage with an array

Hello,
I want to make a cross cover of something that supposed to be enabled, with 3 possible events.
So let’s say I have the following cover points:


cp_B : item.flag {
bins B_enable = {EN};
}

cp_events : item.events {
bins cp_event_number[3] = {[3:5};
}

What I want is to have a coverage for B at 3, B at 4, B at 5.

Currently, I tried the following:


cp_BxEvents : cp_B, cp_events {
bins BxEvent = binsof(cp_B.B_enable) && binsof(cp_events.cp_event_number);
ignore_bins ...
}

Which creates only 1 coverpoint and not all 3.
Trying to do one of the following:


bins BxEvent[] = ...
bins BxEvent[3] = ...
bins BxEvent = ... && binsof(cp_events.cp_event_number[]);
bins BxEvent = ... && binsof(cp_events.cp_event_number[3]);

Generates an error.

So, how should I write the cross coverage bins?

Thank you

In reply to Ariel Elliassi:


Use  Select  Expression  when  defining  Cross  bins  ::  

                             binsof( cp_label )  intersect { <values> }  ;
                            !binsof( cp_label )  intersect { <values> }  ;

If you want to ignore cross bins with item.events == 4 and 5


cp_BxEvents: cross cp_B , cp_events 
    {   
      bins  BxEvent3 =  binsof( cp_events ) intersect { 3 }  ;    //   < EN , 3 > 
          
      ignore_bins  igcross =  !binsof( cp_events ) intersect { 3 }  ;   //   < EN , 4 > 
                                                                        //  < EN , 5 >      
    }

(b) If you want user-defined cross bins for item.events == 4 and 5


cp_BxEvents: cross cp_B , cp_events 
    {   
      bins  BxEvent3 =  binsof( cp_events ) intersect { 3 }  ;    //   < EN , 3 > 
          
      bins  BxEvent4 =  binsof( cp_events ) intersect { 4 }  ;   //   < EN , 4 > 
                                                                          
      bins  BxEvent5 =  binsof( cp_events ) intersect { 5 }  ;   //  < EN , 5 >  
    }

In reply to MICRO_91:

Thank you, that’s helpful as well.
I was wondering on a way to do “bins BxEvents” that will generate 3 bins in the same way as this:


bins array[3] = {[3:5]};

Will generate 3 cover points, one for each value, from 1 line.

In reply to Ariel Elliassi:

LRM Syntax 19-4 defines ::


 bins_keyword bin_identifier = select_expression [ iff ( expression )  ]

This means only a Singular bin ( bin_identifier ) can be defined within cross .

Multiple bins ( using [ ] ) , Fixed ( bins array[3] ) are Illegal .

In reply to MICRO_91:

I see, that’s what I suspected.
So basically, there’s no way except for writing 3 separate bins for each events, and making 3 bins inside the cross for each <EN,event_number>.

Thank you

In reply to Ariel Elliassi:

You need not define the 3 cross bins .
On writing ::


cp_BxEvents: cross cp_B , cp_events ; //  Creates 3  cross  bins  automatically 

As coverpoints ’ cp_B ’ and ’ cp_events ’ have 1 bin and 3 bins respectively .

Cross ’ cp_BxEvents ’ has 1 x 3 i.e 3 cross bins