Code link: [https://edaplayground.com/x/9cte]
For the below code
class mem_test extends uvm_test;
`uvm_component_utils(mem_test)
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
virtual function void end_of_elaboration_phase(uvm_phase phase);
super.end_of_elaboration_phase(phase);
uvm_top.print_topology();
endfunction
endclass
I don't get any compilation error but for
class mem_test extends uvm_test;
`uvm_component_utils(mem_test)
virtual function void end_of_elaboration_phase(uvm_phase phase);
super.end_of_elaboration_phase(phase);
uvm_top.print_topology();
endfunction
endclass
I get
[2025-11-21 03:32:42 UTC] xrun -Q -unbuffered '-timescale' '1ns/1ns' '-sysv' '-access' '+rw' -uvmnocdnsextra -uvmhome $UVM_HOME $UVM_HOME/src/uvm_macros.svh design.sv testbench.sv TOOL: xrun 23.09-s001: Started on Nov 20, 2025 at 22:32:42 EST xrun: 23.09-s001: (c) Copyright 1995-2023 Cadence Design Systems, Inc. class mem_test extends uvm_test; | xmvlog: *E,FAABP3 (mem_test.sv,1|31): The implicit call to super.new() is missing an actual argument for the formal argument 'name' . class mem_test extends uvm_test; | xmvlog: *E,FAABP3 (mem_test.sv,1|31): The implicit call to super.new() is missing an actual argument for the formal argument 'parent' . xrun: *E,VLGERR: An error occurred during parsing. Review the log file for errors with the code *E and fix those identified problems to proceed. Exiting with code (status 1). TOOL: xrun 23.09-s001: Exiting on Nov 20, 2025 at 22:32:43 EST (total: 00:00:01) Exit code expected: 0, received: 1
But default arguments were not given for the first version in which new constructor was defined in the class. So why this error did not appeared for first version?