// for task-based nodesif($cast(tp,phase))beginif(new_node.get_name()=="run")beginnew_node.phase_done=uvm_test_done_objection::get();endelsebeginnew_node.phase_done=uvm_objection::type_id::create({phase.get_name(),"_objection"});endendend// We are inserting an existing scheduleelsebeginbegin_node=phase;end_node=phase.m_end_node;phase.m_parent=this;end// If 'with_phase' is us, then insert node in parallel
// Provides built-in end-of-test coordination//------------------------------------------------------------------------------classuvm_test_done_objectionextendsuvm_objection;protectedstaticuvm_test_done_objectionm_inst;protectedbitm_forced;// For communicating all objections dropped and end of phasinglocalbitm_executing_stop_processes;localintm_n_stop_threads;// Function- new DEPRECATED//// Creates the singleton test_done objection. Users must not call// this method directly.functionnew(stringname="uvm_test_done");
endclass//@uvm-compat for compatibility with 1.2classuvm_test_done_objectionextendsuvm_objection;protectedstaticuvm_test_done_objectionm_inst;protectedbitm_forced;// For communicating all objections dropped and end of phasinglocalbitm_executing_stop_processes;localintm_n_stop_threads;// Function- new DEPRECATED//// Creates the singleton test_done objection. Users must not call// this method directly.//@uvm-compat for compatibility with 1.2functionnew(stringname="uvm_test_done");super.new(name);endfunction// Function- qualify DEPRECATED//// Checks that the given ~object~ is derived from either <uvm_component> or// <uvm_sequence_base>.//@uvm-compat for compatibility with 1.2virtualfunctionvoidqualify(uvm_objectobj=null,bitis_raise,stringdescription);uvm_componentc;uvm_sequence_bases;stringnm=is_raise?"raise_objection":"drop_objection";stringdesc=description==""?"":{" (\"",description,"\")"};if(!($cast(c,obj)||$cast(s,obj)))beginuvm_report_error("TEST_DONE_NOHIER",{"A non-hierarchical object, '",obj.get_full_name(),"' (",obj.get_type_name(),") was used in a call ","to uvm_test_done.",nm,"(). For this objection, a sequence ","or component is required.",desc});endendfunction// Below are basic data operations needed for all uvm_objects// for factory registration, printing, comparing, etc.typedefuvm_object_registry#(uvm_test_done_objection,"uvm_test_done")type_id;//@uvm-compat for compatibility with 1.2staticfunctiontype_idget_type();returntype_id::get();endfunction//@uvm-compat for compatibility with 1.2functionuvm_objectcreate(stringname="");uvm_test_done_objectiontmp=new(name);returntmp;endfunction//@uvm-compat for compatibility with 1.2virtualfunctionstringget_type_name();return"uvm_test_done";endfunction//@uvm-compat for compatibility with 1.2staticfunctionuvm_test_done_objectionget();if(m_inst==null)m_inst=uvm_test_done_objection::type_id::create("run");returnm_inst;endfunctionendclass
endfunction// @uvm-ieee 1800.2-2020 auto 9.3.1.7.1functionuvm_objectionget_objection();uvm_phaseimp;uvm_task_phasetp;imp=get_imp();// Only nodes with a non-null uvm_task_phase imp have objectionsif((get_phase_type()!=UVM_PHASE_NODE)||(imp==null)||!$cast(tp,imp))beginreturnnull;endif(phase_done==null)beginphase_done=uvm_objection::type_id::create({get_name(),"_objection"});endreturnphase_done;endfunction// get_objection