i am creating a virtual sequence and calling from a test case but, getting fatal error in simulation as below:
UVM_FATAL @ 10: uvm_test_top.h_env.agn2.m_sequencer [m_sequencer] send_request failed to cast sequence item
please, let me know what am i doing wrong ?
for the following code:
/////////////////////////////////////////////////////////
////////// Virtual sequence base class //////////////////
/////////////////////////////////////////////////////////
class axi_virtual_base extends uvm_sequence #(uvm_sequence_item) ;
`uvm_object_utils(axi_virtual_base)
uvm_sequencer #(axi_packet) m_seqr ;
uvm_sequencer #(axi_slave_packet) s_seqr ;
function new(string name = "axi_virtual_base") ;
super.new(name) ;
endfunction
endclass : axi_virtual_base
///////////////////////////////////////////////////////////////////////////////////////////
/////////////// virtual sequence class extended from virtual sequence base class //////////
///////////////////////////////////////////////////////////////////////////////////////////
class axi_virtual_sequence extends axi_virtual_base ;
`uvm_object_utils(axi_virtual_sequence)
function new(string name = "axi_virtual_sequence");
super.new(name);
endfunction
axi_master_sequence_reset ms_reset ;
axi_slave_sequence_reset ss_reset ;
task body() ;
ms_reset = axi_master_sequence_reset::type_id::create("ms_reset") ;
ss_reset = axi_slave_sequence_reset::type_id::create("ss_reset") ;
fork
ms_reset.start(m_seqr) ; // NEED
ss_reset.start(s_seqr) ; // HELP HERE
$display ("@time -> %0t in virtual test case fork-join",$time) ; // THE SIMULATION STOPS WITH THE ABOVE MENTION FATAL ERROR.
join
$display ("@time -> %0t out from fork-join",$time) ;
endtask : body
endclass : axi_virtual_sequence
/////////////////////////////////////////////
/////////// base test code //////////////////
/////////////////////////////////////////////
class axi_test_base extends uvm_test;
`uvm_component_utils(axi_test_base)
axi_environment h_env ;
function new(string name = "axi_test_base", uvm_component parent = null);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase) ;
h_env = axi_environment::type_id::create("h_env",this) ;
endfunction : build_phase
/////// initialization of sequencer handles ///////////
virtual function void init_vseq(axi_virtual_base avb) ;
avb.m_seqr = h_env.agn1.m_sequencer ;
avb.s_seqr = h_env.agn2.m_sequencer ;
endfunction : init_vseq
///////// base run phase is empty ////////////////////
virtual task run_phase(uvm_phase phase) ;
uvm_report_info(get_full_name(),"run",UVM_LOW) ;
phase.raise_objection(this) ;
phase.drop_objection(this) ;
endtask : run_phase
endclass : axi_test_base
////////////////////////////////////////////////////////////////////////////
//////////////// test case extended from base test - reset /////////////////
////////////////////////////////////////////////////////////////////////////
class axi_test_case_reset extends axi_test_base ;
`uvm_component_utils(axi_test_case_reset)
axi_virtual_sequence avs ;
function new(string name = "axi_test_case_reset", uvm_component parent = null) ;
super.new(name, parent) ;
endfunction
task run_phase(uvm_phase phase) ;
uvm_report_info(get_full_name(),"run",UVM_LOW) ;
avs = axi_virtual_sequence::type_id::create("avs") ;
phase.raise_objection(this) ;
init_vseq(avs) ; ////// calling initialization function in base test ///////
avs.start(null) ; ////// starting the virtual sequence ////////
phase.drop_objection(this) ;
endtask : run_phase
endclass : axi_test_case_reset