With clause error

I’m currently using a coverage model, and i want to ignore some bins based on a condition, example :
cp_rd_value: coverpoint instr.rd_value_type {
ignore_bins POS_OFF = {POSITIVE} with (!rd_is_signed);
ignore_bins NEG_OFF = {NEGATIVE} with (!rd_is_signed);
ignore_bins NON_ZERO_OFF = {NON_ZERO} with (rd_is_signed);
}
So i want to ignore the bin,that test if the value of rd is positive if the value of rd isn’t signed and so on for the rest, the problem that i have is a compilation error : “Error-[FCIWCS] Invalid ‘with’ clause specification” i don’t want to use iff because it doesn’t limit the creation of the bins.

In reply to JalaliAyoub:

Your tool has a problem. The are no restrictions on the with expression other than it has to evaluate to a zero or non-zero integral value. You can easily workaround the bug by writing

ignore_bins POS_OFF = {POSITIVE} with (!rd_is_signed || item&0);

However, a better way of selecting a set of values to cover or ignore is putting them in an array

  enum {POSITIVE, NEGATIVE, NON_ZERO, BIG, LITTLE} e, e_set[];
  
  bit rd_is_signed;
  
  covergroup cg;
    coverpoint e{
      ignore_bins bin_set[]  = e_set;
}
  endgroup
    
  cg cg_inst;
  initial begin 
    if (rd_is_signed)
      e_set = {NON_ZERO};
    else
      e_set = {POSITIVE, NEGATIVE};
    cg_inst = new;
  end

In reply to dave_59:

Hi Dave ,

LRM Syntax 19-2 mentions the following for with_covergroup_expression :: The result of this expression shall be assignment compatible with an integral type.

Does this mean that ’ item ’ isn’t necessary to be written within with_clause ?

In reply to MICRO_91:

Correct.