Re: [sv-bc] Functions called from packages

From: Steven Sharp <sharp_at_.....>
Date: Thu Apr 13 2006 - 17:44:47 PDT
>When a function is called from a package, but the function is not
>declared in the scope of the package, is the function definition
>searched for in the instance where the package is imported, and so on up
>the instantiation hierarchy?

No.  Importing a package into an instance does not mean the package
is inside the instance.  It just means the symbols of the package
are available inside the instance.  The package is still at the
top level of the instantiation hierarchy and there is nothing above
it (except $unit, but that was Arturo's question).

Another way of seeing this is to realize that the function definition
called by any instance of a function call will be resolved statically.
It is possible for a function call in two different instances of the
same module to be resolved differently, based on the position of the
two instances in the hierarchy.  But there is only one instance of a
package, so a function call in a package can only be resolved one way.

Steven Sharp
sharp@cadence.com
Received on Thu Apr 13 17:44:51 2006

This archive was generated by hypermail 2.1.8 : Thu Apr 13 2006 - 17:44:58 PDT