RE: [sv-bc] Functions called from packages

From: francoise martinolle <fm_at_.....>
Date: Thu Apr 13 2006 - 18:59:44 PDT
 

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Steven
Sharp
Sent: Thursday, April 13, 2006 8:45 PM
To: sv-bc@eda.org; Brad.Pierce@synopsys.com
Subject: Re: [sv-bc] Functions called from packages


>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).



>>> The package could import other packages. So the function definition
could be found in the imported
>>> packages or in $unit.


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 18:59:48 2006

This archive was generated by hypermail 2.1.8 : Thu Apr 13 2006 - 18:59:57 PDT