RE: [sv-bc] Referencing $unit identifiers from within a package

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Wed Apr 12 2006 - 11:51:59 PDT
Dave, 

 

I believe that as written, your example is definitely illegal because
foo is an implicit hierarchical reference into $unit. However, a more
interesting question arises if the example were written to use an
explicit import, such as:

 

typedef int foo;

package p;

   import $unit::foo;

   foo A;;

endpackage

 

One of the guiding principles in the design of packages was to make them
independent of any compilation unit, thus, enabling sharing across
compilation units. One hint that this type of import should be illegal
is the LRM statement:

 

Items defined in the compilation-unit scope cannot be accessed by name
from outside the compilation unit.

 

Since in the example, foo is indirectly being exported via the package,
I believe this should be illegal.

 

            Arturo

 

________________________________

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Rich, Dave
Sent: Wednesday, April 12, 2006 10:47 AM
To: sv-bc@eda.org
Subject: [sv-bc] Referencing $unit identifiers from within a package

 

Is the following legal? Should it be legal?

 

file.v

typedef int foo;

package p;

  foo A;;

endpackage

 

I'll hold my opinion so not to taint the response

 

Dave

 

David Rich
Verification Technologist
Design Verification & Test Division
Mentor Graphics Corporation
dave_rich@mentor.com
Office:   408 487-7206
Cell:     510 589-2625

 
Received on Wed Apr 12 11:52:07 2006

This archive was generated by hypermail 2.1.8 : Wed Apr 12 2006 - 11:52:11 PDT