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.
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?
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.