Example: PerfTest

PerfTest Overview

The PerfTest example measures the performance of the AXI host interfaces on a FrontPanel AXI device and validates every byte it moves. It covers AXI-Lite, AXI-Full, and AXI-Stream, in both directions. Read is FPGA to host, and write is host to FPGA.

PerfTest runs two test suites:

  • Bandwidth tests move blocks of data and report the sustained data rate in MB/s.
  • Call rate tests issue many API calls and report how many calls per second the interface sustains.

Every transfer is checked against the expected data pattern. The check runs outside the timed window, so validation does not affect the reported rate. The suites always run unthrottled, so the rates reported are the highest the device reaches.

The example ships in two forms that drive the device the same way and run the same suites, so their results can be compared directly. The FrontPanel Platform app is the one to use for exploring individual transfers interactively. The command line app carries no user interface overhead, so it reports the highest bandwidth and call rate a device reaches, and it is the one to use to see what a device is capable of.

Test Patterns

Both suites exercise the same set of data patterns, chosen to stress different aspects of the link.

PatternDescription
CountSequential counter
LFSRPseudorandom sequence from a linear feedback shift register
Walking 1sA single set bit walking through the word
Walking 0sA single cleared bit walking through the word
HammerAlternating maximum transition pattern
Half A5Half-word A5 fill
NeighborAdjacent-bit coupling pattern
FixedConstant value

Bandwidth Modes

Each bandwidth mode runs the data port at a different speed, and each mode is a separate gateware bitfile. The bitfiles ship inside the sample, under the product name.

bitfiles/<product>/perftest-bwmode-<N>.bitCode language: HTML, XML (xml)

For example, bitfiles/SZG-HUB1450-AU10P/perftest-bwmode-3.bit. Both forms of the example load the bitfile for each mode they run, so no separate download from Pins Downloads is needed.

Only the modes your device supports are available. The highest read rate and the highest write rate can occur in different bandwidth modes, so running every supported mode is what shows the ceiling of the device. A mode the device does not support, or that has no bitfile, is skipped and the reason is printed.

Where to Find the Example

PerfTest is delivered in the FrontPanel Developer’s Kit. To extract it, open the FrontPanel Platform application and click Download Developer Kit in the lower left, then choose a destination folder. The example is placed at Examples/PerfTest under the extracted FrontPanel-DevKit-<version> folder, and contains the following.

ItemContents
FP-Platform/The PerfTest FrontPanel Platform application
Cxx/The command line application and its source
bitfiles/The gateware both forms load, shared so there is only one copy
PerfTest.exeThe prebuilt command line application
perftest-example.fppThe packaged Platform app

FrontPanel Platform App

An app version of the PerfTest example is provided as a FrontPanel Platform app, written in JS+HTML+CSS. This app is included in the FrontPanel Platform App Launcher. Its interface is the one shown at the top of this page.

To use the app:

  1. Choose a bandwidth mode at the top. Each mode lists its theoretical maximum per direction, where up is FPGA to host and down is host to FPGA. Only the modes your device supports are shown.
  2. Pick a tab, either Bandwidth Tests or Call Rate Tests.
  3. Select the interface type and set the sizes, either the transfer and segment size or the bytes per call and call count. The defaults are tuned to the selected mode.
  4. Click Read or Write to run a single test, or Run Test Suite to sweep every interface. Click Stop at any time to end a run.

Each run adds a row giving the measured rate, the settings used, and a Compare result from the automatic data validation. The peak for each interface is summarized above the table, and the whole table can be copied or downloaded.

Command Line App

The command line version of the app is built using the FrontPanel C++ API. A prebuilt PerfTest.exe ships with the sample, and the source is provided in the Cxx directory.

To build it from source, run make in the Cxx directory on Linux and macOS. On Windows, build the PerfTest project with Visual Studio.

The application finds its bitfiles in the bitfiles directory shipped alongside it, whether it was built by make or by Visual Studio, so no options are required.

PerfTest

With no options it runs every bandwidth mode the connected device supports and has a bitfile for.

A device is only accessible in one application at a time. Ensure the FrontPanel application is closed before running the example.

Usage: PerfTest [options]

Reports the highest bandwidth and call rate a device reaches. With no
options it runs every bandwidth mode the device supports and has a bitfile
for, and finds the bitfiles on its own.

Options:
  --mode <N>            Run only bandwidth mode N (1-7). Default: every mode
                        the device supports and has a bitfile for.
  --serial <S>          Target device serial number. Default: first available.
  --bitfiles-dir <DIR>  Directory holding the bitfiles, as
                        <DIR>/<product>/perftest-bwmode-<N>.bit.
                        Default: the bitfiles folder shipped with the sample.
  --output <FILE>       Write the run to FILE, exactly as it appears here.
  -h, --help            Show this help.

