This is a piece of uvm example code which can run without any issue. My question is: class “test” is defined, but has never been instantiated. How could we run the task “run_test” of a class that has not been instantiated?
Thanks,
Chris
import uvm_pkg::*;
`include "uvm_macros.svh"
program t1;
class test extends uvm_test;
`uvm_component_utils(test)
function new (string name = "test", uvm_component parent);
super.new(name, parent);
endfunction
virtual task run_phase(uvm_phase phase);
phase.raise_objection(this);
#100 `uvm_info("E1", "hello form E1", UVM_MEDIUM);
phase.drop_objection(this);
endtask
endclass
initial begin
run_test("test");
end
endprogram