endfunction//----------------------------------------------------------------------------// DEPRECATED - DO NOT USE IN NEW DESIGNS - NOT PART OF UVM STANDARD//----------------------------------------------------------------------------`ifndefUVM_NO_DEPRECATED// Variable- count//// Sets the number of items to execute.//// Supercedes the max_random_count variable for uvm_random_sequence class// for backward compatibility.intcount=-1;intm_random_count;intm_exhaustive_count;intm_simple_count;intunsignedmax_random_count=10;intunsignedmax_random_depth=4;protectedstringdefault_sequence="uvm_random_sequence";protectedbitm_default_seq_set;stringsequences[$];protectedintsequence_ids[string];protectedrandintseq_kind;externfunctionvoidadd_sequence(stringtype_name);externfunctionvoidremove_sequence(stringtype_name);externfunctionvoidset_sequences_queue(refstringsequencer_sequence_lib[$]);externvirtualtaskstart_default_sequence();externfunctionintget_seq_kind(stringtype_name);externfunctionuvm_sequence_baseget_sequence(intreq_kind);externfunctionintnum_sequences();externvirtualfunctionvoidm_add_builtin_seqs(bitadd_simple=1);externvirtualtaskrun_phase(uvm_phasephase);
`ifndefUVM_NO_DEPRECATED// add_sequence// ------------//// Adds a sequence of type specified in the type_name paramter to the// sequencer's sequence library.functionvoiduvm_sequencer_base::add_sequence(stringtype_name);`uvm_warning("UVM_DEPRECATED",{"Registering sequence '",type_name,"' with sequencer '",get_full_name(),"' is deprecated. "})//assign typename key to an int based on size//used with get_seq_kind to return an int key to match a type nameif(!sequence_ids.exists(type_name))beginsequence_ids[type_name]=sequences.size();//used w/ get_sequence to return a uvm_sequence factory object that //matches an int idsequences.push_back(type_name);endendfunction// remove_sequence// ---------------functionvoiduvm_sequencer_base::remove_sequence(stringtype_name);sequence_ids.delete(type_name);for(inti=0;i<this.sequences.size();i++)beginif(this.sequences[i]==type_name)this.sequences.delete(i);endendfunction// set_sequences_queue// -------------------functionvoiduvm_sequencer_base::set_sequences_queue(refstringsequencer_sequence_lib[$]);for(intj=0;j<sequencer_sequence_lib.size();j++)beginsequence_ids[sequencer_sequence_lib[j]]=sequences.size();this.sequences.push_back(sequencer_sequence_lib[j]);endendfunction// start_default_sequence// ----------------------// Called when the run phase begins, this method starts the default sequence,// as specified by the default_sequence member variable.//taskuvm_sequencer_base::start_default_sequence();uvm_sequence_basem_seq;uvm_coreservice_tcs=uvm_coreservice_t::get();uvm_factoryfactory=cs.get_factory();// Default sequence was cleared, or the count is zeroif(default_sequence==""||count==0||(sequences.size()==0&&default_sequence=="uvm_random_sequence"))return;// Have run-time phases and no user setting of default sequenceif(this.m_default_seq_set==0&&m_domain!=null)begindefault_sequence="";`uvm_info("NODEFSEQ",{"The \"default_sequence\" has not been set. ","Since this sequencer has a runtime phase schedule, the ","uvm_random_sequence is not being started for the run phase."},UVM_HIGH)return;end// Have a user setting for both old and new default sequence mechanismsif(this.m_default_seq_set==1&&(uvm_config_db#(uvm_sequence_base)::exists(this,"run_phase","default_sequence",0)||uvm_config_db#(uvm_object_wrapper)::exists(this,"run_phase","default_sequence",0)))begin`uvm_warning("MULDEFSEQ",{"A default phase sequence has been set via the ","\"<phase_name>.default_sequence\" configuration option.","The deprecated \"default_sequence\" configuration option is ignored."})return;end// no user sequences to choose fromif(sequences.size()==2&&sequences[0]=="uvm_random_sequence"&&sequences[1]=="uvm_exhaustive_sequence")beginuvm_report_warning("NOUSERSEQ",{"No user sequence available. ","Not starting the (deprecated) default sequence."},UVM_HIGH);return;end`uvm_warning("UVM_DEPRECATED",{"Starting (deprecated) default sequence '",default_sequence,"' on sequencer '",get_full_name(),"'. See documentation for uvm_sequencer_base::start_phase_sequence() for information on ","starting default sequences in UVM."})//create the sequence objectif(!$cast(m_seq,factory.create_object_by_name(default_sequence,get_full_name(),default_sequence)))beginuvm_report_fatal("FCTSEQ",{"Default sequence set to invalid value : ",default_sequence},UVM_NONE);endif(m_seq==null)beginuvm_report_fatal("STRDEFSEQ","Null m_sequencer reference",UVM_NONE);endm_seq.set_starting_phase(run_ph);m_seq.print_sequence_info=1;m_seq.set_parent_sequence(null);m_seq.set_sequencer(this);m_seq.reseed();if(!m_seq.randomize())beginuvm_report_warning("STRDEFSEQ","Failed to randomize sequence");endm_seq.start(this);endtask// get_seq_kind// ------------// Returns an int seq_kind correlating to the sequence of type type_name// in the sequencers sequence library. If the named sequence is not// registered a SEQNF warning is issued and -1 is returned.functionintuvm_sequencer_base::get_seq_kind(stringtype_name);`uvm_warning("UVM_DEPRECATED",$sformatf("%m is deprecated"))if(sequence_ids.exists(type_name))returnsequence_ids[type_name];`uvm_warning("SEQNF",{"Sequence type_name '",type_name,"' not registered with this sequencer."})return-1;endfunction// get_sequence// ------------// Returns a reference to a sequence specified by the seq_kind int.// The seq_kind int may be obtained using the get_seq_kind() method.functionuvm_sequence_baseuvm_sequencer_base::get_sequence(intreq_kind);uvm_coreservice_tcs=uvm_coreservice_t::get();uvm_factoryfactory=cs.get_factory();uvm_sequence_basem_seq;stringm_seq_type;`uvm_warning("UVM_DEPRECATED",$sformatf("%m is deprecated"))if(req_kind<0||req_kind>=sequences.size())beginuvm_report_error("SEQRNG",$sformatf("Kind arg '%0d' out of range. Need 0-%0d",req_kind,sequences.size()-1));endm_seq_type=sequences[req_kind];if(!$cast(m_seq,factory.create_object_by_name(m_seq_type,get_full_name(),m_seq_type)))beginuvm_report_fatal("FCTSEQ",$sformatf("Factory cannot produce a sequence of type %0s.",m_seq_type),UVM_NONE);endm_seq.print_sequence_info=1;m_seq.set_sequencer(this);returnm_seq;endfunction// num_sequences// -------------functionintuvm_sequencer_base::num_sequences();returnsequences.size();endfunction// m_add_builtin_seqs// ------------------functionvoiduvm_sequencer_base::m_add_builtin_seqs(bitadd_simple=1);if(!sequence_ids.exists("uvm_random_sequence"))add_sequence("uvm_random_sequence");if(!sequence_ids.exists("uvm_exhaustive_sequence"))add_sequence("uvm_exhaustive_sequence");if(add_simple==1)beginif(!sequence_ids.exists("uvm_simple_sequence"))add_sequence("uvm_simple_sequence");endendfunction// run_phase// ---------taskuvm_sequencer_base::run_phase(uvm_phasephase);super.run_phase(phase);start_default_sequence();endtask`endif// UVM_NO_DEPRECATED//------------------------------------------------------------------------------//// Class- uvm_sequence_request////------------------------------------------------------------------------------classuvm_sequence_request;bitgrant;