RE: [sv-ec] Query on bin value

From: Rich, Dave <Dave_Rich@mentor.com>
Date: Wed Aug 04 2010 - 08:56:47 PDT

Swapnajit,

 

I was stating what the current LRM says. You have to understand that to
know how to change it to what you think it should say.

 

Today, it makes an exception to the restriction to allow 'const' bin
values within embedded covergroups. I agree the restriction no longer
makes sense.

 

x_obj.a is dotted name that is a member select, not a hierarchical
reference. See section 23.7. In any case 'a' is not a const variable. I
don't think it's worth arguing what constitutes a 'const' for the sake
of a bin value. I would rather argue removing the restriction and say
the bin value at the time of the construction is what is used.

 

Dave

 

 

 

 

From: Swapnajit Chakraborti [mailto:swapnaj@cadence.com]
Sent: Wednesday, August 04, 2010 6:43 AM
To: Rich, Dave; sv-ec@eda.org
Subject: RE: [sv-ec] Query on bin value

 

Hi Dave,

 

Please let me know what is your thought on this.

 

Regds,

Swapnajit

         

________________________________

        From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf
Of Swapnajit Chakraborti
        Sent: Thursday, July 29, 2010 3:46 PM
        To: Rich, Dave; sv-ec@eda.org
        Subject: RE: [sv-ec] Query on bin value

        Hi Dave,

         

        Thanks for your response. Basic intent of this query was to
figure out if "const" ness of an object propogates

        down or not. For example, if I declare something like below,
will x_obj.a be treated as instance const although this

        is hierarchical expression and then treated legal as bin value.

        class x;

            int a;

        endclass

        x myobj = new;

        class y;

           const x x_obj = myobj;

           covergroup cg @

               coverpoint v {

                    bins b1 = {x_obj.a}; // Is this a instance const
just because x_obj is a const member of class?

               }

           endgroup

        endclass

        I also refered to mantis 1802. But the logic provided there
doesn't hold anymore. The reason is that we already

        introduced "merge_instances" type_option to take care of merging
different coevrage spaces across multiple covergroup

        instances. Please let me know if I am missing something here.

         

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

        So, do you mean the member select expression is illegal as long
as we keep it "const"?

        If you notice, I am trying to figure out if a dot-separated name
(be it member select or hierarchical reference) can be considered

        an instance const in case the top-level element of the name is
declared "const" within a class.

         

        Regds,

        Swapnajit

________________________________

                From: Rich, Dave [mailto:Dave_Rich@mentor.com]
                Sent: Friday, July 23, 2010 9:47 PM
                To: Swapnajit Chakraborti; sv-ec@eda.org
                Subject: RE: [sv-ec] Query on bin value

                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 <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 Wed Aug 4 08:57:14 2010

This archive was generated by hypermail 2.1.8 : Wed Aug 04 2010 - 08:57:20 PDT