RE: [sv-ec] variable initialization at declaration

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Fri Apr 18 2008 - 02:05:23 PDT
I think Gord asked this once, maybe in a Mantis bug note. I don't think
it was ever resolved.
 
Shalom


________________________________

	From: owner-sv-ec@server.eda.org
[mailto:owner-sv-ec@server.eda.org] On Behalf Of danielm
	Sent: Friday, April 18, 2008 10:47 AM
	To: sv-ec@server.eda.org
	Subject: [sv-ec] variable initialization at declaration
	
	
	LRM:
	" In Verilog, an initialization value specified as part of the
declaration is executed as if the assignment were made from an initial
block, after simulation has started. In SystemVerilog, setting the
initial value of a static variable as part of he variable declaration
(including static class members) shall occur before any initial or
always blocks are started."

	Is initialization really a part of declaration - if so then
newly declared identifier is visble after ';', and in initialization
phase this identifier remains not declared. I mean what should happened
for below code:
	 
	module top;
	    parameter p=123;
	    initial begin : _label
	        int p=p; //this is circular illegal assignment p=p, or
at the moment of initialization p from outer scope is still visible?
	        $display(p);    
	    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 Apr 18 02:09:00 2008

This archive was generated by hypermail 2.1.8 : Fri Apr 18 2008 - 02:09:37 PDT