Function phase_ready_to_end

Hello,

I understand that this phase_ready_to_end function can be used in scoreboard perhaps, to extend the time for the last transaction to be completely done instead of floating around. But I have one question - if this is a “function”, which is supposed to not “take time”(unlike a task), how/why does it allow us to extend time with the phase.raise/drop objection mechanism?

Is “wait_for_ok_end” function user-written and internal to the scoreboard which just sets the “is_ok_to_end” bit?

function void phase_ready_to_end( uvm_phase phase );
 if( !is_ok_to_end() ) begin
 phase.raise_objection( this , "not done yet" );
 fork begin
 wait_for_ok_end();
 phase.drop_objection( this , "ok to end phase" );
 end
 join_none
 end
 endfunction : phase_ready_to_end

Thanks

In reply to UVM_learner6:

phase_ready_to_end is a function, but there is a fork/join_none around the wait and drop routines. That allows the function to return immediately.

Yes, is_ok_to_end() and wait_for_ok_end() are routines in the scoreboard just as an example.