The AXI BFM IP comes together with examples and test benches that demonstrate the abilities of AXI3, AXI4, AXI4-Lite, and AXI4-Stream Master/Slave BFM pair. These examples can be used as a starting point to create tests for custom RTL design with AXI3, AXI4, AXI4-Lite and AXI4-Stream interface. The examples can be accessed from CORE Generator, IP Catalog—View by Function—AXI Infrastructure—AXI Bus Functional Model (Figure 1).

Figure 1. AXI BFM Examples in CORE Generator

The examples and test benches can be obtained by generating the AXI BFM IP available in the “AXI Infrastructure” or “Debug & Verification” folder of the CORE Generator IP catalog. When generated, the AXI BFM IP delivers the user-specified <component_name> directory. The directory includes a README.txt file that describes how to set up the simulation environment and run the examples (vendor-specific scripts, such as simulate_aldec, are available in the simulation/functional subfolder).

Let’s look at the first example available with the package, the AXI3 BFM example test bench and tests. As all the other examples from this package, this one has the AXI master is connected to a single AXI slave (Figure 2) to give a visibility into both master and slave sides of the code.

Figure 2. Example Test Bench and Test Case Structure

The example test (cdn_axi3_example_test.v) contains the master and slave code and uses direct tests to transfer data between the master and slave and simulate different scenarios such as simple, looped, and parallel write and read burst transfers. Figure 3 illustrates this example design hierarchy as it appears in Riviera-PRO 2016.10 (note that master_0 and slave_0 units have a lock sign since they are encrypted).

And the following master code does 3 sequential writes and reads in a for loop. The WRITE_BURST and READ_BURST are standard AXI BFM channel level API tasks (defined in AXI Bus Functional Model User Guide), and the rest are just service tasks performing routine checks.

Note that user control of the AXI BFMs is performed by making function calls to a specific AXI BFM core instance, using its hierarchical name. For example, the WRITE_BURST command initiates a write burst transaction with the tb.master_0 AXI Master BFM – stimulates the core to perform the write burst with the address, data, and other arguments.