FW: [sv-bc] proposal for #26

From: Francoise Martinolle <fm@cadence.com>
Date: Tue Nov 30 2004 - 12:09:05 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 specifically 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 top1 ;

import p::*;

import q::teeth_t;

teeth_t myteeth;

initial begin

  

  myteeth = q:: FALSE; // OK:

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

                                     // FALSE enumeration literal imported
from p

end

endmodule

 

module top2 ;

import p::*;

import q::teeth_t, q::ORIGINAL, q::FALSE;

teeth_t myteeth;

initial begin

  

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

                                     // FALSE enumeration literal imported
from q

end

endmodule

 
Received on Tue Nov 30 12:09:13 2004

This archive was generated by hypermail 2.1.8 : Tue Nov 30 2004 - 12:09:20 PST