• 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. Template classes with ncvlog 6.2

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 64
  • Views 13452
  • 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

Template classes with ncvlog 6.2

archive
archive over 17 years ago

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
  • Cancel
  • archive
    archive over 17 years ago

    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
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    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
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    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
    • 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