
SystemVerilog API Overview
Waiting Events
Mentor Verification IP AE AMBA AXI4-Stream User Guide, V10.3
27
April 2014
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 execution until an ACLK or ARESETn signal event
has occurred before proceeding.
The get_packet(), get_transfer() tasks block the test program code execution until a complete
stream packet, or transfer, has occurred.
wait_on()
Example 2-7 shows a BFM test program waiting for the positive edge of the ARESETn signal.
Example 2-7. Test Program Wait for Event
// Block test program execution until the positive edge of the
// ARESETn signal.
bfm.wait_on(AXI4STREAM_RESET_POSEDGE);
get_packet(), get_transfer()
Example 2-8 shows a slave BFM test program using the get_transfer() task to block until it has
received a data stream transfer.
Example 2-8. Slave Test Program get_transfer() Task
// Create a slave transaction.
trans = bfm.create_slave_transaction();
...
// Wait for a data stream transfer to occur.
bfm.get_transfer(trans, 0, last);
Access Transaction Record
Each BFM API has tasks that can access a complete or partially complete Transaction Record.
The set*() and get*() tasks are used in a test program to set and get information from the
transaction record.
The set*() and get*() tasks are not explicitly detailed within each BFM API chapter. The
simple rule for the task name is set_ or get_ followed by the name of the transaction field
to be accessed. Refer to “Transaction Record Fields” on page 24 for transaction field
name details.
Kommentare zu diesen Handbüchern