Uvm_driver: wait statement or iff statement. which is better

I have this task inside my driver to drive valid and data and wait for ready to be high. Typical ready valid protocol. Below are my questions:

Q1: I would like to know which is the better way of waiting for the ready signal. Line 7 and Line 8.
wait(vif.driver_cb.ready) or (@vif.driver_cb iff !vif.driver_cb.ready);

Q2: is there a difference between these two?

Q3: does wait(vif.driver_cb.ready) advances the simulation time if ready == 1 all the time?


[0] virtual task drive_transfer (my_seq_item t);
[1]     my_vif.driver_cb.valid <= 0;
[2]     my_vif.driver_cb.wdata <= 0;
[3]     @(my_vif.driver_cb);
[4]     foreach(t.wdata[i]) begin
[5]       my_vif.driver_cb.valid <= 1;
[6]       my_vif.driver_cb.wdata <= t.wdata[i];
[7]       wait(vif.driver_cb.ready)
[8]       //(@vif.driver_cb iff !vif.driver_cb.ready);
[9]     end
[10]endtask

In reply to rlraj_2020:

The level sensitive event control wait behaves very differently from the discrete event control ‘@’.

A wait construct conditionally suspends a process waiting for an expression to become true. If the expression is already true, then their is no suspension of the process and the behavior is as if the statement was never there.

The ‘@’ construct always suspends the process. It resumes once it sees the event being triggered. That means execution of the ‘@’ construct must precede the event trigger.

When using clocking block variables, it is best to only use @cb event controls and not mix any other kinds of event constructs. Your driver code probably should be written as:

virtual task drive_transfer (my_seq_item t);
     my_vif.driver_cb.valid <= 0;
    my_vif.driver_cb.wdata <= 0;
     @(my_vif.driver_cb iff vif.driver_cb.ready);
     foreach(t.wdata[i]) begin
        my_vif.driver_cb.valid <= 1;
        my_vif.driver_cb.wdata <= t.wdata[i];
     end
endtask

But you have not provided enough information about how the protocol needs to behave.

In reply to dave_59:

Thank You. so do @(my_vif.driver_cb) while (!my_vif.driver_cb.ready)

This older thread was also helpful
https://verificationacademy.com/forums/uvm/wait-statement-inside-driver