Starting from version 12.3, WinDriver supplies a user-mode sample code of a diagnostic utility that demonstrates several features of Xilinx PCI Express cards with XDMA support.

The sample source code and the pre-compiled sample can be found in the WinDriver\xilinx\xdma directory.

Before running the diagnostic utility, make sure that DriverWizard is closed, to avoid a “resource overlap” error.

The <code>xdma_diag</code> utility

The xdma_diag utility

If you have a proper XDMA supporting device attached, the diagnostic utility might open it automatically on startup, as shown here. Otherwise, you can choose option 2 to try to open a device yourself.

Performing Direct Memory Access (DMA) tests
After choosing option 6, the user can either Perform a DMA transfer or Measure DMA Performance.
The DMA transfer option allows the user to actually read or write data from device.
The writing option prompts the user to type a hexadecimal 32 bit packet of data, and this packet is repeatedly written to the device’s memory, according to the user entered Number of packets to transfer.
The reading option prints out the contents of a certain memory area, according to the user entered FPGA offset.
A simple test can be:
1. Writing a certain 32 bit packet to the device’s memory.
2. Reading from the same offset and making sure whether the data previously written to the device is in fact the data that is now read.

XDMA Transfer example

XDMA Transfer example

The DMA performance option allows the user to test the speed of the device.
The user is prompted to choose a transfer direction (to device, from device, or simultaneous bi-directional transfers). Then the user is prompted to enter a buffer size for the each transfer that will be made during the test, and the test’s duration. Afterwards the test takes place and in the end of the test the results will be printed out.

XDMA Performance test example

XDMA Performance test example

The XDMA GUI utility
Starting from WinDriver version 12.5, WinDriver also supplies a GUI utility, based upon the same xdma_diag source code, showcasing the above mentioned DMA Transfer and DMA Performance tests.
The xdma_gui utility can be found in the WinDriver/xilinx/xdma/gui directory.
Similar to the console xdma_diag program, the xdma_gui utility will try to open an XDMA device automatically, and if it will fail then it will be required to first select and open an XDMA-supported device before being able to perform the tests.

The <code> xdma_gui </code> Utility

The xdma_gui Utility

DMA Transfer test in <code>xdma_gui</code>

DMA Transfer test in xdma_gui

DMA Performance in the xdma_gui Utility

XDMA code generation in DriverWizard
Starting from WinDriver version 12.5, DriverWizard allows generating a user-mode diagnostics program source code that is similar to the supplied xdma_diag program, by choosing Xilinx XDMA design from the Add device specific customization (optional) menu.

Code Generation with XDMA device specific customization

Code Generation with XDMA device specific customization