# Calling a Task at the end of run\_phase

**URL:** <https://verificationacademy.com/forums/t/calling-a-task-at-the-end-of-run-phase/51529>\
**Category:** UVM\
**Tags:** UVM, UVM-phases\
**Created:** [January 16, 2026, 11:00pm UTC](https://verificationacademy.com/forums/t/calling-a-task-at-the-end-of-run-phase/51529 "2026-01-16T23:00:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![verifcurious](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/f1d935/32.png) [@verifcurious](https://verificationacademy.com/forums/u/verifcurious)\
**Post date:** [January 16, 2026, 11:00pm UTC](https://verificationacademy.com/forums/t/calling-a-task-at-the-end-of-run-phase/51529/1 "2026-01-16T23:00:11Z")

</div>

Hi All,

I have a requirement where I need to call an End of Sim **task** at the end of run\_phase(after all 12 sub phases are done). This is a time-consuming task, and I am not sure if I can call it in a check\_phase function or phase\_ready\_to\_end function as functions cant consume time.

I tried using all\_dropped callback from my base test as below but I read that is not recommended to use and is unpredictable.

```auto
virtual task all_dropped(uvm_objection objection, uvm_object source_obj, string desc, int kind);

if (objection == uvm_test_done) begin 

  uvm_info(get_type_name(), $sformatf("Base Test: Entering All Dropped callback after run phase"), UVM_LOW) 

  end_of_sim_check();       

  uvm_info(get_type_name(), $sformatf(“Base Test: Exitting All Dropped callback after run phase”), UVM_LOW)

super.all_dropped(objection, source_obj, desc, kind); end

endtask :all_dropped

```

Any recommendations on how to call a task after run\_phase/all traffic ends ? Can I use the function below?

```auto
function void phase_ready_to_end(uvm_phase phase);
  if (phase.is(uvm_run_phase::get())) begin
    // All subphases done,
    phase.raise_objection(this);
    fork begin
      end_of_sim_check();
      repeat(10) @(posedge clk);
      phase.drop_objection(this);
    end join_none
  end
endfunction

```

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 17, 2026, 9:42pm UTC](https://verificationacademy.com/forums/t/calling-a-task-at-the-end-of-run-phase/51529/2 "2026-01-17T21:42:28Z")

</div>

You cannot execute a time-consuming task after the run phase ends. All phases that follow the run phase are functions, and the test will terminate the simulation at that specific time step.

The function `phase_ready_to_end` can be used to extend the end of time consuming phase by raising another objection. In most cases, your test will raise an objection, initiate a sequence to generate stimuli, and subsequently lower the objection after the stimulus sequence returns. The function `phase_ready_to_end` can then verify that all traffic has been completed.

---

<div class="post-metadata">

**Author:** ![verifcurious](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/f1d935/32.png) [@verifcurious](https://verificationacademy.com/forums/u/verifcurious)\
**Post date:** [January 17, 2026, 11:37pm UTC](https://verificationacademy.com/forums/t/calling-a-task-at-the-end-of-run-phase/51529/3 "2026-01-17T23:37:37Z")

</div>

Thanks dave.

---

<div class="post-metadata">

**Author:** ![verifcurious](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/f1d935/32.png) [@verifcurious](https://verificationacademy.com/forums/u/verifcurious)\
**Post date:** [January 17, 2026, 11:39pm UTC](https://verificationacademy.com/forums/t/calling-a-task-at-the-end-of-run-phase/51529/4 "2026-01-17T23:39:08Z")

</div>

Is the above code having phase\_ready\_to\_end and eos not recommended? I added static drain time to my run phase let all the traffic finish, and then use phase ready to end for final checks as above. is it a right way of doing?

Also on a different note is all\_dropped recommended to use in this scenario?
