Support back to back transactions in UVM driver

In reply to AL_verif:
You can control it from the sequence by giving the constraints and you can make the driver as reusable


//sequence 

task body()
  req = item::type_id::create("req");
 // By Cange the loop limit you can control the no.of data to be driven continuously 
  repeat(10)
  begin
  start_item(req);
  assert(req.randomize() with{ valid == 1;});
  finish_item(req);
  end
  // After driving data making valid as 0
  start_item(req);
  assert(req.randomize() with{ valid == 0;});
  finish_item(req);
endtask

// Now in driver you need not to do any changes 
virtual task main_phase(uvm_phase phase);
   super.main_phase(phase);
 
   forever begin
      seq_item_port.get_next_item(req);
      drive_data(reg);
      seq_item_port.item_done();
   end
endtask : main_phase
 
 
// --------------------------------------
 
virtual protected task drive_data(item curr_item);
 
   // start transaction 
   @(posedge vif.clk);
   vif.valid <= 1;
   vif.data <= curr_item.data;
 

endtask:drive_data


Regards,
Shanthi
www.maven-silicon.com