Hi,
I have a Parameterized Class :
class my_class#(type in_class_v= base_class_c#()) extends base_class_c;
rand in_class cntrl;
`uvm_object_param_utils_begin(my_class#(.in_class_v(in_class_v)))
`uvm_field_object(cntrl,UVM_ALL_ON)
`uvm_object_utils_end
function new(string name = "my_class");
super.new(name);
cntrl= in_class_v::type_id::create("cntrl"); //NOT COMPILING !!!
endfunction
endclass : my_class
while in_class_v is a virtual class :
virtual class base_class_c#(int WIDTH = -1) extends uvm_object;
logic [WIDTH-1:0] ds_packed;
pure virtual function void ds_pack();
pure virtual function void ds_unpack();
function new(string name = "base_class_c");
super.new(name);
endfunction : new
endclass // base_class_c
and i have a not virtual class that is derived from the virtual class
class dev_class_c#(int BUS_WIDTH = CTRL_WIDTH) extendsbase_class_c#(WIDTH);
rand bit [0:0] error;
`uvm_object_utils_begin(dev_class_c)
`uvm_field_int(error, UVM_ALL_ON)
`uvm_object_utils_end
function new(string name = "dev_class_c");
super.new(name);
endfunction
// Pack all fields into bus
virtual function void ds_pack();
endfunction
// Unpack bus to fields
virtual function void ds_unpack();
endfunction
endclass
-
At my verification environment i use my_class with the parameter of dev_class_c
-
the problem is that the whole thing is not even compiling (fails at elaboration phase)
i get this error :
cntrl= in_class_v::type_id::create("cntrl");
|
xmelab: *E,CUVSCE Scoped name component 'type_id' lookup failed at 'base_class_c'.
What is the problem ???
thanks !