For this discussion assume a design team is used to using a search path approach to finding verilog modules and this forms the basis for the desires to follow.
When an module imports a package or instances an interface, is there a similar search path convention/feature in tools like NCSIM, RC, etc?
For instancing the interface, the search path works the same as for any module instantiated in a design.For packages, you import only the package you want to use. If you need items from multiple packages and can't wildcard import the packages, then you will have to import only the items you need.Example:package test1_pkg;typedef logic var_t;endpackagepackage test2_pkg;typedef bit var_t;endpackagemodule test;import test1_pkg::*;import test2_pkg::var_t; // wildcard import would cause errorvar_t v;initial $display("v=%b",v);endmoduleTim
Not what I was asking. I have since deteremined that packages are NOT searched for and interfaces are. An enhancement request was filed a while back. I am talking about the search path (-y) and not the import statement.In your example if you all those files in three different directories and listed each directory using -y. I was hoping to only have to specify the top-level module (test) and the two packages would be searched for using the -y. This was assuming that the file names for the packages were test1_pkg.v and test2_pkg.v.
I understand now -- search paths for finding the files for compilation. Yes, you are correct that the package files have to be explicitly called out for compilation and they need to be compiled first. If you include the package in a file, then you can use the -incdir option to provide the path.Tim
That plus three defines are our work around for now. 1 define to include or not include. 1 define to indicate if the package has already been parsed (so its not redefined). 1 define to conditionally strip off the package and endpackages for tools that don't even support packages yet.