In reply to VE:
Sorry, my proposal code will not work. I just checked the drain_time in UVM: Once drain_time is being started, it can’t be restarted. Please look the following implementation code in UVM:
task m_forked_drain (uvm_object obj,
uvm_object source_obj,
string description="",
int count=1,
int in_top_thread=0);
int diff_count;
if (m_drain_time.exists(obj))
`uvm_delay(m_drain_time[obj])
UVM uses `uvm_delay for m_drain_time and we can’t reset the drain_time.
Therefore, the only one solution is “phase ready to end” in my first comment.