Hi,
I was trying to extend a uvm_mem class with an identical constructor, but, compile fails on `uvm_object_utils().
I later realised that this is due to arguments not having been assigned default values.
I did notice that this happens in UVM, and not in system_verilog. (if I drop the `uvm_object_utils() for this class, compile seems fine.
Just trying to understand why the UVM factory registration is expecting default values for all constructor arguments ?
Failing Case::
class A extends uvm_mem;
`uvm_object_utils(A)
function new (string name = "my_mem",
longint unsigned size ,
int unsigned n_bits ,
string access = "RW",
int has_coverage = UVM_NO_COVERAGE
);
super.new(name, size, n_bits, access, has_coverage);
endfunction
endclass
Failing Error (in ncsim) : (Complains about size and n_bits in the code)
ncvlog: *E,FAABP1 (testbench.sv,20|21): Task/function call, or property/sequence instance does not specify all required formal arguments.
Passing case::
class A extends uvm_mem;
`uvm_object_utils(A)
function new (string name = "my_mem",
longint unsigned size =0,
int unsigned n_bits =0,
string access = "RW",
int has_coverage = UVM_NO_COVERAGE
);
super.new(name, size, n_bits, access, has_coverage);
endfunction
endclass