EmbDev.net

Forum: FPGA, VHDL & Verilog Import package error system Verilog


von Nikhil Ghanathe (Guest)


Rate this post
useful
not useful
Hello,
I have a few packages that I have written like this:
1
package A; 
2
-- 
3
-- 
4
endpackage 
5
6
package B; 
7
import A::* 
8
--- 
9
-- 
10
endpackage 
11
12
package C; 
13
import A::*; 
14
import B::*; 
15
endpackage
In the file using package C, the error I am getting is as follows:
Error (10864): SystemVerilog error at C.sv(26): TMP was imported from 
multiple packages with ::* - none of the imported declarations are 
visible.

Is this problem because I am importing A::* in both package A and 
package C?
Any help to rsolve this is greatly appreciated.

Thanks in Advance~

--
Nikhil Pratap

von Duke Scarring (Guest)


Rate this post
useful
not useful
Nikhil Ghanathe wrote:
> TMP was imported from
> multiple packages with
I think not A is the problem but TMP is imported multiple times.
Maybe you can import more selective with:
1
import A::special_only;

Duke

von Nikhil G. (Company: Microsoft) (nikhilghanathe)


Rate this post
useful
not useful
Thanks Duke,
Will try that out.
A follow up question, is there like a guard statement (like `ifndef...) 
which can be used here to avoid importing multiple times?\

--
Nikhil Pratap

von Tom T. (gogul)


Rate this post
useful
not useful
Yes, same syntax as in C

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.