Hi,
I have a sequence and standard sequencer.
I am starting the sequence via my test on the sequencer but, I am getting the following error:
neither the item’s sequencer nor dedicated sequencer has been supplied to start item in m_bseq
to give a little insight into my code.
I have the following files.
sequence.sv - has the start_item to start the item post-creation.
test.sv - in the run_phase initiates the start of the sequence on the sequencer.
sequencer.sv - this is pretty standard code.
sequencer.sv:
`include "uvm_macros.svh"
import uvm_pkg::*;
class Sequencer extends uvm_sequencer #(SequenceItem);
`uvm_component_utils(Sequencer)
extern function new (string name, uvm_component parent);
endclass: Sequencer
function Sequencer::new(string name, uvm_component parent);
super.new(name,parent);
endfunction: new
sequence.sv:
`include "uvm_macros.svh"
import uvm_pkg::*;
class BaseSequence extends uvm_sequence #(SequenceItem);
`uvm_object_utils(BaseSequence)
//`uvm_declare_p_sequencer(Sequencer)
Config m_config;
extern function new (string name = "");
extern task body;
endclass: BaseSequence
function BaseSequence::new(string name = "");
super.new(name);
endfunction: new
task BaseSequence::body();
if(starting_phase != null) starting_phase.raise_objection(this);
repeat(8)
begin
SequenceItem m_seqItem;
m_seqItem=SequenceItem::type_id::create("m_seqItem");
start_item(m_seqItem);
if(!m_seqItem.randomize()) `uvm_warning(get_type_name(),$sformatf("Randomization Failed."))
finish_item(m_seqItem);
end
if(starting_phase != null) starting_phase.drop_objection(this);
endtask: body
test.sv
`include "uvm_macros.svh"
import uvm_pkg::*;
class BaseTest extends uvm_test;
`uvm_component_utils(BaseTest)
Env m_env;
BaseSequence m_bseq;
Config m_config;
extern function new(string name, uvm_component parent);
extern function void build_phase(uvm_phase phase);
extern function void connect_phase(uvm_phase phase);
extern function void end_of_elaboration_phase(uvm_phase phase);
extern function void start_of_simulation_phase(uvm_phase phase);
extern task run_phase(uvm_phase phase);
extern function void extract_phase(uvm_phase phase);
extern function void check_phase(uvm_phase phase);
extern function void report_phase(uvm_phase phase);
extern function void final_phase(uvm_phase phase);
endclass: BaseTest
function BaseTest::new(string name, uvm_component parent);
super.new(name,parent);
endfunction
function void BaseTest::build_phase(uvm_phase phase);
m_env = Env::type_id::create("m_env",this);
endfunction: build_phase
function void BaseTest::connect_phase(uvm_phase phase);
endfunction: connect_phase
function void BaseTest::end_of_elaboration_phase(uvm_phase phase);
endfunction: end_of_elaboration_phase
function void BaseTest::start_of_simulation_phase(uvm_phase phase);
if(!uvm_config_db#(Config)::get(this,"m_env","Config",m_config))
`uvm_error(get_type_name(),$sformatf("Unable to get Config"))
m_config.coverage_enable = 0;
m_config.count = 4;
endfunction: start_of_simulation_phase
task BaseTest::run_phase(uvm_phase phase);
phase.raise_objection(this);
m_bseq = BaseSequence::type_id::create("m_bseq");
if (!m_bseq.randomize()) `uvm_error("","Randomization failed")
m_bseq.set_starting_phase(phase);
m_bseq.start(m_env.m_Agent.m_seqr);
uvm_top.set_timeout(1ms);
phase.drop_objection(this);
endtask
function void BaseTest::extract_phase(uvm_phase phase);
endfunction: extract_phase
function void BaseTest::check_phase(uvm_phase phase);
endfunction: check_phase
function void BaseTest::report_phase(uvm_phase phase);
endfunction: report_phase
function void BaseTest::final_phase(uvm_phase phase);
endfunction: final_phase
Thanks for your time and pointer.
Regards