Problem with driver

Hello everyone,
This is my first post :D

I have problem with loosing first transaction when i call function that starts sequence (from test).

task dti_s_master_driver::drive_write(input dti_s_item it);
seq_item_port.get_next_item(it);
`uvm_info(“DTI_S_MASTER_DRIVER”, “Get next item”, UVM_HIGH);
if(it.first)
@mp_p.cb_master;

mp_p.cb_master.data <= it.data;
mp_p.cb_master.dvalid <= it.dvalid;
mp_p.cb_master.eot <= it.eot;
forever begin
@mp_p.cb_master;
if (mp_p.cb_master.dready || !mp_p.cb_master.dvalid)
break;
end
`uvm_info(“DTI_S_MASTER_DRIVER”, “Driving transaction”, UVM_HIGH);
seq_item_port.item_done();
endtask : drive_write

Problem is that i need this part where the first transaction of the test must have field first set to 1 otherwise i will loose it.
if(it.first)
@mp_p.cb_master;

every time i have some delay defined in test (something like #100ns; or at the begining of the test) i have to set field first to 1 to add 1 additional clock delay before set of transactions is sent. And if i dont have it i am missing first transaction of the sequnce. It seems that at same simulation time 1st and 2nd transaction is executed and 1st one is not sent because it is written with 2nd.

Can someone explain to me what I am missing.

In reply to basen:

Your explanation Sound a Little bit confusing. You shoule never set a delay in your test. This is not needed and might generate Trouble when executing your transactions in your driver.

BTW you are inserting only a delay by 1 clock edge only if it.first is true. Is this correct?

In reply to chr_sue:

Ok. i have this in test

  #100ns;
 	dti_sWrite(
	._sqcr(env.dti_s_master_agnt.sqcr),
	._data(200),
	._dvalid('1),
	._eot('0),
            ._first('1)
	);  

for(int i = 0; i < 3; i++) begin
dti_sWrite(
._sqcr(env.dti_s_master_agnt.sqcr),
._data(100),
._dvalid('0),
._eot('0),
._first('0)
);
end

dti_sWrite function starts sequence on sequencer. In this case sequence contains only one transaction.
In case when i have delay like i posted above #100ns;
Driver only sends 3 transactions instead of 4. So to avoid that i set first to 1:

if(it.first)
@mp_p.cb_master;

only for first transaction.
And it happens every time at the beggining of the test or when i have delay like above.

In reply to chr_sue:

Ok. i have this in test

  #100ns;
 	dti_sWrite(
	._sqcr(env.dti_s_master_agnt.sqcr),
	._data(200),
	._dvalid('1),
	._eot('0),
            ._first('1)
	);  

for(int i = 0; i < 3; i++) begin
dti_sWrite(
._sqcr(env.dti_s_master_agnt.sqcr),
._data(100),
._dvalid('0),
._eot('0),
._first('0)
);
end

dti_sWrite function starts sequence on sequencer. In this case sequence contains only one transaction.
In case when i have delay like i posted above #100ns;
Driver only sends 3 transactions instead of 4. So to avoid that i set first to 1:

if(it.first)
@mp_p.cb_master;

only for first transaction.
And it happens every time at the beggining of the test or when i have delay like above.

In reply to basen:

In the test you should start a sequnce on a sequencer, like this:

seq.start(sequencer);

For more Details see here:
https://verificationacademy.com/cookbook/sequences