RE: [sv-ec] Confusion over covergroup instantiation inside class

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Oct 30 2008 - 02:48:40 PDT
Hi, 
 
The Draft 7a LRM says,
"A covergroup declaration within a class is an embedded covergroup
declaration. An embedded covergroup declaration declares an anonymous
covergroup type and an instance variable of the anonymous type. The
covergroup_identifier defines the name of the instance variable."

and

"An embedded covergroup variable may only be assigned in the new method.
An embedded coverage group can be explicitly instantiated in the new
method. If it is not, then the coverage group is not created and no data
will be sampled."

So the following would work:
 
module top;
class myclass;
  covergroup my_cg;
  endgroup : my_cg
function new();  my_cg = new; endfunction
endclass
endmodule
 
The footnote you quoted has been deleted.
 
I'm sure others can give you fuller explanations, as I don't understand
this too well yet.
 
Please don't cc: sv-bc on such issues.
 
Shalom


________________________________

	From: owner-sv-ec@server.eda.org
[mailto:owner-sv-ec@server.eda.org] On Behalf Of Surya Pratik Saha
	Sent: Thursday, October 30, 2008 11:28 AM
	To: sv-bc@server.eda.org; sv-ec@server.eda.org
	Subject: [sv-ec] Confusion over covergroup instantiation inside
class
	
	
	Hi,
	In the LRM section "18.3 Using covergroup in classes" it is
mentioned a covergroup can be instantiated explicitly. But the following
case:
	
	module top;
	class myclass;
	  covergroup my_cg;
	  endgroup : my_cg
	  my_cg x = new();
	endclass
	endmodule
	
	is failed by most of the standard simulators. Is there any
reason for that.
	Also in all the examples given in that section, the
instantiation of covergroup without declaring the identifier is used
only inside function new. But in the foot note 15, it is mentioned:
	
	"It shall be legal to omit the covergroup_variable_identifier
from a covergroup instantiation only if this implicit instantiation is
within a class that has no other instantiation of the covergroup."
	
	Does that signify, covergroup can be instantiated outside the
function new too? What about the case:
	module top;
	class myclass;
	  covergroup my_cg;  
	  endgroup : my_cg
	  my_cg  = new(); 
	endclass
	endmodule
	
	which except one, all the standard simulator fail.
	
	-- 
	Regards
	Surya

	-- 
	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 Thu Oct 30 02:52:02 2008

This archive was generated by hypermail 2.1.8 : Thu Oct 30 2008 - 02:52:36 PDT