UVM Sequence Hanging

Hi,

I have developed an agent which I have integrated in a already existing env which has many sub envs and agents.

I have developed a simple sequence to run on this agent, using start_item, finish_item etc.
But when I start my sequence from the test, the test is hanging after reaching body task of the sequence.

What can be the reason for this?
I have confirmed that driver and sequencer is connected and driver has get_next_item and item_done in the main_phase.

Please suggest possible reasons.

Thanks in advance.
Jithin

What statement in the body of your sequence is it hanging on? Have you tried single-stepping or setting breakpoints?

In reply to dave_59:

Hi Dave, Please find the code snippets below:

 
//============Sequence====================================
 pv_item_o=new();
 repeat(10)
 begin
    start_item(pv_item_o);
    pv_item_o.randomize();
    finish_item(pv_item_o);
 end

//===========Connect phase in Agent=======================  
  driver_o.seq_item_port.connect(sequencer_o.seq_item_export);

//============Main Phase in driver ========================
  virtual task main_phase(uvm_phase phase);
    $display("======:DBG:=======IN PV DRIVER:MAIN:"); 
    
    forever 
    begin  
     seq_item_port.get_next_item(req);
     drive_dut();
     #10;
     seq_item_port.item_done();
   end

   endtask

//=============Testcase : starting Seq==================
pv_seq.start(env.usbav_env_o.pv_agent_o.sequencer_o);

//==============================================================

It is entering inside the sequence body task, but driver is not getting the item.

I am also facing the same issue. My code structure is exactly same as Jithin’s code structure.
Could you please help with this issue?

Thanks
Priyanka

In reply to Priyanka Kukade:

Not really enough code to help you. If you set a breakpoint on the get_next_item(req) line, does it hit it?

In reply to dave_59:

hi,

what if we change it to get_next_item(pv_item_o),will it work…
really its intresting question and may i know solun for this.

Regards,
Ramesh Sedam

HI.
By default REQ is uvm_sequence_item.
If you have
class my_driver extends uvm_driver;
The req will be uvm_sequence_item as well as in the seq_item_port.
so you will need
squence_item_port.get_next_item(req);
$cast ( myitem, req ) // or $cast ( myitem, req.clone()) depends on what you do.

Or you will need
class my_seqr extends uvm_sequencer#(myitem);
and
class my_driver extends uvm_driver #(myitem);

In reply to aming:

Hi Aming,

I had similar problem here.

I’m using class my_seqr extends uvm_sequencer#(myitem); and class my_driver extends uvm_driver #(myitem); with the req variable name as a sequence item. However, when I try to access the item variables (for instance req.data), I get data = null. But when I breakpoint at the seq_item_port.get(req); the req item is fetched successfully.

The only solution to this problem was changing the name of the req to whatever. Maybe as you suggested req is uvm_sequence_item base variable and some casting is needed.

I’m working with UVM for just a few days, so I’m just suggesting and sharing my experience.

Thanks
Victor