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

Page 41

Advertising
background image

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.

The

wait_on()

task blocks the test program until an ACLK or ARESETn signal event has

occurred before proceeding.

The

get*_transaction(), get*_burst(), get*_phase(), get*_cycle()

tasks block the test program

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

get_write_addr_phase()

task. This task blocks until it has received the

address phase, allowing the test program to call the

execute_write_response_phase()

task for

the transaction at a later stage, as shown in the slave BFM test program in

Example 2-3

.

Example 2-3. Slave Test Program Using

get_write_addr_phase()

slave_trans = bfm.create_slave_transaction();
bfm.get_write_addr_phase(slave_trans);

...

bfm.execute_write_response_phase(slave_trans);

Advertising