[sv-bc] Clarification: import and visibility of imported symbols

From: Francoise Martinolle <fm@cadence.com>
Date: Fri Jul 23 2004 - 10:37:00 PDT

Should the following examples compile without any error?
This seeks clarification on when a symbol coming from a import * is
imported into the scope.
import * makes symbols potentially visible, the question is when does a
compiler make them
visible?

package globals;
typedef logic mylogic;
endpackage

module top;
import globals::*;

logic mylogic; // attempt to declare a variable named mylogic of type logic
                      // I think that should be allowed as globals::mylogic
is only imported if used
                      // in this particular case, the type is not imported
as we are trying to declare
                      // a variable
endmodule

What about if have :
module top;
import globals::*;

logic mylogic; // attempt to declare a variable named mylogic of type logic
                      // now I have declared a symbol mylogic in my scope
hash table

mylogic var; // attempt to declare a variable var of type mylogic
                   // is this legal?

endmodule
Received on Fri Jul 23 10:37:04 2004

This archive was generated by hypermail 2.1.8 : Fri Jul 23 2004 - 10:37:11 PDT