AN 690: PCI Express* Avalon® -MM DMA Reference Design

ID 683824
Date 5/08/2017
Public

1.6.4. Running the Software

Complete the following steps to run the DMA software:

  1. In a terminal window change to the directory in which you installed the Linux driver.
  2. Type su.
  3. Type your super user password.
  4. Type make to compile the driver and application.
  5. Type ./install to install the driver.
  6. To run the DMA driver, type ./run.
    The driver prints out the commands available to specify the DMA traffic you want to run. By default, the software enables DMA read, DMA write, and Simultaneous DMA reads and writes.
    Table 11.   Available Commands for DMA Operation

    Command

    Operation

    1

    Start the DMA

    2

    Enable or disable read DMA

    3

    Enable or disable write DMA

    4

    Enable or disable simultaneous read and write DMAs

    5

    Set the number of dwords per DMA. The allowed range is 256-4096 dwords

    6

    Set the number of descriptors. The allowed range is 1-127 descriptors.

    7

    Set the Root Complex source address offset. This address must be a multiple of 4.

    8

    Run a loop DMA.

    10

    Exit.

  7. To start the DMA, type 1. This runs the DMA for one loop. Type 8 to run the DMA in a loop.

The following figure shows the performance for DMA reads, DMA writes, and simultaneous DMA reads and writes.

Figure 3. Output from 256-Bit DMA Driver
Understanding Throughput Measurement

To measure throughput, the software driver takes two timestamps. Software takes the first timestamp shortly after the you type the Start DMA command. Software takes the second timestamp after the DMA completes and returns the required completion status, EPLAST. If read DMA, write DMA and simultaneous read and write DMAs are all enabled, the driver takes six timestamps to make the three time measurements.

This DMA performance testing used the following PCIe Gen3 x8 in the system:

  • Motherboard: Asus PBZ77-V
  • Memory:   Corsair 8 GB 2 dimm x [4GB (2x2GB)] @ 1600 MHz
  • CPU:
    • Vendor_ID: GenuineIntel
    • CPU family: 6
    • Model: 58
    • Model name: Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz
    • Stepping: 9
    • Microcode: 0xc
    • CPU MHz: 3101.000
    •  Cache size: 6144 KByte