English
Language : 

DS824 Datasheet, PDF (43/55 Pages) Xilinx, Inc – LogiCORE IP AXI Bus Functional Models (v3.00.a)
LogiCORE IP AXI Bus Functional Models (v3.00.a)
cdn_axi4_streaming_example_test1.vhd to cdn_axi4_streaming_example_test6.vhd
The example test (simulation/ cdn_axi4_streaming_example_test1.vhd to
cdn_axi4_streaming_example_test6.vhd) contains the master and slave test code to simulate the following
scenarios (scenario#1 is covered in Test1, scenario#2 in Test2 and so on):
1. Simple master to slave transfer example
2. Looped master to slave transfers example
3. Simple master to slave packet example
4. Looped master to slave packet example
5. Ragged (less data at the end of the packet than can be supported) master to slave packet example
6. Packet data interleaving example
Useful Coding Guidelines and Examples
Loop Construct Simple Example
While coding directed tests, “for loops” are typically employed frequently to efficiently generate large volumes of
stimulus for both the master and/or slave BFMs. For example:
for (m=0;m<2;m =m+1) begin // Burst Type variable
for (k=0;k<3;k=k+1) begin // Burst Size variable
$display(“--------------------------------------------------”);
$display(“EXAMPLE TEST LOCKED and NORMAL “);
$display("--------------------------------------------------");
for (i=0; i<16;i=i+1) begin // Burst Length variable
tb.master_0.WRITE_BURST(mtestID+i, // Master ID
mtestAddr, // Master Address
i,
// Master Burst Length
k,
// Master Burst Size
m,
// Master Access Type FIXED, INCR
`LOCKED_TYPE_FIXED, // Use define
4'b0000,
// Buffer/Cachable Hardcoded
3'b000,
// Protection Type Hardcoded
test_data[i],// Write Data from array
response, // response from slave
end
end
end
This “for loop” cycles through the following stimulus:
• Access Type (m): FIXED, INCR
• Burst Size (k): 1_BYTE, 2_BYTES, 4_BYTES
• Burst Length (i): 1 to 16
Nested for loops can be used to generate numerous combinations of traffic types, but care must be taken to not
violate protocol. The AXI BFMs check the input parameters of the API calls, but this does not prevent higher level
protocol being violated.
Loop Construct Complex Example
In some cases, a nested for loop can lead to invalid stimulus if not used correctly. A good example of this is WRAP
bursts. The AXI Specification requires that WRAP bursts must be 2, 4, 8, or 16 transfers in length. For this type of
burst, the nested for loop from the Loop Construct Simple Example cannot be used because the nested for loop
DS824 July 25, 2012
www.xilinx.com
43
Product Specification