
Mentor VIP AE AXI3/4 User Guide, V10.2b
138
SystemVerilog Tutorials
Verifying a Slave DUT
September 2013
A top-level file instantiates and connects all the components required to test and monitor the
DUT, and controls the system clock (ACLK) and reset (ARESETn) signals.
AXI3 BFM Master Test Program
Using the AXI3 master BFM API, this Master Test Program creates a wide range of stimulus
scenarios that test the slave DUT. This tutorial restricts the stimulus to a write transaction
followed by a read transaction to the same address to compare the read data with the previously
written data. For a complete code example of this Master Test Program, refer to SystemVerilog
AXI3 Master BFM Test Program in Appendix B.
Configuration and Initialization
The code excerpt in Example 6-1 shows the Master Test Program defining nine transaction
variables, trans, and trans1 to trans8, of type axi_transaction, which hold the transaction record
for each transaction. A timeout transaction field is configured in the AXI3 Master BFM before
waiting for the system reset to be completed. An additional system clock cycle is waited on after
reset to satisfy the AXI3 protocol requirement specified in Section 11.1.2 of the AMBA AXI
Protocol Specification, before executing transactions.
Example 6-1. Configuration and Initialization
initial
begin
axi_transaction trans trans1, trans2, trans3, trans4;
axi_transaction trans5, trans6, trans7, trans8;
/******************
** Configuration **
******************/
begin
bfm.set_config(AXI_CONFIG_MAX_TRANSACTION_TIME_FACTOR, 1000);
end
/*******************
** Initialization **
*******************/
bfm.wait_on(AXI_RESET_0_TO_1);
bfm.wait_on(AXI_CLOCK_POSEDGE);
Write Transaction Creation and Execution
To generate AXI3 protocol traffic, the Master Test Program must create the transaction trans
before executing it. The code excerpt in Example 6-6 calls the create_write_transaction()
function, providing only the start address argument of the transaction. The optional burst-length
argument automatically defaults to a value of zero—indicating a burst length of a single beat
(refer to “Master BFM Configuration” on page 34 for more details).
Commenti su questo manuale