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.