Re: [sv-ec] [SV-ec] Mantis 3763: Any reason why formal argument name cannot be of same name as covergroup label?

From: Ben Cohen <hdlcohen@gmail.com>
Date: Tue Dec 11 2012 - 09:42:36 PST
I added the following note to: http://www.eda-stds.org/svdb/view.php?id=3763

*19.5 states the following, “A coverpoint coverage point creates a
hierarchical scope and can be optionally labeled. If the label is
specified, then it designates the name of the coverage point. This name can
be used to add this coverage point to a cross coverage specification or to
access the methods of the coverage point”.

It is not clear if that label is part of the new scope, especially because
later states in 19.5,
“A coverpoint name has limited visibility. An identifier can only refer to
a coverpoint in the following contexts:
— In the coverpoint list of a cross declaration (see 19.6),
— In a hierarchical name where the prefix specifies the name of a
covergroup variable. For example,  cov1.cp.option.weight where cov1 is the
name of a covergroup variable and cp is the name of a coverpoint declared
within the covergroup.
— Following ::, where the left operand of the scope resolution operator
refers to a covergroup. For example, covtype :: cp :: type_option.weight”.

If the coverpoint name is not visible, it can take on a different meaning.
That’s probably not the intent, but could be interpreted that way.
Recommendation:
CHANGE FROM:
A coverpoint name has limited visibility.

TO:
A coverpoint limits the places where it can be referenced.  *

On Mon, Dec 10, 2012 at 6:03 AM, Bresticker, Shalom <
shalom.bresticker@intel.com> wrote:

>  An identifier should have a single meaning within a particular scope.****
>
> Its meaning should not be context-sensitive.****
>
> ** **
>
> Shalom****
>
> ** **
>
> *From:* owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] *On Behalf Of *Ben
> Cohen
> *Sent:* Monday, December 10, 2012 05:05
> *To:* sv-ec@eda.org; sv-ac@eda-stds.org
> *Subject:* [sv-ec] [SV-ec] Mantis 3763: Any reason why formal argument
> name cannot be of same name as covergroup label?****
>
> ** **
>
> http://www.eda-stds.org/svdb/view.php?id=3763****
>
> Aside from style, why are we putting the restriction? ****
>
> Is there a restriction? ****
>
> If a simulator accepts the example originally shown (see below) would that
> be an error? ****
>
> It seems that a compiler should be able to differentiate between a formal
> argument name and a label. ****
>
> ** **
>
> covergroup cg ( ref int x , ref int y, *input int c*);****
>
> coverpoint x; // creates coverpoint "x" covering the formal "x"****
>
> x: coverpoint x; // INVALID: coverpoint label "x" already exists****
>
> b: coverpoint y; // creates coverpoint "b" covering the formal "y"****
>
> *c*: coverpoint x; // creates coverpoint "c" covering the formal "x"****
>
> option.weight = c; // set weight of "cg" to value of formal "c"****
>
> ** **
>
> BTW, I am the one who initiated the mantis, but now, after a revisit of
> some issues, I am questioning its validity. ****
>
> I am sure that the mantis was challenged and approved for a good reason. *
> ***
>
> ** **
>
> Ben Cohen ****
>
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean. ****
>
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Dec 11 09:43:56 2012

This archive was generated by hypermail 2.1.8 : Tue Dec 11 2012 - 09:44:08 PST