Run_test method in top module is a function or a task?

run_test in top module is a function or a task. How run_test works after passing the test name through +UVM_TESTNAME switch? what happens after calling run_test?

In reply to agoel:

https://verificationacademy.com/verification-methodology-reference/uvm/docs_1.2/html/files/base/uvm_globals-svh.html#run_test

In reply to agoel:
run_test is a virtual task defined in uvm_root, which is extended from uvm_component.

When testcase name is provided in run_test argument or passed through +UVM_TESTNAME, the uvm_root creates this testcase and starts executing all the phases one by one.

Ref:

  1. uvm_root
  2. https://verificationacademy.com/verification-methodology-reference/uvm/docs_1.2/html/src/base/uvm_root.svh