How to use range for real variables in coverage bins?

i want to cover ranges for a real variable like one bin from 0.0 - 1.2, another bin from 1.2 - 2.5, another bin from 2.5 - 3.2 and so on. i get compile error from vcs
Error-[IETICG] Invalid expression type in covergroup.
Expression of type ‘real’ used in left value range is not legal.

for all bins

In reply to shahparth08:

i want to cover ranges for a real variable like one bin from 0.0 - 1.2, another bin from 1.2 - 2.5, another bin from 2.5 - 3.2 and so on. i get compile error from vcs
Error-[IETICG] Invalid expression type in covergroup.
Expression of type ‘real’ used in left value range is not legal.
for all bins

As per the 2017 1800 SV LRM 19.5 section Defining coverage points
“A data type for the coverpoint may be specified explicitly or implicitly in data_type_or_implicit. In either
case, it shall be understood that a data type is specified for the coverpoint. The data type shall be an integral type. If a data type is specified, then a cover_point_identifier shall also be specified.”

While some tools do support covering real data type, is not legal as per the LRM
you could create some fixed point number using the real but you may lose some accuracy due to quantization.

HTH,

-R

In reply to shahparth08:

i want to cover ranges for a real variable like one bin from 0.0 - 1.2, another bin from 1.2 - 2.5, another bin from 2.5 - 3.2 and so on. i get compile error from vcs
Error-[IETICG] Invalid expression type in covergroup.
Expression of type ‘real’ used in left value range is not legal.
for all bins

As real values range is not legal, you can convert it to integer by multiplying with the 10 power (number of fractional digits you’re interested).

In your case it seems you’re interested in single fractional digit, so you can multiply it by 10 and your new range will be: 0-11, 12-24, 25-32 etc (removed overlapping range values).

PS: for readability, you can give bins name like, (bin_name/var_name)_0_11_x_10, (bin_name/var_name)_12_24_x_10 and so on…