What is a valid Argument to run_test()

Hi ,



class agent extends uvm_agent ;

 `uvm_component_utils(agent)

 ...

endclass

initial
run_test("agent") ;  // This works !! , but Why ?? 

// I see Output :: 
Running test UVM_INFO @ 0: reporter [RNTST] Running test agent...

I see that if that uvm_test_top is agent , but my question is shouldn’t that be an error ?
Shouldn’t we get an error is argument passed to run_test isn’t extended from uvm_test

In reply to Have_A_Doubt:

It won’t generate error. did you check the code of uvm_agent and uvm_test?

Both of these class are extended from the uvm_component. These classes are just wrapper over the uvm_component class. They don’t contain any specific constraint or attribute except uvm_agent have one additional variable(is_active) declared.

In reply to Have_A_Doubt:

The argument to run_test() can be the name of any class derived from uvm_component. In some cases, it’s possible to have an agent be the top level if that agent generates sequences and you just want to test that part of an interface. But if your agent raises no objections and does not generate any stimulus, your simulation will end at time 0.