[sv-bc] Re: Discussion overview of SV name resolution

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Mon Jun 05 2006 - 22:33:49 PDT
-----Non-member submission-----
Date: Mon, 5 Jun 2006 18:07:31 -0700
From: "Ryan, Ray" <Ray_Ryan@mentor.com>

Steven, Gord, 

Currently there exists a dual set of syntax rules (and implied
semantics) for method calls vs function calls.

	subroutine_call :== tf_call
                          ...
				  | method_call

	tf_call ::= ps_or_hierarchical_tf_identifer ...

	method_call :== method_call_root  .  method_call_body
	method_call_root :== expression | implicit_class_handle

So currently a method call can look like a dotted name, except that
the left side of the '.' can be an expression ( which could be a 
function call). So if "process::self().srandom(100)" is parsed as
a method call, it may be legal (?).  However, if it is parsed as a 
tf_call, then it is not legal.

This should be cleaned up along with the other SV name resolution. 
It is inconsistend to have different resolution for method names vs
property names. [IE allow  "a.b().func", but not allow "a.b().prop".]

Ray

> -----Original Message-----
> From: Steven Sharp [mailto:sharp@cadence.com] 
> Sent: Monday, June 05, 2006 3:08 PM
> To: Vreugdenhil, Gordon; sv-ec@verilog.org; 
> sv-bc@verilog.org; Ryan, Ray
> Subject: RE: [sv-ec] Discussion overview of SV name resolution
> 
> My response got garbled also.  Here is a retry:
> 
> 
> >From: "Ryan, Ray" <Ray_Ryan@mentor.com>
> 
> > Gord,
> >Are function calls allowed in a dotted name ?
> >For example (from mantis #1391) in 13.13.2 the example contains:
> >	process::self.srandom(100);
> >where 'self' is a function that returns a class handle.
> 
> I believe that example is illegal on several counts.
> 
> First, self.srandom does not mean a call to the function 
> self, followed by a member select of the return value.  It 
> means a hierarchical reference into the scope of the function 
> body of self, looking for a name srandom defined inside that 
> scope.  Since there is no such name in that scope, this would 
> be an error.
> 
> You could presumably change the reference to self from a 
> reference to the scope self into a call of the function self 
> by adding an argument list, as in
>   process::self().srandom(100);
> 
> But then you still run into the problem that a dot is not 
> considered an operator that can be applied to the result of 
> an arbitrary expression, such as a function call.  It is 
> considered part of a "name".  The prefix of the dot is quite 
> restricted.
> 
> I believe you would have to break that statement into two 
> parts, assigning the result of self() to a class object, and 
> then invoking srandom on that.
> 
> (Note that this is another flaw in Brad's argument for 
> allowing the empty parentheses to be left off of method 
> function calls.  This is another visible difference between 
> the behavior of a member defined as a class method versus a 
> class property.  The "Uniform Access Principle" is already
> invalidated.)
> 
> Steven Sharp
> sharp@cadence.com
> 
> 
Received on Mon Jun 5 22:33:24 2006

This archive was generated by hypermail 2.1.8 : Mon Jun 05 2006 - 22:33:41 PDT