RE: [sv-ec] Declaration order - vs - initialization order

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Fri Jul 18 2008 - 01:10:55 PDT
The order is undefined.
 
Shalom


________________________________

	From: owner-sv-ec@server.eda.org
[mailto:owner-sv-ec@server.eda.org] On Behalf Of Daniel Mlynek
	Sent: Friday, July 18, 2008 11:00 AM
	To: 'SV-EC'
	Cc: 'Piotr Winter'
	Subject: [sv-ec] Declaration order - vs - initialization order
	
	
	I cannot find any stmt in LRM saying that the initialization
order should be the same as declaration order - should it be
implementation dependend, or this just similar to race condition and the
order is undefined by purpose? SV allows static varialbe to be
initialized with nonconstants - so this became an issue.
	Consider the example:
	 
	class C;   
	 int p;
	    function integer random4val;
	        return p;
	    endfunction
	endclass
	 
	module top;
	    C c = new;
	    
	    integer nc8 = c.random4val();//if initialization order
should be the sam as delcaration order - then ok, but if it is undefined
then null pointer exeption may occur. What about case when change the
order of c and nc8 declaration?
	        
	    initial begin       
	        $display("%0b", nc8);
	    end
	    
	endmodule
	 
	 
	DANiel

	-- 
	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 Fri Jul 18 01:11:47 2008

This archive was generated by hypermail 2.1.8 : Fri Jul 18 2008 - 01:11:57 PDT