Rsp_port and seq_item_port in UVM?


Case 1:  

        seq_item_port.get_next_item(req);
 seq_item_port.item_done(rsp);       

…..             

…..                                                         // Drive transaction on the interface and sample response / read data

…..

rsp_port.write(rsp);                          // Sending the response sampled from the bus to the Sequencer in parallel


Case 2: 

             seq_item_port.get_next_item(req);  // Get the transaction packet from Sequencer

…..             

…..                                                            // Drive transaction on the interface and sample response / read data

…..

seq_item_port.item_done(rsp);        // Send the response packet to Sequencer


I want to send the response from Driver to the sequence back. Which of the above is best to be implemented and what is the difference.

In reply to Arun_Rajha:

You missed cas3:
seq_item_port.get(req);

seq_item_port.put(rsp);

Case 3 can be used in case of pipelined or out-of-order transactions.

In your case 1 you are sending the rsp back twice, i.e. with item_done(rsp) and through the rsp_port. Doing this is not a good idea.

In reply to chr_sue:

Hi chr_sue,
Can you please give a scenario for Case 3.(may be with AHB in terms pipelined transactions)

In reply to Arun_Rajha:

Please look here:
https://verificationacademy.com/cookbook/driver/pipelined