RE: [sv-bc] import p::*


Subject: RE: [sv-bc] import p::*
From: David W. Smith (dwsmith@synopsys.com)
Date: Thu Jan 29 2004 - 10:11:12 PST


Hi Francoise,

The wildcard import makes each identifier within a package a candidate for import. It is only imported if it is referenced and not
already declared or imported into the scope. A suggested change is:

 

A wildcard import makes each identifier within the package a candidate for import. Each such identifier is imported only when it is
referenced and it is neither declared nor explicitly imported into the scope. Similarly, a wildcard import of an identifier is
overridden by a subsequent declaration of the same identifier in the same scope. If the same identifier is wildcard imported into a
scope from two different packages, the identifier shall be undefined within that scope and result in an error if the identifier is
used.

 

By the way, the paragraph under Table 8.1 says:

 

When using a wildcard import, a reference to an undefined identifier that is declared within the package causes that identifier to
be imported into the local scope. However, an error results if the same identifier is laterdeclared or explicitly imported. This is
shown in the following example:

 

This implies the same thing.

 

Regards

David

 

 

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Francoise Martinolle
Sent: Thursday, January 29, 2004 9:28 AM
To: sv-bc@eda.org
Subject: [sv-bc] import p::*

 

The LRM is not clear on the semantics of the p::*.
Somebody from my group read the LRM and from his reading he implied that the p::*
will import everything in the package except if there is already a explicit declaration
of the same name.
The LRM extract is:
Copyright 2003 Accellera. All rights reserved.269
A wildcard import makes each identifier within the package a candidate for import. Each such identifier is imported only when it is
neither declared nor explicitly imported into the scope. Similarly, a wildcard import of an identifier is overridden by a subsequent
declaration of the same identifier in the same scope.

I though that the interpretation (also suggested by the example below the table where it is said that it "forces the import") was
that the package declaration items are candidate for import,
and are only imported if there is a simple reference to that declaration item. This was my understanding of what was intended.

for example:
import p::*;
module top;
// nothing from package p is imported
endmodule

import p::*
module top;
reg r = p::c; // nothing from package p is imported, p::c is a hierarchical reference
endmodule

import p::*;
module top
reg r = c; // c and only c from package p is imported.
endmodule

can you please let me know which interpretation is correct and fix the wording if necessary.



This archive was generated by hypermail 2b28 : Thu Jan 29 2004 - 10:21:03 PST