Quartus® Prime software,
you can generate a programmed I/O (PIO) design example for the
Hard IP for
PCI Express® IP core. The generated design
example reflects the parameters that you specify. The PIO example transfers data from a host
processor to a target device. It is appropriate for low-bandwidth applications. This design
example automatically creates the files necessary to simulate and compile in the
Quartus® Prime software. You can download the compiled
design to the
Stratix® 10-GX FPGA Development Board.
To download to custom hardware, update the
Settings File (.qsf) with the correct pin assignments
Figure 1. Development Steps for the Design Example
Figure 2. Block Diagram for the Platform Designer PIO Design Example
Figure 3. Directory Structure for the Generated Design Example
Generating the Design Example
Follow these steps to generate your
Figure 4. Procedure
Quartus® Prime Pro Edition
software, create a new project (File > New Project Wizard).
Specify the Directory,
Name, and Top-Level
For Project Type,
accept the default value, Empty project.
For Add Files click
For Family, Device & Board
Settings under Family,
Stratix® 10 and the Target Device
for your design.
In the IP Catalog locate and add the
Stratix® 10Hard IP for
In the New IP Variant
dialog box, specify a name for your IP.
On the IP Settings
tabs, specify the parameters for your IP variation.
On the Example Designs
tab, make the following selections:
For Available Example
Designs, select PIO.
For Example Design
Files, turn on the Simulation and Synthesis options.
If you have selected a x16 configuration, for
Select simulation Root Ccomplex
BFM, choose the appropriate BFM:
BFM: for all configurations up to Gen3 x8. This
bus functional model (BFM) supports x16 configurations by
downtraining to x8.
For Generated HDL
Format, only Verilog is available in the current
For Target Development
Kit, select the appropriate option.
Note: If you select None, the generated design example targets the
device specified. If you intend to test the design in hardware, make
the appropriate pin assignments in the .qsf file.
Select Generate Example
Design to create a design example that you can simulate and
download to hardware. If you select one of the
Stratix® 10 development boards, the device on that board overwrites the
device previously selected in the
project if the devices are different. When the prompt asks you to specify the
directory for your example design, accept the default directory, <example_design>/pcie_s10_hip_ast_0_example_design
Figure 5. Example Design Tab
Click Finish. Save
your .ip file when prompted.
The prompt, Recent changes have
not been generated. Generate now?, allows you to create files
for simulation and synthesis of the design example. Click No to simulate the testbench design example you
have generated. The .sof file for the
complete example design is what you download to a board to perform hardware
USER_DEFINED_SIM_OPTIONS="" USER_DEFINED_ELAB_OPTIONS ="-timescale\
A successful simulation ends with the following message,
"Simulation stopped due to successful completion!"
This testbench simulates up to x8 variants. It supports x16
variants by down-training to x8. To simulate all lanes of a x16 variant, you can create a
simulation model using the Platform Designer to use in an Avery
testbench. For more information refer to AN-811: Using the Avery BFM
PCI Express® Gen3x16 Simulation on Intel Stratix 10
The simulation reports, "Simulation stopped due to successful completion" if
no errors occur.
In addition, you can use the driver to change the value of the
The selects device by specifying the bus, function and device
(BDF) numbers for the required device
The driver also allows you to enable SR-IOV for H-Tile
Complete the following steps to install the kernel
Navigate to ./software/kernel/Linux under the example design generation
Change the permissions on the install, load, and unload
$ chmod 777 install load
Install the driver:
$ sudo ./install
Verify the driver installation:
$ lsmod | grep
intel_fpga_pcie_drv 17792 0
Verify that Linux recognizes the
PCIe® design example:
$ lspci -d 1172:000 -v | grep
Note: If you
have changed the Vendor ID, substitute the new Vendor ID for
Vendor ID in this
Kernel driver in use:
1 Throughout this user guide, the terms word,
DWORD and QWORD have the same meaning that they have in the PCI Express Base
Specification. A word is 16 bits, a DWORD is 32 bits, and a QWORD is 64
Running the Design Example Application
Navigate to ./software/user/example under the design example
Compile the design example application:
Run the test:
You can run the
Intel® FPGA IP
PCIe® link test in manual or automatic
In automatic mode, the application automatically selects
the device. The test selects the
PCIe® device with the lowest BDF by
matching the Vendor ID. The test also selects the lowest available BAR.
In manual mode, the test queries you for the bus,
device, and function number and BAR.
Stratix® 10-GX Development
Kit, you can determine the BDF by typing the following command:
$ lspci -d 1172
Here are sample transcripts for automatic and manual
Intel FPGA PCIe Link Test - Automatic Mode
0: Automatically select a device
1: Manually select a device
Opened a handle to BAR 0 of a device with BDF 0x100
0: Link test - 100 writes and reads
1: Write memory space
2: Read memory space
3. Write configuration space
4. Read configuration space
5. Change BAR
6. Change device
7. Enable SR-IOV
8. Quit program
Doing 100 writes and 100 reads . .
Number of write errors: 0
Number of read errors: 0
Number of DWORD mismatches: 0
Intel FPGA PCIe Link Test - Manual Mode
0: Automatically select a device
1: Manually select a device
Enter bus number:
Enter device number:
Enter function number:
BDF is 0x100
Enter BAR number (-1 for none):
Opened a handle to BAR 4 of a device with BDF 0x100
Functional Description for the Simple DMA Design Example
simulation testbench includes the following components:
Hard IP for PCI Express Endpoint with the Enable high performance
Avalon®-MM slave interface (HPTXS) parameter turned on.
PCIE_DMA_CONTROLLER_256: A DMA controller that receives control signals
from the DUT rxm_bar2 port. Drives the DUT high performance
Avalon®-MM slave interface (hptxs) using its
MEM1: An on-chip RAM that connects to the DUT RXM_bar0, an
MEM2: An on-chip RAM that connects to the PCIE_DMA_CONTROLLER_256
read and write master interfaces.
A testbench driver that configures the Root Port, Endpoint,
writes to Endpoint
memory, and programs
A testbench monitor that checks expected results.
Figure 7. Simple DMA Design Example
Serial Data Signals
This differential, serial interface is the physical link between
a Root Port and an Endpoint.
The PCIe IP Core supports 1, 2, 4, 8, or 16 lanes. Each
lane includes a TX and RX differential pair. Data is striped across all available
Table 2. 1-Bit Interface Signals . In the following table <n> is the number of lanes.
Transmit output. These signals are the serial outputs
of lanes <n>-1–0.
Receive input. These signals are the serial inputs of
Refer to Pin-out Files for Intel Devices for
pin-out tables for all Intel devices in .pdf,
.txt, and .xls
Transceiver channels are arranged in groups of six. For GX devices, the
lowest six channels on the left side of the device are labeled GXB_L0, the next group is
GXB_L1, and so on. Channels on the right side of the device are labeled GXB_R0, GXB_R1,
and so on. Be sure to connect the Hard IP for PCI Express on the left side of the device
to appropriate channels on the left side of the device, as specified in the Pin-out Files for Intel Devices.
There are no control registers for the PIO design example. The PCI Express Base Specification 3.0 defines a comprehensive set of
configuration, control, and status registers to control and debug the design example.
Document Revision History for the Intel Stratix 10 Avalon -ST Hard IP for PCIe Design Example User Guide
Intel Stratix 10 Avalon -ST Hard IP for PCIe Design Example User Guide Revision History
Made the following changes:
Added compilation support.
Added simulation support for NCSim.
Added Linux driver for hardware example.
Revised Generating the
Design topic to create a single .ip for
PCIe® instead of a complete
system design. Generating the testbench creates a design example
from the .ip .
Added web link to information on using the
Quartus Prime Pro v17.1 Stratix 10 ES Editions
Added support for Gen3 x16 Programmer Object
File (*.pof) generation
using a simplified design example.