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


Subject: Re: [sv-bc] import p::*
From: Arturo Salz (Arturo.Salz@synopsys.com)
Date: Thu Jan 29 2004 - 11:28:19 PST


Francoise,

The interpretation of the person in your group is not semantically incorrect. This is kind of Heisenberg's uncertainty principle. If everything in the package is imported (except for those identifiers explicitly imported or declared) then a simple reference to any identifier from the package will work (i.e., the identifier is imported). If, however, an identifier is not referenced in the importing scope then it is irrelevant whether the identifier is actually imported or not. Basically, the effect of an identifier not being imported is not visible.
I do agree with you that the original intent may be better captured by the following change:

A wildcard import makes each identifier within the package a candidate for import. Each such identifier is imported only when it is referenced in the importing scope 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.

    Arturo

----- Original Message -----
From: Francoise Martinolle
To: sv-bc@eda.org
Sent: Thursday, January 29, 2004 9:27 AM
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 - 11:31:10 PST