Re: [sv-ec] Query Regarding Coverpoints

From: Surya Pratik Saha <spsaha_at_.....>
Date: Tue Jul 17 2007 - 21:15:31 PDT
Hi David,
Then for the e.g. provided by Sandeep, if the hierarchical reference is like "gc.ra", then what it will point to? It is really confusing. LRM has to clarify clearly the name resolution rule for coverpoint variable. Also as per LRM text, the following two snippet are same:

covergroup gc (ref int ra, int low, int high ) @(posedge clk);
coverpoint ra // sample variable passed by reference
{
bins good = { [low : high] };
bins bad[] = default;
}
endgroup


and
covergroup gc (ref int ra, int low, int high ) @(posedge clk);
ra: coverpoint ra // labeled by ra
{
bins good = { [low : high] };
bins bad[] = default;
}
endgroup

Does the later labeled declaration not conflict with 'ref int ra'? What do you think. Different simulators behave differently for that.
Regards
Surya


-------- Original Message  --------
Subject: Re:[sv-ec] Query Regarding Coverpoints
From: David Scott <david_scott@mentor.com>
To: Sandeep Dasgupta <sandeep@cal.interrasystems.com>
Cc: SV-EC <sv-ec@eda-stds.org>
Date: Wednesday, July 18, 2007 3:21:45 AM
Sandeep --

This was clarified in the 2008 version of the specification. The latest 2008 draft is now available for purchase through the IEEE, I believe; if you don't have it, I highly recommend it.

Whether or not you consider that the covergroup has "two different objects of the same name", the rules for visibility have been clarified so that only one type of object is visible in a given context. To quote:

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 18.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.

In other contexts -- which includes at least option assignments within the covergroup, the coverpoint declaration itself, and of course bin declarations (though not in the case of a ref argument like "ra") -- the name could not refer to the coverpoint.

By the way, I have just realized that "binsof" expressions should be added to the list above for coverpoint name visibility.

Anyway, with this rule, it is unambiguous what "ra" means in a given context.

-- Dave Scott, Mentor Graphics


Sandeep Dasgupta wrote:
Hi,

I have the following query regarding coverpoints,

Consider the test case as is given in IEEE Std 1800-2005, section 18.4,
covergroup gc (ref int ra, int low, int high ) @(posedge clk);
coverpoint ra // sample variable passed by reference
{
bins good = { [low : high] };
bins bad[] = default;
}
endgroup

Now as per section 18.4 "Defining coverage points",
A 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. If the label is omitted and the coverage
point is associated with a single variable, then the variable name becomes the name of the coverage point.

So as per the above specification, the coverpoint used in the example above should be labeled with
the name of the single variable associated with the coverpoint, i.e. ra.
Also the covergroup gc contain a variable with the same name, ref int ra.
So is it possible for a scope (in this case a covergroup scope) to have two objects with same name(in this case ra )?
Please give your suggestions.


Thanks and Regards,
Sandeep Dasgupta.













--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. Received on Tue Jul 17 21:16:04 2007

This archive was generated by hypermail 2.1.8 : Tue Jul 17 2007 - 21:16:28 PDT