Wait for main phase

Hi,
I want to run a certain function (for instance coverage sampling), and I need to run it at main phase - meaning after configuration phase.
How can I trigger my function to run once sometime at run phase?

Thanks.

In reply to zahibe:

You have conflicting requirements. You say you want to run your function at the main_phase, and then you say you want to run once in the run_phase.

You can call any function at the beginning of each phase. There is no need to wait for it.

task run_phase(uvm_phase phase);
 call_function_you_want_here();
 ...
endtask

Maybe there is more to your issue you haven’t stated.