F-Tile Avalon® Streaming IP for PCI Express* Design Example User Guide
ID
683372
Date
10/20/2025
Public
3.8.2. Running the SR-IOV Design Example
Before you can test the design example in hardware, you must enable SR-IOV and ARI (Alternative Routing ID Interpretation) in the BIOS, configure the FPGA, and then restart your computer to allow the enumeration to take place for the PCIe device. After that, install the Linux kernel driver as described in Installing the Linux Kernel Driver.
Here are the steps to test the SR-IOV design example on hardware:
- In the host system, navigate to the ./software/user/example directory of the software driver.
- Compile the design example software application by running the make command: $ make.
- Run the test by running the following command: $ sudo ./intel_fpga_pcie_link_test.
- Select Option 1: Manually Select a Device to specify the Bus-Device-Function (BDF) of the Physical Function (PF) to which the Virtual Functions (VFs) are assigned.
- Enter BAR “0” to proceed to the test menu.
- Enter option 7 to enable SR-IOV for the current device.
- Enter the number of virtual functions to be enabled for the current device.
Figure 29. Link Test Menu
Note: To disable VF for the current device, repeat Step 6: Select option 7 to enable SR-IOV, enter 0 for the number of VFs to be enabled.Note: Type 'lspci -d 1172:' in a new terminal to determine the BDFs of the newly enabled VFs. - In a new terminal, run the
sudo lspci –d 1172: | grep -c “Altera”
command to verify the enumeration of PFs and VFs. The expected result is the sum of the number of physical functions and number of virtual functions. In this example, there are 2 PFs and 32 VFs are enabled for each PF. Running this command returns 66 as shown in the figure below.Figure 30. lspci command
- Enter option 8 to perform a link test for every enabled virtual function allocated for the physical function. The link test application performs 100 memory writes with a single dword of data each and then reads the data back for checking. The application prints the number of virtual functions that failed the link test at the end of the testing.
Figure 31. Test Result