PCI Express Reference Design

By the end of this tutorial you will have successfully used the SZG-PCIEX4 and a SYZYGY carrier board to initiate DMA transfers between your FPGA gateware and host PC. The steps will guide you through the process of generating the gateware, configuring your host system, bringing up your hardware, and successfully running the test procedure to validate your system.
This tutorial utilizes Xilinx’s DMA/Bridge Subsystem for PCI Express IP’s example design along with Xilinx’s provided example drivers. This tutorial will use the Ubuntu operating system, but Windows 10 drivers are also available.
Requirements:
Resources
- Xilinx PCI Express DMA Drivers and Software Guide for Linux and Windows (AR65444)
- DMA Subsystem for PCI Express (Product Page)
- XDMA GitHub repository Linux driver and application sources.
- Pins Reference
Top-Level Architecture

The DMA/Bridge Subsystem for PCI Express IP’s example design is generated by Vivado. The example design implements a 4KByte BRAM buffer that is read or written to via DMA. The PCIe signals travel through the Samtec cable to a SZG-PCIE4 connected to the PCIe slot on the motherboard of the HOST PC. Xilinx’s provided drivers/applications initiate the DMA transfers to and from the BRAM on the SYZYGY carrier device.
Tutorial
Create a New Vivado Project
- Open a New Vivado project.
- Select the device family for your Opal Kelly product.
- Configure the DMA/Bridge Subsystem for PCI Express IP from the IP wizard.
- Select a lane width of x4.
- Select the maximum link speed available through the GUI.
- Select Mode “Advanced”.
- Select the “GT Settings” tab.
- Select “true” for “Disable GT Channel LOC Constraint. See “Vivado IP Constraint Automation” under “Restrictions” at SZG-PCIEX4 for more information regarding why disabling the LOC constraints is necessary.
- All other settings can be kept at their default. Press “OK” to create the IP.
- Right click on the IP in the hierarchy view and select “Open IP Example Design”.
Make Board-Specific HDL Modifications
- Open up the example design’s constraint file.
- Remove the LOC constraints for ports
sys_rst_n
,sys_clk_p
, andsys_clk_n
. - Open your Opal Kelly board’s Pins page.
- Drop down the “DISPLAY OPTIONS” menu.
- Select “CONNECTOR”.
- Select the TXR4 port on your SYZYGY carrier board that will be used with the SZG-PCIEX4.
- Have available the “Pinout” section from SZG-PCIEX4.
- The following schematic nets and ports are to be connected:
PCIE_PERST_B_VIO
(net) =sys_rst_n
(port)PCIE_REFCLKP
(net) =sys_clk_p
(port)PCIE_REFCLKN
(net) =sys_clk_n
(port)
- Find the
Pin Num
from “Pinout” for the nets listed above. Find that pin’s row from thePIN
column from step 6 Use theFPGA PIN
listed to replace the removed constraints from step 2. - Follow the same procedure to add in the following constraints:
set_property LOC <FPGA PIN> [get_ports pci_exp_txp[0]]
set_property LOC <FPGA PIN> [get_ports pci_exp_txn[0]]
set_property LOC <FPGA PIN> [get_ports pci_exp_rxp[0]]
set_property LOC <FPGA PIN> [get_ports pci_exp_rxn[0]]
set_property LOC <FPGA PIN> [get_ports pci_exp_txp[1]]
set_property LOC <FPGA PIN> [get_ports pci_exp_txn[1]]
set_property LOC <FPGA PIN> [get_ports pci_exp_rxp[1]]
set_property LOC <FPGA PIN> [get_ports pci_exp_rxn[1]]
set_property LOC <FPGA PIN> [get_ports pci_exp_txp[2]]
set_property LOC <FPGA PIN> [get_ports pci_exp_txn[2]]
set_property LOC <FPGA PIN> [get_ports pci_exp_rxp[2]]
set_property LOC <FPGA PIN> [get_ports pci_exp_rxn[2]]
set_property LOC <FPGA PIN> [get_ports pci_exp_txp[3]]
set_property LOC <FPGA PIN> [get_ports pci_exp_txn[3]]
set_property LOC <FPGA PIN> [get_ports pci_exp_rxp[3]]
set_property LOC <FPGA PIN> [get_ports pci_exp_rxn[3]]
Code language: HTML, XML (xml)
11. Generate the bitstream.
Install Drivers
- Acquire the sources at the following Git repository: XMA
- Follow the README’s instructions for installation.
Power on Procedure
The PCIe device must be powered and available at the time the host PC enumerates the PCIe bus at power on. Follow the following procedure to configure your hardware correctly:
- Power-off all devices.
- Place the SZG-PCIEX4 into a capable PCIe slot on your host PC.
- Connect the provided Samtec cable between the SYZYGY connectors on the SZG-PCIEX4 and your SYZYGY carrier.
- Power-on your SYZYGY carrier.
- Program the PCIe DMA bitfile into your SYZYGY carrier.
- Power-on your host PC.
Run the Tests
- Run
sudo lspci -vvv
to see verbose information about the devices enumerated onto the PCIe bus of the host PC. The device will be enumerated under the name “Xilinx Corporation Device”. - Run the following Xilinx provided tests from the XMA Git repository:
run_tests.sh
perform_hwcount.sh