Doubt regarding bins

Hi all ,

Consider the following snippet ::


covergroup cg;
rw_cp: coverpoint t.rw ; 

addr_cp: coverpoint t.addr 
{
  bins regular[] = { [0:99] }; //  creates  100  bins
  ignore_bins ignore_addr = { [100:$] };
}
endgroup

[Q1] What is the term used to call regular[] ? Is dynamic bins the correct term

[Q2] bins regular[] = { 0:99]} ; makes 100 bins .
This seems unrelated to auto_bin_max which has default value of 64 .

  Using  the  above  syntax  (  i.e  bin  name[] )  is  there  a  limit  on  the  Max  Number  of  bins  created ? 
  Can  user  control  it  using  any  **option**  or  **type_option** ?

[Q3] Does the LRM dictate how the indexes would be named ? Would it always be start from 0 ? OR does the value on the right decide the starting index .

[Q4] If I were to write alternate ways using with clause ::


//  ALTERNATIVE 1
covergroup cg;
rw_cp: coverpoint t.rw ; 

addr_cp: coverpoint t.addr 
{
  bins regular[] = { [0:$] } with ( item inside { [0:99] } ) ;  //  Works 
}
endgroup

//  ALTERNATIVE 2
covergroup cg;
rw_cp: coverpoint t.rw ; 

addr_cp: coverpoint t.addr 
{
  bins regular[] = { [$:$] } with ( item inside { [0:99] } ) ;  //  Works 
}
endgroup

//  ALTERNATIVE 3
covergroup cg;
rw_cp: coverpoint t.rw ; 

addr_cp: coverpoint t.addr 
{
  bins regular[] = t.addr with ( item inside { [0:99] } ) ;  //  Doesn't  Work  Why ??
}
endgroup
     
 **Any  suggestions  why  Aternative3  throws  an  error  ?** 

[Q5] Should user ensure that range is ALWAYS low to high ? What if user were to write it reverse

 
i.e   bins regular[] = { [0:$] } with ( item inside { [99:0] } ) ; //  Valid ??
 

In reply to hisingh:

  1. There no special name, but you could call it a dynamic array of bins since it uses the same declaration syntax as a dynamic array variable.
  2. There no limit on the number of bins created by . But typically when there are many more values than you want bins created, you would use [64] as the maximin of 64.
  3. The LRM does not prescribe a naming convention for indexes, it could get very complicated.
  4. Use the coverpoint label addr_cp instead of t.addr
  5. The LRM prescribes ranges [low:high]. This helps catch errors in calculated ranges.

In reply to dave_59:

Thanks Dave ,

Regarding (3) across Simulators I observe , the RHS decides the indexes ( although the bin name varies ). Eg ::
(1) On Simulator1 :: regular**[0]** to regular**[99]**
(1) On Simulator2 :: regular_0 to regular_63 // Hex Indexes

If I were to write :: bins regular[] = { [10:99] };

The bins are named :: regular**[10]** to regular**[99]** N regular_a to regular_63 .