Typedef syntax for parameterized class usage before its declaration

Hi All,

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

Best Regards,
Padma

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.

In reply to chr_sue:

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.

In reply to p@dm@:

This line of code is wrong:
class par_class extends #(parameter int KEY = 20, LEN = 10) uvm_object;

The syntax would be
class par_class #(parameter int KEY = 20, LEN = 10) extends uvm_object;