[sv-bc] FW: [sv-ec] Exlplicit restriction : lvalue as actual arguments for output, inout, ref, const ref ports.

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Apr 03 2008 - 04:36:36 PDT
 

________________________________

From: Bresticker, Shalom 
Sent: Thursday, April 03, 2008 12:45 PM
To: 'danielm'; sv-ec@server.eda.org
Subject: RE: [sv-ec] Exlplicit restriction : lvalue as actual arguments
for output, inout, ref, const ref ports.


Hi,
 
In 1364-2005, 10.2.2 says, "If the argument is declared as an output or
an inout, then the expression shall be restricted to an expression that
is valid on the left-hand side of a procedural assignment (see 9.2)."
 
In Draft 4, 13.5 says, "If the argument in the task or function is
declared as an output or an inout, then the corresponding expression in
the task or function call shall be restricted to an expression that is
valid on the left-hand side of a procedural assignment (see 10.4)."
 
 
Mantis 2235 adds to 13.5.2, 
"Only the following shall be legal to pass by reference: 

				* a variable 

				

				* a member select of a class property or
a member of an unpacked structure 

				

				* a non-slice indexed select of an
unpacked array. 

Nets and selects into nets shall not be passed by reference. "

Maybe we should add "ref" to "output or an input" in 13.5 and reference
13.5.2 for additional restrictions, but otherwise I think this is
covered.

Shalom

________________________________

	From: owner-sv-ec@server.eda.org
[mailto:owner-sv-ec@server.eda.org] On Behalf Of danielm
	Sent: Thursday, April 03, 2008 11:07 AM
	To: sv-ec@server.eda.org
	Subject: [sv-ec] Exlplicit restriction : lvalue as actual
arguments for output, inout, ref, const ref ports.
	
	
	I haven't found explicit restriction that for inout,output, ref,
and const ref t/f port actual argument we may use only lvalue. It is not
so abvious ie C allows to use expression as actual when argument is
const ref:

		int f(const int & a) {
		    return 1;
		}

		int _tmain() {
		    int a,b;
		    f(2);
		    f(a+b);
		}

	Such ifno may be added into 12.2 port direction description, or
as foot note to list of arguments syntax definition (or both):
	IE:
	list_of_arguments ::=

	[ expression ] { , [ expression ] } { , . identifier ( [
expression ] ) }

	| . identifier ( [ expression ] ) { , . identifier ( [
expression ] ) }

	 

	foot note: Only lvalue is allowed as actual argument for output,
inout, ref, const ref t/f port. Expressions are allowed only for input
ports.

	 

	 

	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 Thu Apr 3 04:42:17 2008

This archive was generated by hypermail 2.1.8 : Thu Apr 03 2008 - 04:43:28 PDT