I was compiling a piece of code
class myClass;
import myEnum::*;
…
endclass
when I got this warning
import myEnum::*;
|
ncvlog: *W,INOSTD (pkgEnum.sv,30|15): An import declaration shall not be used inside a class declaration.
ncvlog/INOSTD =
The SystemVerilog standard recently made a clarification regarding the use of imports inside
class declaration: using imports inside classes is not compliant with the 1800 standard.
The support of imports inside classes will be removed in a future release. The recommendation
is to use explicit full package references inside classes or move the imports outside the
class declaration.
Well, I think this sucks. Anyhow, here’s a nice article on the usage of packages and `includes.
http://blogs.mentor.com/verificationhorizons/blog/2010/07/13/package-import-versus-include/
PS : If you don’t like the *W messages in your compilation log, add “-nowarn INOSTD” as a compilation argument and it will stop showing you that particular warning.