Send_request failed to cast sequence item

hi,

when I integrated vip and vip’s lagacy uvm testcase into testbench, met error, can you help me ? thanks.

UVM_FATAL @3.0ns: uvm_test_top.blkEnv.tester0.agent.sequencer [sequencer] send_request failed to cast sequence item.

debug information flag111 printed but flag222 not printed.

===================================================================================================

class control_item extends uvm_sequence_item
class start_app_item extends control_item

================================

typedef uvm_driver #(control_item) m_driver;

class agent extends uvm_agent;
uvm_sequencer #(control_item) sequencer;
m_driver driver;

function new(string name = “agent”, uvm_component parent =null);
super.new(name,parent);
endfunction

endclass

class my_sequence extends uvm_sequence #(control_item);

extern virtual task body();

endclass

task body();

start_app_item app_item;

$cast(app_item,create_item(app_item.get_type(),m_sequencer,“app_item”));
start_item(app_item);
$display(“======flag111======”);
finish_item(app_item);
$display(“======flag222======”);

endtask

In reply to hellolife:

the error may be due to the type difference between the type of app_item and type by which you parameterized the sequencer.

In reply to hellolife:

hi,
when I integrated vip and vip’s lagacy uvm testcase into testbench, met error, can you help me ? thanks.
UVM_FATAL @3.0ns: uvm_test_top.blkEnv.tester0.agent.sequencer [sequencer] send_request failed to cast sequence item.
debug information flag111 printed but flag222 not printed.
===================================================================================================
================================
class control_item extends uvm_sequence_item
class start_app_item extends control_item
================================
typedef uvm_driver #(control_item) m_driver;
class agent extends uvm_agent;
uvm_sequencer #(control_item) sequencer;
m_driver driver;

function new(string name = “agent”, uvm_component parent =null);
super.new(name,parent);
endfunction

endclass
class my_sequence extends uvm_sequence #(control_item);

extern virtual task body();

endclass
task body();

start_app_item app_item;
$cast(app_item,create_item(app_item.get_type(),m_sequencer,“app_item”));
start_item(app_item);
$display(“======flag111======”);
finish_item(app_item);
$display(“======flag222======”);

endtask

You have 2 weaknesses in your code:
(1) your driver is not simply a typedef of the uvm_driver, parameterized for yor the corresponding seq_item.
(2) You should construct you r seq_irem by using the type_id::create of the factory like this:

app_item = start_app_item::type_id::create("app_item");

In reply to chr_sue:

i have done by follow your (2) step to add app_item = start_app_item::type_id::create(“app_item”); but still same error exist. what was i missing or others . thanks

do you mean typedef uvm_driver #(control_item) m_driver; will not actually work? but this line is in vip,users should not modify it i think.

In reply to hellolife:

make sure that the test is running the my_sequence on the given sequencer.

In reply to voraravi:
hi can i or use some method to make clear that this sequence is running on the given sequencer?

In reply to hellolife:

I think we can just go into test class that we are currently executing, and check there that sequencer handle that we pass to the start method of sequencer is pointing to the given corresponding sequencer.