RE: [sv-ec] Query on bin value

From: Rich, Dave <Dave_Rich@mentor.com>
Date: Fri Jul 23 2010 - 09:17:20 PDT

Swapnajit,

 

First, a variable declared as "const" cannot be used in the context of a
constant expression. It is a write-once variable.

Second, an instance constant is only valid in the context of an embedded
covergroup within a class.

Third, myt.xx is a field select, not a hierarchical reference. If you
were to change "const" to "parameter", it would be legal.

Finally, the reason for the LRM restriction is discussed but not
resolved in http://www.eda.org/mantis/view.php?id=1802

 

Dave

 

 

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Swapnajit Chakraborti
Sent: Friday, July 23, 2010 4:37 AM
To: sv-ec@eda.org
Subject: [sv-ec] Query on bin value

 

I have query regarding use of hierarchical names as bin value of a
coverpoint.

 

The LRM says the following:

"The open_range_list used to specify the set of values associated with a
bin shall

be constant expressions (see 11.2.1), instance constants (for classes
only), or non-ref arguments to the coverage

group."

 

Now, if I have something like below, should "myt.xx" be treated as
instance constant/constant expression

and thus allowed in bin value expression. Or will it be considered as
hierarchical expression and hence should be treated as illegal.

 

module test;

   typedef struct { int xx; } my_t;

   class item_c;

      const my_t myt = '{xx:6};

      covergroup data_cg;

          DATA: coverpoint data{

                 bins chid[] = {[0:myt.xx]}; // This is a member of a
const struct. Should this be allowed as instance const or const
expression or illegal?

          }

      endgroup : data_cg

      ...

   endclass : item_c

....

endmodule : test

 

Regds,

Swapnajit

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is
believed to be clean. 
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Jul 23 09:17:42 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 23 2010 - 09:17:44 PDT