I am trying to understand the wait statement better. I use the wait statement inside my driver before driving my transaction data as shown below -
task drive_trans (seq_item trans);
@(vif.driver_cb) // clocking block sampled at posedge of clk
wait (vif.driver_cb.trigger == 1); // If trigger is not high, wait for it to go high
vif.driver_cb.data <= trans.data; // push the data from the sequence onto the interface
endtask
My intention here is to push the transaction onto the interface only if âtriggerâ is high. This code seems to work. I do see that whenever the âtriggerâ is low the driver holds onto the previous transaction before pushing in the new transaction.
I would like to know if the wait statement introduces any simulation-time delay? My understanding is that the wait statement is a blocking statement that looks for the condition to be True during the current clock cycle. But I do see my simulation progress. Is this due to simulation time progressing in other parallel threads?
For my understanding, what exactly does â@(vif.driver_cb iff vif.driver_cb.trigger == 1â translate to? Am I right when I say âKeep executing @(vif.driver_cb) until vif.driver_cb.trigger equals 1â?
Does this also mean that in the case of trigger being equal to 1 when the code is hit, the execution skips the blocking statement @(vif.driver_cb)?