`endif`ifdefUVM_DEPRECATED_STARTING_PHASE// DEPRECATED!! Use get/set_starting_phase accessors instead!uvm_phasestarting_phase;// Value set via set_starting_phaseuvm_phasem_set_starting_phase;// Ensures we only warn once per sequencebitm_warn_deprecated_set;`endif// Function: get_starting_phase// Returns the 'starting phase'.//// If non-~null~, the starting phase specifies the phase in which this// sequence was started. The starting phase is set automatically when// this sequence is started as the default sequence on a sequencer.// See <uvm_sequencer_base::start_phase_sequence> for more information.//
// its execution (either via natural termination, or being killed),// then the starting phase value can be modified again.//functionuvm_phaseget_starting_phase();`ifdefUVM_DEPRECATED_STARTING_PHASEbeginbitthrow_error;if(starting_phase!=m_set_starting_phase)beginif(!m_warn_deprecated_set)begin`uvm_warning("UVM_DEPRECATED","'starting_phase' is deprecated and not part of the UVM standard. See documentation for uvm_sequence_base::set_starting_phase")m_warn_deprecated_set=1;endif(m_starting_phase_dap.try_set(starting_phase))m_set_starting_phase=starting_phase;elsebeginuvm_phasedap_phase=m_starting_phase_dap.get();`uvm_error("UVM/SEQ/LOCK_DEPR",
// its execution (either via natural termination, or being killed),// then the starting phase value can be modified again.//functionvoidset_starting_phase(uvm_phasephase);`ifdefUVM_DEPRECATED_STARTING_PHASEbeginif(starting_phase!=m_set_starting_phase)beginif(!m_warn_deprecated_set)begin`uvm_warning("UVM_DEPRECATED",{"The deprecated 'starting_phase' variable has been set to '",starting_phase.get_full_name(),"' manually. See documentation for uvm_sequence_base::set_starting_phase."})m_warn_deprecated_set=1;endstarting_phase=phase;m_set_starting_phase=phase;endend
localuvm_get_to_lock_dap#(uvm_phase)m_starting_phase_dap;// @uvm-compat For compatibility with UVM 1.1duvm_phasestarting_phase;// Function- m_init_phase_daps// Either creates or renames DAPSfunctionvoidm_init_phase_daps(bitcreate);stringapo_name=$sformatf("%s.automatic_phase_objection",get_full_name());stringsp_name=$sformatf("%s.starting_phase",get_full_name());if(create)beginm_automatic_phase_objection_dap=uvm_get_to_lock_dap#(bit)::type_id::create(apo_name,get_sequencer());m_starting_phase_dap=uvm_get_to_lock_dap#(uvm_phase)::type_id::create(sp_name,get_sequencer());endelsebeginm_automatic_phase_objection_dap.set_name(apo_name);m_starting_phase_dap.set_name(sp_name);end
// then the starting phase value can be modified again.//// @uvm-ieee 1800.2-2020 auto 14.2.4.1functionuvm_phaseget_starting_phase();uvm_phasesp;// If we're not locked, use the starting_phase variableif(!m_starting_phase_dap.is_locked()&&starting_phase!=null)m_starting_phase_dap.set(starting_phase);// Get the DAP value (and lock it)sp=m_starting_phase_dap.get();// Throw an error if starting_phase != dap.get()if(sp!=starting_phase)begin`uvm_error("UVM/SEQ/SP/GET",$sformatf("The starting_phase variable was set to '%s' after a call to get_starting_phase locked the value '%s'. The new value is ignored.",(starting_phase==null)?"<null>":starting_phase.get_name(),(sp==null)?"<null>":sp.get_name()))
// @uvm-ieee 1800.2-2020 auto 14.2.4.2functionvoidset_starting_phase(uvm_phasephase);if(!m_starting_phase_dap.try_set(phase))begin// Too late to update starting phaseuvm_phasesp;sp=m_starting_phase_dap.get();`uvm_error("UVM/SEQ/SP/SET",$sformatf("The starting_phase variable was set to '%s' after a call to get_starting_phase locked the value at '%s'. The new value is ignored.",(phase==null)?"<null>":phase.get_name(),(sp==null)?"<null>":sp.get_name()))endelsebegin// Update the starting_phase variablestarting_phase=phase;endendfunction:set_starting_phase