Home > Community > Forums > Functional Verification > Template classes with ncvlog 6.2

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

 Template classes with ncvlog 6.2 

Last post Sat, Nov 17 2007 2:54 AM by archive. 3 replies.
Started by archive 17 Nov 2007 02:54 AM. Topic has 3 replies and 1123 views
Page 1 of 1 (4 items)
Sort Posts:
  • Sat, Nov 17 2007 2:54 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    Template classes with ncvlog 6.2 Reply

    Hi, When I use ncvlog -sv to compile the following I get errors: class a#(int width=5); bit[width-1:0] c; endclass I've been told that compiling template classes with ncvlog is possible using a pre-compilation script (the way it used to be done with C++). Is that true? if yes, where can I get the script and how do I run it? best, Avidan


    Originally posted in cdnusers.org by avidan_e
    • Post Points: 0
  • Sat, Nov 17 2007 8:28 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Template classes with ncvlog 6.2 Reply

    Hi,
    What errors are you getting? Maybe parameterized class is not yet supported?

    Ajeetha, CVC
    www.noveldv.com


    Originally posted in cdnusers.org by ajeetha
    • Post Points: 0
  • Sat, Nov 17 2007 9:55 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Template classes with ncvlog 6.2 Reply

    Hello Avidan,

    Parameterized classes are supported in IUS6.1 and IUS6.2 using the -svpp command-line option to irun. The irun executable is able to recognize Verilog, SystemVerilog, SystemC, e and C/C++ files based on their file extension. If you are willing to use irun instead of "ncverilog" or ncvlog/ncelab/ncsim - it will be easy for you to use the parameterized class capability. Here is a small example I ran on IUS6.2:

    module test;
    class abc #(int width=8);
    rand bit [width-1:0] data;
    endclass : abc

    abc #(4) my_class = new(); // width = 4
    abc #() my_class2 = new(); // syntax for default width of 8

    initial begin
    void'(my_class.randomize()):
    void'(my_class2.randomize());
    $display(my_class.data,,my_class2.data);
    end

    endmodule : test

    To run this example: % irun -svpp test.sv

    I hope this helps.

    Kathleen


    Originally posted in cdnusers.org by kameade
    • Post Points: 0
  • Sun, Nov 18 2007 12:57 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Template classes with ncvlog 6.2 Reply

    Hi Kathleen,
    >> if you're wiling to use irun...
    irun, iraq whatever it takes to compile the thing I don't mind :-)

    Thanks a lot, it works...

    Avidan


    Originally posted in cdnusers.org by avidan_e
    • Post Points: 0
Page 1 of 1 (4 items)
Sort Posts:
Started by archive at 17 Nov 2007 02:54 AM. Topic has 3 replies.