• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Search Path and Packages, Interface, etc.

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 64
  • Views 14648
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Search Path and Packages, Interface, etc.

archive
archive over 18 years ago

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?


Originally posted in cdnusers.org by bryan
  • Cancel
  • archive
    archive over 18 years ago

    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;
    endpackage

    package test2_pkg;
    typedef bit var_t;
    endpackage

    module test;
    import test1_pkg::*;
    import test2_pkg::var_t; // wildcard import would cause error
    var_t v;
    initial $display("v=%b",v);
    endmodule


    Tim


    Originally posted in cdnusers.org by tpylant
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago

    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.


    Originally posted in cdnusers.org by bryan
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago

    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


    Originally posted in cdnusers.org by tpylant
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago

    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.


    Originally posted in cdnusers.org by bryan
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information