When I use ncvlog -sv to compile the following I get errors:
class a#(int width=5);
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?
Hi, What errors are you getting? Maybe parameterized class is not yet supported?Ajeetha, CVCwww.noveldv.com
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 : abcabc #(4) my_class = new(); // width = 4abc #() my_class2 = new(); // syntax for default width of 8initial begin void'(my_class.randomize()): void'(my_class2.randomize()); $display(my_class.data,,my_class2.data);endendmodule : testTo run this example: % irun -svpp test.svI hope this helps.Kathleen
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