Alternative to ' item ' within with_covergroup_expression

The word ’ item ’ is used in Array Manipulation Methods and with clause of user-defined bins within coverpoint .

LRM Section 7.12 says

" The iterator_argument optionally specifies the name of the variable used by the with expression . If it is not specified, the name item is used by default. "

It does provide an alternative to item via optional iterator_argument written before with

LRM Section 19.5.1.1 says "In the expression, the name item shall be used to represent the candidate value. "

I tried using label instead of item ::


module  top ;
   
   bit [7:0]  a ;   

   covergroup  exp ;
   
      a_cp : coverpoint a
      {   
         bins mod3[]  =  a_cp  with (  a_cp  % 3 == 0 ) ;  //  ' label '  used  instead  of  ' item  '  !!  
      }    
    
   endgroup
   
   exp  inst1 = new() ;


However I observe Compilation Error with the Code .

[Q1] Does the LRM provide an alternative to ’ item ’ within with_clause ?

  LRM  Section  19.6.1.2  which  discusses  **matches**  has  an  example  where  

     X: cross a,b
     {
      bins apple = X with (a+b < 257) matches 127;
      bins cherry = ( binsof(b) intersect {[0:50]} && binsof(a.low) intersect {[0:50]}) with (a==b) );
      bins plum = binsof(b.two) with (b > 12) || binsof(a.low) with (a & b & mask); 
     }
    
 With  bins  ' plum '  label  ' b '  is  used  instead  of  ' item ' 

[Q2] LRM Section 19.5.1.1 has 2 examples ::


      a: coverpoint x
      {
        bins mod3[] = {[0:255]} with (item % 3 == 0);
      }
     
      coverpoint b
     {
       bins func[] = b with (myfunc(item)); 
     }
     
Both  of  the  code  have  item  within  with_clause
**When  writing  with_clause  for  coverpoint , is  it  necessary  to  write  ' item '  within  it ?**

In reply to MICRO_91:

A1: No, SystemVerilog does not provide an alternative syntax for another item label,

A2: The with clause of a cross bin is much more complex, there are multiple implicit iterators. I have never seen anyone use this feature.

At the risk of injecting more complexity, I would like to re-ask MICRO_91’s Q2 in a slightly different way. We have the following covergroup:

covergroup cg_obi(string name,
                  bit write_enabled,
                  bit read_enabled,
                  bit is_1p2)
   with function sample(uvma_obi_memory_mon_trn_c trn);

   option.per_instance = 1;
   option.name         = name;

   we: coverpoint (trn.access_type) {
      ignore_bins IGN_WRITE = {UVMA_OBI_MEMORY_ACCESS_WRITE} with (!write_enabled);
      ignore_bins IGN_READ =  {UVMA_OBI_MEMORY_ACCESS_READ} with (!read_enabled);
      bins WRITE = {UVMA_OBI_MEMORY_ACCESS_WRITE};
      bins READ = {UVMA_OBI_MEMORY_ACCESS_READ};
   }

   // snip...

endgroup : cg_obi

There is a question within our shop as you whether the “with” statement is being used properly. Our question is the same as MICRO_91: When writing with_clause for coverpoint , is it necessary to write ’ item ’ within it?

In reply to MikeOpenHWGroup:

In a separate thread Dave did confirm the keyword ’ item ’ isn’t required as such as per LRM .

However one tool expects it within the with_clause .
Dave’s workaround from the link helps to bypass the tool restriction .

In reply to MICRO_91:

Thanks for the link MICRO_91!