[sv-bc] proposal for #26

From: Francoise Martinolle <fm@cadence.com>
Date: Tue Nov 30 2004 - 11:53:54 PST

AFTER:

The import statement provides direct visibility of identifiers within
packages. It allows identifiers declared within packages to be visible
within the current scope without a package name qualifier. Two forms of the
import statement are provided: explicit import, and wildcard import.
Explicit import allows control over precisely

which symbols are imported:

import ComplexPkg::Complex;

import ComplexPkg::add;

 

ADD:

An explicit import only imports the symbols referenced by the import.

In the example below, the import of the enumeration type teeth_t does not
import the enumeration literals ORIGINAL

and FALSE. In order to refer to the enumeration literal FALSE from package
q, either add import q::FALSE or

use a full package reference as in teeth = q::FALSE

package p;

typedef enum { FALSE, TRUE } bool_t;

endpackage

package q;

typedef enum { ORIGINAL, FALSE } teeth_t;

endpackage

module tmp2d;

import p::*;

import q::teeth_t; // OK

teeth_t myteeth;

initial begin

myteeth = FALSE; // Direct reference to FALSE refers to the

                                     // FALSE enumeration iteral imported
from p

end

endmodule
Received on Tue Nov 30 11:54:00 2004

This archive was generated by hypermail 2.1.8 : Tue Nov 30 2004 - 11:54:04 PST