Waiting events, Wait_on(), Example 2-3. slave test program using – Altera Mentor Verification IP Altera Edition AMBA AXI3/4TM User Manual
Page 41

SystemVerilog API Overview
Waiting Events
Mentor VIP AE AXI3/4 User Guide, V10.2b
23
September 2013
// By default the execution of a transaction will block
bfm.execute_transaction(write_trans);
For example, to execute a slave write response phase, the slave BFM test program contains the
following code:
// By default the execution of a transaction will block
bfm.execute_write_response_phase(slave_trans);
Waiting Events
Each BFM API has tasks that block the test program code execution until an event has occurred.
task blocks the test program until an ACLK or ARESETn signal event has
occurred before proceeding.
get*_transaction(), get*_burst(), get*_phase(), get*_cycle()
code execution until a complete transaction, burst, phase or cycle has occurred, respectively.
wait_on()
For example, a BFM test program can wait for the positive edge of the ARESETn signal using
the following code:
// Block test program execution until the positive edge of the clock
bfm.wait_on(AXI_RESET_POSEDGE);
Note
The above test program code segments are for AXI3 BFMs. Substitute the
AXI_RESET_POSEDGE enumeration with AXI4_RESET_POSEDGE for AXI4 BFMs.
get*_transaction(), get*_burst(), get*_phase(), get*_cycle()
For example, a slave BFM test program can use a received write address phase to form the
response of the write transaction. The test program gets the write address phase for the
transaction by calling the
task. This task blocks until it has received the
address phase, allowing the test program to call the
execute_write_response_phase()
the transaction at a later stage, as shown in the slave BFM test program in
Example 2-3. Slave Test Program Using
slave_trans = bfm.create_slave_transaction();
bfm.get_write_addr_phase(slave_trans);
...
bfm.execute_write_response_phase(slave_trans);