# Uvm\_driver of Request-ack protocol handshake

**URL:** <https://verificationacademy.com/forums/t/uvm-driver-of-request-ack-protocol-handshake/39239>\
**Category:** UVM\
**Tags:** UVM, Multiple-requests, UVM-Driver\
**Created:** [June 29, 2021, 12:24am UTC](https://verificationacademy.com/forums/t/uvm-driver-of-request-ack-protocol-handshake/39239 "2021-06-29T00:24:43Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dddvlsique](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@dddvlsique](https://verificationacademy.com/forums/u/dddvlsique)\
**Post date:** [July 4, 2021, 2:59pm UTC](https://verificationacademy.com/forums/t/uvm-driver-of-request-ack-protocol-handshake/39239/3 "2021-07-04T14:59:00Z")

</div>

_In reply to [bdreku](https://verificationacademy.com/forums/t/uvm-driver-of-request-ack-protocol-handshake/39239/2):_

Hello,

From above link ,I tried to write below piece of code of run\_phase of uvm\_driver ,Could you help me to consider all three cases

```verilog
task run_phase(uvm_phase phase);
  m_bfm.wait_for_reset();
 
  forever begin
    seq_item_port.get_next_item(req); // Start processing req item
    m_bfm.drive(req);
    seq_item_port.item_done(); // End of req item
  end

task wait_for_reset();
  @(posedge BUS.resetn);
endtask: wait_for_reset
 
task drive(bus_seq_item req);
  repeat (req.delay) begin // Delay between bus transactions
    @(posedge BUS.clk);
  end
 
   BUS.valid <= 1;
 
  
  while (BUS.ack != 1) begin
    @(posedge BUS.clk);
  end
   $cast(rsp, req.clone()); // Clone the req
  BUS.valid <= 0; // End the pin level bus transaction
endtask: drive

sequence_body

/ Corresponding version of the sequence body method
task body;
  req = bus_seq_item::type_id::create("req");
 
  repeat (limit) begin
    start_item(req);
    
    assert(req.randomize());
    finish_item(req);
    get_response(rsp);
    // The rsp handle points to the object that the driver has updated with response data
     end
endtask: body

```

---

_[View the full topic](https://verificationacademy.com/forums/t/uvm-driver-of-request-ack-protocol-handshake/39239)._