Examples:
  PerfTest
  PerfTest --mode 3 --output results.txt

Press Ctrl-C to stop a running test.Code language: HTML, XML (xml)

To run a single bandwidth mode and save the results, pass both options.

PerfTest --mode 3 --output results.txtCode language: CSS (css)

Example Output

The following run is from an SZG-HUB1450-AU10P. The device supports bandwidth modes 3 and 4, so mode 2 is skipped even though a bitfile for it is present. Only mode 3 is shown here.

---- Opal Kelly ---- PerfTest ----
FrontPanel API 6.0.0
Device: SZG-HUB1450-AU10P (2627001KKO)
Bandwidth modes: 3, 4
Bitfiles: .../Examples/PerfTest/bitfiles (modes 2, 3, 4)
Skipping mode 2: not supported by this device
  ↑ read (FPGA→Host)    ↓ write (Host→FPGA)

=== Bandwidth Mode 3 ===

Read/Write        Bytes per Call    Calls  Duration (s)  Calls/s
----------------  --------------  -------  ------------  -------
AXI-Stream Read           32,768      750         0.120    6,268
AXI-Stream Read            1,024      750         0.110    6,841
AXI-Stream Write          32,768      750         0.133    5,633
AXI-Stream Write           1,024      750         0.075   10,027
AXI-Lite Read             32,768      750         0.206    3,635
AXI-Lite Read                  4      750         0.072   10,423
AXI-Lite Write            32,768      750         0.253    2,965
AXI-Lite Write                 4      750         0.074   10,182
AXI-Full Read             32,768      750         0.123    6,097
AXI-Full Read              1,024      750         0.110    6,830
AXI-Full Write            32,768      750         0.130    5,783
AXI-Full Write             1,024      750         0.075    9,939

Read/Write        Pattern     Transfer Size (B)  Segment Size (B)  Throttle  Duration (s)  Data Rate (MB/s)  Compare
----------------  ----------  -----------------  ----------------  --------  ------------  ----------------  -------
AXI-Stream Read   LFSR               67,108,864        67,108,864      0/32         0.071               948  Pass
AXI-Stream Read   Count              67,108,864         4,194,304      0/32         0.072               935  Pass
AXI-Stream Read   Fixed              67,108,864         1,048,576      0/32         0.077               872  Pass
AXI-Stream Read   Half A5            67,108,864           131,072      0/32         0.137               490  Pass
AXI-Stream Read   Neighbor            8,388,608            16,384      0/32         0.078               108  Pass
AXI-Stream Write  Hammer             33,554,432        33,554,432      0/32         0.107               315  Pass
AXI-Stream Write  Walking 0s         16,777,216         4,194,304      0/32         0.054               311  Pass
AXI-Stream Write  Walking 1s         16,777,216         1,048,576      0/32         0.056               302  Pass
AXI-Stream Write  LFSR               16,777,216           131,072      0/32         0.068               246  Pass
AXI-Stream Write  Count               8,388,608            16,384      0/32         0.055               154  Pass
AXI-Lite Read     Fixed               1,048,576         1,048,576      0/32         0.006               185  Pass
AXI-Lite Read     Half A5               524,288           524,288      0/32         0.003               176  Pass
AXI-Lite Read     Neighbor              262,144           262,144      0/32         0.002               162  Pass
AXI-Lite Write    Hammer              1,048,576         1,048,576      0/32         0.009               120  Pass
AXI-Lite Write    Walking 0s            524,288           524,288      0/32         0.005               116  Pass
AXI-Lite Write    Walking 1s            262,144           262,144      0/32         0.002               108  Pass
AXI-Full Read     LFSR               67,108,864        67,108,864      0/32         0.071               948  Pass
AXI-Full Read     Count              67,108,864         4,194,304      0/32         0.072               938  Pass
AXI-Full Read     Fixed              67,108,864         1,048,576      0/32         0.077               872  Pass
AXI-Full Read     Half A5            67,108,864           131,072      0/32         0.138               488  Pass
AXI-Full Read     Neighbor            8,388,608            16,384      0/32         0.082               103  Pass
AXI-Full Write    Hammer             33,554,432        33,554,432      0/32         0.107               315  Pass
AXI-Full Write    Walking 0s         16,777,216         4,194,304      0/32         0.054               310  Pass
AXI-Full Write    Walking 1s         16,777,216         1,048,576      0/32         0.055               302  Pass
AXI-Full Write    LFSR               16,777,216           131,072      0/32         0.068               247  Pass
AXI-Full Write    Count               8,388,608            16,384      0/32         0.055               153  Pass

  Mode 3 measured peak
                  Bandwidth (MB/s)      Call rate (calls/s)
      Stream      ↑ 9483156,84110,027
      Full        ↑ 9483156,8309,939
      Lite        ↑ 18512010,42310,182Code language: JavaScript (javascript)

See Also