Home > Community > Forums > Functional Verification > Search Path and Packages, Interface, etc.

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Search Path and Packages, Interface, etc. 

Last post Sat, Mar 17 2007 9:22 AM by archive. 4 replies.
Started by archive 17 Mar 2007 09:22 AM. Topic has 4 replies and 1486 views
Page 1 of 1 (5 items)
Sort Posts:
  • Sat, Mar 17 2007 9:22 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    Search Path and Packages, Interface, etc. Reply

    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
    • Post Points: 0
  • Wed, May 9 2007 9:49 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Search Path and Packages, Interface, etc. Reply

    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
    • Post Points: 0
  • Wed, May 9 2007 12:33 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Search Path and Packages, Interface, etc. Reply

    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
    • Post Points: 0
  • Wed, May 9 2007 12:51 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Search Path and Packages, Interface, etc. Reply

    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
    • Post Points: 0
  • Wed, May 9 2007 12:59 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Search Path and Packages, Interface, etc. Reply

    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
    • Post Points: 0
Page 1 of 1 (5 items)
Sort Posts:
Started by archive at 17 Mar 2007 09:22 AM. Topic has 4 replies.