Issue using with clause

Hi There,

I have the following coverage code.

class dummy;
  int a;

  covergroup my_cg;
    dummy_cp: coverpoint  {a}{
      bins hit = {1} with ( item > 1);
    }
  endgroup

    function new(); 
        my_cg = new;
    endfunction

    task sample();
        #1;
        a = 1;
        my_cg.sample();
        
        $display(my_cg.get_coverage());
        $finish;
    endtask

endclass

module top;
  
  dummy d;
 
  initial begin
    d = new();
    d.sample();
  end
endmodule


It compiles fine but when simulating I am observing the following warning and I dont see the coverpoint getting created.

# ** Warning: (vsim-8855) The evaluation of coverpoint bin 'hit' 'with' expression resulted in an empty value range list.
#    Time: 0 ns  Iteration: 0  Process: /top/#INITIAL#30 File: testbench.sv Line: 6
# ** Warning: (vsim-8858) After processing coverbin with/set expression, the values list associated with scalar bin 'hit' in Coverpoint 'dummy_cp' of Covergroup instance '\/testbench_sv_unit::dummy::my_cg ' has converged to empty list. The bin will be taken out of coverage calculation.
#    Time: 0 ns  Iteration: 0  Instance: /top
# ** Warning: (vsim-8522) The number of coverpoint bins is zero for the coverpoint 'dummy_cp' of covergroup instance '\/testbench_sv_unit::dummy::my_cg '. All the user defined bins in the coverpoint are empty bins and hence it would not contribute towards the overall coverage result.
#    Time: 0 ns  Iteration: 0  Instance: /top

Wanted to know whats wrong with item > 1

In reply to KumarSunilB:

The issue is with value 1 i.e { 1 } . It can be Never Greater than 1 .So ( item > 1 ) will ALWAYS be false

Try ::


covergroup my_cg;
    dummy_cp: coverpoint a
    {
      bins hit = { [0:100] } with ( item > 1); 
    }
  endgroup