What's the difference between run_test and ovm_root::run_test?

Dear all,
in ovm_root.svh,i found two run_test:
in line 160:

task run_test (string test_name="");
  ovm_root top;
  top = ovm_root::get();
  top.run_test(test_name);
endtask

in line253:

task ovm_root::run_test(string test_name="");
  bit testname_plusarg;
  string msg;
  testname_plusarg = 0;

I found the fisrt time it will invoke run_test and sencond time top.run_test will invoke ovm_root::run_test.
What’s the difference between those two run_test?
Thank you!

task run_test is a global task that can be called without an object handle. It is really just a convenience function that calls the run_test task on the root singleton object.

task ovm_root::run_test is the member function of the ovm_root singleton object. In version 1.1, there is now a single, global “manager” object with the type ovm_root and the handle name ovm_top. You now use this handle to do things like stop the run task, find components, etc. Many 1.0 ovm_component functions were moved to ovm_root, and should be called through ovm_top.

There is no difference between them. The global function just gets the handle to ovm_top and calls the member function. You can use either one.

-Kurt

Hi Kurts,
then global run_test and ovm_root:: run_test is different task right?
Here is my undertanding,please correct me:
global run_test() is defined out side any class body,so it’s global.
global run_test creat a ovm_root object named ovm_top,then ovm_top call the run_test task which is defined for ovm_root::run_test.
right?
Thank you very much!

Keep it TOP!

Yes, they are different tasks, but they do exactly the same thing because one just calls the other.

-Kurt