RE: [sv-bc] The scope of import items

From: francoise martinolle <fm_at_.....>
Date: Wed Feb 08 2006 - 05:35:34 PST
Surya, 

An import makes the symbols it imports directly visible (or potentially
visible if you use
an import *) in the current importing scope. The visibility of the symbol is
used for names resolution within
that scope only. If that scope is a package and that package is imported in
another scope, it does not
make the symbols which were made visible through the import statements
visible in that new scope.
Visible in a scope is not to be confused with being declared in a scope.
Those are also the VHDL semantics
as Dave pointed out.

Francoise
    '



-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Rich,
Dave
Sent: Wednesday, February 08, 2006 1:51 AM
To: Surya Pratik Saha; sv-bc@eda.org
Subject: RE: [sv-bc] The scope of import items

Surya,

I just put in a proposal on Saturday for this. If we take the semantics from
VHDL, then no, you do not chain the imports of symbols.

See: http://www.eda.org/svdb/bug_view_page.php?bug_id=0001323

Dave


> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Surya
> Pratik Saha
> Sent: Tuesday, February 07, 2006 9:37 PM
> To: sv-bc@eda.org
> Subject: [sv-bc] The scope of import items
> 
> For the given e.g.
> 
> package p1;
> typedef struct packed{byte r1 ; logic signed [4:0] r2;} st1; 
> endpackage
> 
> package p2;
> import p1::*;
> typedef struct packed{byte r1 ; logic signed [4:0] r2;} st2; 
> endpackage
> 
> module test;
> import p1::*;
> import p2::*;
> st1 var1;
> always @*
> begin
>     var1 = 1;
> end
> endmodule
> 
> item st1 is imported to p1 as well as in test. Is st1 is not visible
to
> test through import of p2 in test?
> 
> LRM does not clrearly state whether the imported items can be imported
to
> other
> scope or not if the importing scope is itself imported to somewhere
else.
> 
> For the above e.g. if p2 iteself only imported to test, is st1 not
visible
> to
> test?
> 
> Regards
> Surya.
Received on Wed Feb 8 05:35:56 2006

This archive was generated by hypermail 2.1.8 : Wed Feb 08 2006 - 05:37:52 PST