Coverpoint bins for fractional values

Hi,

I have a coverpoint cp and I have defined bins like below:

coverpoint cp{
bins b[4]={[1:2]}
}

My intention is to have 4 bins with values {1,1,25} {1.25,1.5} …

But I get following error when I compile:

Number of bins 4 is greater than total number of states (2) in the bin

What’s the best approach to resolve this?

Thank you

You don’t show enough information to reproduce your issue. What is the data type of cp?

Can you post a complete runnable example which reproduces your issue?

For example,

logic[63:0] cp

I want 4 bins between integer 1 and 2, but I guess bins can’t have fractional values. Looking for the best way to resolve this

A variable declared as logic[63:0] can only have integral values (1, 2, 3…). It can’t have a value of 1.5 or 1.25. You can use real variables and declare covergroups as you are describing.

Thanks, I will try this out.