How to use range for real variables in coverage 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