Home > Community > Forums > Functional Verification > Importing template classes from a package

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: *

 Importing template classes from a package 

Last post Mon, Nov 19 2007 8:29 AM by archive. 1 replies.
Started by archive 19 Nov 2007 08:29 AM. Topic has 1 replies and 855 views
Page 1 of 1 (2 items)
Sort Posts:
  • Mon, Nov 19 2007 8:29 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    Importing template classes from a package Reply

    Hi, I have a package that contains some template classes. When I try to import these classes and specialize them in a module, I get a compilation error. Here's a simple example: // in file a.sv package a; class b#(int width = 5); bit[width:0] c; endclass endpackage // in file d.sv module d; import a::*; b#(6) b1; // this line gives compilation error endmodule // the commands I'm using to compile irun -svpp a.sv irun -svpp d.sv Can you please tell me what I'm doing wrong? Thanks, Avidan


    Originally posted in cdnusers.org by avidan_e
    • Post Points: 0
  • Mon, Nov 19 2007 8:51 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Importing template classes from a package Reply

    Avidan,

    As long as you're using svpp (and currently that's the only option if using type parameters) your template classes and their specializations have to reside in the same scope - either a package or a module.

    Zeev.


    Originally posted in cdnusers.org by zeevk
    • Post Points: 0
Page 1 of 1 (2 items)
Sort Posts:
Started by archive at 19 Nov 2007 08:29 AM. Topic has 1 replies.