RE: [sv-bc] Scope resolution operator and import::*

From: Francoise Martinolle <fm_at_.....>
Date: Mon Jul 24 2006 - 13:06:54 PDT
It is dependent on when full qualified package ref names are resolved,
in your case, before or after the compilation scope
gets searched.
 
Francoise
       '
 


________________________________

	From: owner-sv-bc@eda-stds.org [mailto:owner-sv-bc@eda-stds.org]
On Behalf Of Brad Pierce
	Sent: Monday, July 24, 2006 3:52 PM
	To: sv-bc@eda-stds.org
	Subject: Re: [sv-bc] Scope resolution operator and import::*
	
	

	Also, how about the following example, related to
http://www.eda-stds.org/svdb/bug_view_page.php?bug_id=0001214  

	     

	   class Z;

	     static function F(i); return i; endfunction:F

	   endclass:Z

	   

	   package Z;

	     function F(i); return ~i; endfunction:F

	   endpackage:Z

	 

	   interface IFC(output o, input i);

	     assign o = Z::F(i);

	   endinterface:IFC

	 

	-- Brad

	 

	 

	
________________________________


	From: Francoise Martinolle [mailto:fm@cadence.com] 
	Sent: Monday, July 24, 2006 6:53 AM
	To: Brad Pierce; sv-bc@eda-stds.org
	Subject: RE: [sv-bc] Scope resolution operator and import::*

	 

	It may not be stated explicitly in the LRM if we searched first
in the current scope of if we first should interpret a "name:: "as a
full qualified

	package reference. I think that since both class scopes and
package scopes can be followed by ::. we cannot assume that

	a name followed by a :: is going to be a fully qualified package
reference. 

	My interpretation is that :

	Z::F(i) is searched first in the scope where it appears: the
interface IFC scope. 

	In that scope, since there are no local symbols declared or
explicit package imports for Z, it searches

	 the list of the packages that are wild card imported and it
will find the package A which contains a class called Z 

	which contains a static function called F. The name resolution
succeeds at that point. If there were no matching symbol for Z at that

	scope, I think that it should try to resolve the name as a full
qualified package reference before going up the scopes and repeating the
search.

	 

	The order in which to resolve full qualified package references
or class scope is not explicitly stated in the LRM.

	 

	 

	Francoise

	       '

		
________________________________


		From: owner-sv-bc@eda-stds.org
[mailto:owner-sv-bc@eda-stds.org] On Behalf Of Brad Pierce
		Sent: Sunday, July 23, 2006 3:36 AM
		To: sv-bc@eda-stds.org
		Subject: [sv-bc] Scope resolution operator and import::*

		Following up on

		 

	
http://www.eda-stds.org/svdb/bug_view_page.php?bug_id=0001216

	
http://www.eda-stds.org/svdb/bug_view_page.php?bug_id=0001546

		 

		Which function does the assignment

		 

		    assign o = Z::F(i);

		 

		use in the following?

		     

		   package A;

		     class Z;

		       static function F(i); return i; endfunction:F

		     endclass:Z

		   endpackage:A

		 

		   package Z;

		     function F(i); return ~i; endfunction:F

		   endpackage:Z

		 

		   interface IFC(output o, input i);

		     import A::*;

		     assign o = Z::F(i);

		   endinterface:IFC

		 

		-- Brad

		 

		 

		 
Received on Mon Jul 24 13:07:10 2006

This archive was generated by hypermail 2.1.8 : Mon Jul 24 2006 - 13:07:55 PDT