I need to use a parameterized class before declaration. How to create typdef for that?
File2.sv - Could you please tell me the below code is correct or not? What is the correct way to use.
typdef class par_class #(KEY,LEN);
class A extends from uvm_component;
par_class #(30,15) p;
p = new();
endclass
The above code is giving me compilation errors.
Following is the parameterized class definition:
File1.sv
class par_class extends #(parameter int KEY = 20, LEN = 10) uvm_object;
endclass
In reply to p@dm@:
In your code I do not see a need for a forward typedef. Is this really needed?
Iy yes you have to make forward typedefs with the actual parameters.
I did not understand what you are talking.
Yes, I need to use par_class before its declaration.
In my code File2 is compiled before File1. So, I’m getting compilation error, even If I use/don’t use typedef for par_class.