# Wait for main phase

**URL:** <https://verificationacademy.com/forums/t/wait-for-main-phase/41152>\
**Category:** UVM\
**Tags:** run\_phase, UVM\
**Created:** [January 4, 2023, 8:16pm UTC](https://verificationacademy.com/forums/t/wait-for-main-phase/41152 "2023-01-04T20:16:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zahibe](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/z/13edae/32.png) [@zahibe](https://verificationacademy.com/forums/u/zahibe)\
**Post date:** [January 4, 2023, 8:16pm UTC](https://verificationacademy.com/forums/t/wait-for-main-phase/41152/1 "2023-01-04T20:16:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [January 5, 2023, 12:13am UTC](https://verificationacademy.com/forums/t/wait-for-main-phase/41152/2 "2023-01-05T00:13:34Z")

</div>

_In reply to [zahibe](https://verificationacademy.com/forums/t/wait-for-main-phase/41152):_

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.

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

```

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