Peripheral Component Interconnect (PCI) has taken the Express lane long ago, moving to Gbps SerDes. Now for the first time in opensource on the Host side too. Our project roots for the Root Port in 4 ways: |1| openRTL |2| openBFM with unique SIM and WAVE capabilities, way better than vendor's |3| openSW stack |4| one-of-a-kind open backplane.
See the codeComputing is about communicating. Some would also say about networking. Digital independence tags along on the wave of "Recommendations and Roadmap for European Sovereignty in open source HW, SW and RISC-V Technologies (2021)", calling for the development of critical open source IP blocks, such as PCIE Root Complex (RC). This is the first step in that direction. And, if you are looking for an opensource, soft PCIE EndPoint (EP) core, please check our other repo.
This project opens Artix7 PCIE Gen2 RC IP blocks for use outside of proprietary tool flows. While still reliant on Xilinx Series7 Hard Macros (HMs), it surrounds them with open-source soft logic for PIO accesses — The RTL and, even more importantly, the layered software Driver with Demo App.
All that with full HW/SW opensource co-sim. Augmented with a rock-solid openBackplane in the basement of our hardware solution, the geek community thus gets all it takes for building their own, end-to-end openCompute systems.
The project‘s immediate goal, now accomplished, was to empower the makers with ability to drive PCIE-based peripherals from their own soft RISC-V SOCs.
Given that the PCIE End-Point (EP) with DMA is already available in opensource, the opensource PCIE peripherals do exist for Artix7. Except that they are always, without exception, controlled by the proprietary RC on the motherboard side, typically in the form of RaspberryPi ASIC, or x86 PC. This project changes that status quo.
Our long-term goal is to set the stage for the development of full opensource PCIE stack, gradually phasing out Xilinx HMs from the solution. That’s a long, ambitious track, esp. when it comes to mixed-signal SerDes and high-quality PLLs. We therefore anticipate a series of follow on projects that would build on the foundations hereby set.
This first phase implemented an open source PCIE Root Complex (RC) for Artix7 FPGA, utilizing Xilinx Series7 PCIE HM and GTP IP blocks, along with their low-jitter PLL.
The project relies on a modular hardware ecosystem that combines our custom-designed openPCIE Backplane with SQRL Acorn CLE-215+ FPGA modules and various PCIE adapters to create a flexible testing platform.
Please, refer to 1.pcb for additional detail, and to 1.pcb/KiCad-library for the self-contained KiCad library. Plain-text versions of the PDF and slide documents are in 0.doc/1.pcb.
The hardware platform for this project is the SQRL Acorn CLE-215+, a versatile FPGA development board. Although originally designed as a crypto-accelerator, its powerful Artix-7 FPGA and modular design make it an excellent choice for general-purpose PCIE development.
The system consists of two main components:
|
|
| M.2 FPGA Module (Top View) | M.2 FPGA Module (Bottom View) |
|
|
| PCIE Adapter Board (Top View) | PCIE Adapter Board (Bottom View) |
The fully assembled Acorn CLE-215+ development board, ready for use in a PCIE slot.
It is important to note that the Acorn CLE-215+ is functionally identical to the more widely known NiteFury board, with the primary difference being the amount of onboard memory. The Acorn model features 1 GB of DDR3 RAM, while the standard NiteFury has 512 MB. Therefore, the NiteFury schematic serves as a direct and accurate reference for the board's hardware layout.
The central component of the SQRL Acorn CLE-215+ system is the Xilinx Artix-7 XC7A200T-FBG484 chip. This FPGA is crucial for implementing the PCIE Root Complex - and, on the other card, the Endpoint - possessing a range of features that make it highly suitable for this purpose.
The key specifications are summarized below:
| Specification | Value |
|---|---|
| Family | Xilinx Artix-7 |
| Speed Grade | -3 |
| Logic Cells (LUT4-Equivalent)¹ | 215,360 |
| LUT6 | 134,600 |
| Flip-Flops | 269,200 |
| Block RAM | 13 Mbit |
| DSP Slices | 740 |
| GTP Transceivers | 4 (up to 6.6 Gbit/s) |
| DDR3 SDRAM (Board) | 1 GB, 16-bit |
| QSPI Flash (Board) | 32 MB |
| User LEDs | 4 |
| General Purpose IOs | 4 |
| LVDS Pairs | 4 |
¹ The 'Logic Cells' count is a Xilinx metric derived from the physical 6-input LUTs to provide an estimated equivalent in simpler 4-input LUTs for comparison purposes. The number of physical LUTs and other resources are the exact counts for the XC7A200T chip.
The opensource Root Complex RTL is a chain of blocks joined by SystemVerilog interfaces: the RISC-V SoC hands TLPs over AXI-Stream to the PCIE stack, which converts them for the PCIE_2_1 hard block and drives the GTP transceiver over PIPE.
Details are in the RTL README. Per design: common RTL, EP, RC-direct, RC-switched. The AMD/Vivado-IP reference designs are in 2.amd-rtl-with-Vivado-build (EP, RC-direct, RC-switched).
The software stack is designed to run bare-metal on the soft RISC-V SoC embedded within the FPGA. In a standard PC, the Operating System (Linux/Windows) manages PCIE enumeration automatically in the background, hiding the complexity from the developer. In this project, our baremetal open-source driver takes full control, manually performing every step of the enumeration process to act as the PCIE Host.
The architecture adopts a clean, well-defined, layered approach:
Application Layer (The "User" Logic):
PCIE Driver (Enumeration & Setup):
HAL (Hardware Abstraction Layer):
Note: This structure allows developers to treat PCIE devices just like any other local peripheral, abstracting away the complexities of the physical link.
Details are in the SW README.
The openPCIE test bench aims to have a flexible approach to simulation which allows a common test environment to be used whilst selecting between alternative CPU components, one of which uses the VProc virtual processor co-simulation element. This allows simulations to be fully HDL, with the RISC-V RTL core that goes into the bitstream (eduBOS5 by default, or PicoRV32), or to co-simulate software using the virtual processor, with a significant speed up in simulation times.
The test bench has the following features:
soc_cpu.VPROC.picorv32 component
make CPU=rtl|vproc|issMore details on the architecture and usage of the openPCIE test bench can be found in the README.md in the 5.sim directory.
The co-simulation can also be followed at TLP level in the WaveCrux waveform viewer, with an open-source PCIE TLP decoder plugin and a ready-made session -- here the firmware sizing BAR0 by readback and placing it at 0x80000000 (more):
One level down, Ferrite's PCIe PIPE and Data Link Layer decoders show the same link on the wire: link training, flow-control credits, and every TLP with its sequence number and Ack (more). With all three layers in one view, you can also see how long a TLP spends inside the hard macro: about 0.4 µs each way (more).
The openPCIE control and status register hardware abstraction layer (HAL) software is auto-generated, as is the CSR RTL, using peakrdl. A single SystemRDL specification, 4.build/csr_build/csr.rdl, describes the TLP transmit/receive window the RISC-V firmware drives, and everything else is derived from it: the register block RTL (csr.sv, csr_pkg.sv), which soc_csr.sv bridges to the picorv32 memory bus, and the software header. For co-simulation purposes an additional layer is auto-generated from the same SystemRDL specification using systemrdl-compiler that accompanies the peakrdl tools. This produces two header files that define a common API to the application layer for both the RISC-V platform and the VProc based co-simulation verification environment. The details of the HAL generation can be found in the README.md in the 4.build/ directory.
More details of the test bench, the pcievhost component and its usage can be found in the 5.sim/README.md file. See also the pcievhost model, its LTSSM support code, and the superseded DUT stubs.
The openPCIE implementation workflow is organized into several stages, covering the complete process from setting up the development environment to verifying the design on physical hardware.
Before building the project, install and configure the required development tools. These include an FPGA toolchain such as AMD Vivado or openXC7, a bare-metal RISC-V cross-compilation toolchain, Python, and the project-specific dependencies listed in the corresponding directories.
Before deploying the design to physical hardware, run the available simulation environment to verify the interaction between the PCIE hardware design and the software components.
The co-simulation flow is used to test essential operations such as device initialization, register access, PCIE link behavior, and data exchange between the Root Complex (RC) and Endpoint (EP). This stage helps identify hardware and software integration issues before synthesis and hardware deployment.
Compile the bare-metal RISC-V driver and test application using the configured cross-compilation toolchain, see 4.build/sw_build.
The software is responsible for initializing the required hardware components, configuring the PCIE communication flow, and transferring test payloads between the RC and EP. The generated executable can be used during simulation or deployed together with the FPGA design for hardware verification.
The FPGA design can be synthesized and implemented using either the commercial AMD Vivado toolchain or the open-source openXC7 toolchain. Depending on the selected flow, the process includes design elaboration, synthesis, placement, routing, timing analysis, and final bitstream generation.
The resulting .bit file contains the complete hardware configuration for the selected FPGA board. The appropriate board-specific constraints, build configuration, and target design must be selected depending on whether the board operates as the Root Complex (RC) or Endpoint (EP).
Detailed build instructions for both the Vivado and openXC7 flows are provided in the corresponding project directories.
Program the RC and EP FPGA boards with their corresponding bitstreams. After both designs have been loaded, start the software application and allow the boards to initialize the PCIE connection.
The deployed system can then be verified by checking the PCIE link-status indicators and comparing the transmitted payload with the data displayed or received on the Endpoint.
Detailed commands, configuration options, supported boards, and stage-specific instructions are provided in the corresponding project directories.
Properly programming and operating the Artix-7 FPGA on the SQRL board requires some soldering and work on open desktop motherboard.
The JTAG connector on the Acorn CLE-215+ is non-standard and not directly compatible with the standard 14-pin connector on the Xilinx Platform Cable. A custom adapter cable is therefore required.
|
|
| Custom JTAG Cable connecting the Xilinx Programmer to the board | JTAG Connector Pinout on the Board |
The connector on the board is a Molex Pico-Lock 1.50mm pitch male header. This is not a standard 2.54mm or 2.00mm header, so standard DuPont-style cables will not fit.
To simplify making the cable, we highly recommend purchasing a pre-assembled cable with the correct female connector.
This cable has the correct female connector on both ends. The easiest method is to cut the cable in half, which gives you two connector cables with open ends. You can then splice one of these cable ends onto the wires of your Xilinx programmer cable, matching the signals according to the following wiring diagram.
JTAG Connection Guide: Physical Pinout and Wiring Diagram.
The board cannot be programmed or operated solely from the PCIE/M.2 slot power. It requires an external 12V supply to function correctly, especially when complex designs and high-speed transceivers are active. Power is provided via a standard 6-pin PCIE power connector from an ATX power supply.
External 12V power connection.
The complete system, including the custom cabling, is mounted in a test PC chassis for verification.
The complete FPGA system mounted in a PCIE slot.
After the hardware was prepared, the connection was verified using the Vivado Hardware Manager. As shown below, the tool successfully detected the JTAG programmer and identified the xc7a200t_0 FPGA chip. This confirms that the physical connections are correct and the board is ready for programming.
Successful device detection in Vivado Hardware Manager.
Before interacting over PCIE, here is the complete bench validation setup used for the Direct (Point-to-Point) connection scenario. It features the openPCIE Backplane powered by an external 12V supply, populated with two Acorn CLE-215+ FPGA modules (one configured as RC, the other as EP).
Dual Xilinx Platform Cable USB units are connected via custom adapters to allow simultaneous debugging and bitstream loading from two separate host workstations.
The complete hardware validation environment for the Direct connection test.
We used a two-PC setup to streamline development:
Why this setup?
To bring up the system and verify the PCIE link, follow these steps:
The goal of this test is to verify that the Root Complex can successfully enumerate the link and perform both Memory Write and Memory Read transactions.
1. Visual Verification (LEDs) Visual feedback is provided via the 4 user LEDs on both FPGA boards:
2. Internal Signal Monitoring (ILA) Using the Vivado Integrated Logic Analyzer (ILA) on both PCs enables detailed monitoring of internal signals to see exactly what data was sent and received, its precise timing, and the low-level transaction details.
The implementation was verified on physical hardware by checking both PCIE link establishment and successful payload transfer between the Root Complex (RC) and Endpoint (EP).
On the RC board, LED A3 indicates the PCIE link status. When this LED is illuminated, the PCIE link has been successfully established. We can see that the LED A3 is active, confirming that the link between the RC and EP is up.
On the EP board, the LEDs display the received data payload. The RC transmitted the decimal value 6, represented in binary as 0110. The LED pattern on the EP matches this value, confirming that the payload was transferred and received correctly.
These results confirm that PCIE link initialization and RC-to-EP data transfer operate successfully on physical hardware.
|
|
| RC-LED-Link-Up | EP-LED-Data-Payload |
PCIE Protocol Analyzers
PART 1. Mini PCIE Backplane PCBAlmost all consumer PCIE installations have the RC chip soldered down on the motherboard, typically embodied in the CPU or "North Bridge" ASIC, where PCIE connectors are used solely for the EP cards. Similarly, all FPGA boards on the market are designed for EP applications. As such, they expect clock, reset and a few other signals from the infrastructure. It is only the professional and military-grade electronics that may have both RC and EP functions on add-on cards, with a backplane or mid-plane connecting them (see VPX chassis, or VITA 46.4).
This dev activity is about creating the minimal PCIE infrastructure necessary for using a plethora of ready-made FPGA EP cards as a Root Complex. This infrastructure takes the physical form of a mini backplane that provides the necessary PCIE context similarly to what a typical motherboard would give, but without a soldered-down RC chip that would be conflicting with our own FPGA RC node.
Such approach is less work and less risk than to design our own PCIE motherboard, with a large FPGA on it. But, it is also a task that we did not appreciate from the get-go. In a bit of a surprise, half-way through planning, we've realized that a suitable, ready-made backplane was not available on the market. This initial disappointment then turned into excitement knowing that this new outcome would make the project even more attractive / more valuable for the community... esp. when Envox.eu has agreed to step in and help. They will take on the PCIE backplane PCB development activity.
PART 2. Project setup and preparatory activitiesPART 3. Initial HW/SW implementationPART 4. HW/SW co-simulation using full PCIE EP modelThis dev activity is significantly beefed up compared to our original plan, which was to use a much simpler PCIE EP BFM, and non-SOC sim framework. While that would have reduced the time and effort spent on the sim, prompted by NLnet astute questions, we're happy to announce that wyvernSemi is now also onboard!
Their VProc can be used not only to faithfully model the RISC-V CPU and SW interactions with HW, but it also comes with an implementation of the PCIE model. The PCIE model has some EP capabilities with a configurable configuration space, which can be paired in sim with our RC RTL design. Moreover, the existence of both RC and EP models paves the way for future plug-and-play, pick-and-choose opensource sims of the entire PCIE subsystem.
With the full end-to-end simulation thus in place, we hope that the need for hardware debugging, using ChipScope, expensive test equipment and PCIE protocol analyzers would be alleviated.
PART 5. Integration, testing and iterative design refinementsPART 6. Prepare Demo and port it to openXC7Given that PCIE is an advanced, high-speed design, in the light of nextpnr-xilinx and openXC7 shortcomings when it comes to timing constraints and timing closure, we expect to run into showstoppers, and have therefore planned to experiment with WIP ScalePNR. In turned out that, with some corrections, the nextpnr-xilinx was good enough -- The bitstream built with it brings the link up at Gen2 speeds on hardware, the same as Vivado does. Getting there took six fixes - one latent bug in our RTL and five workarounds for openXC7 defects - all documented in 4.build/hw_build.openXC7, along with the issues we filed against openXC7.
The design has also been ported to, and tested with openXC7 1.0.0 edition, which was a major step forward and essentially what "ScalePNR" idea eventually evolved into. It brought to the forefront Yosys0.69 with integrated Slang, nextpnr-himbaechel (instead of nextpnr-xilinx) and fpga-as. With that, the earlier SV2V standalone prep step for our SystemVerilog design sources proved to be unnecessary, which simplified the build process. The SV2V option is however still retained for cross-tool checking.
openPCIE has served as the basis for a number of Master's theses at the Faculty of Electrical Engineering, University of Sarajevo (ETF Sarajevo). Among them are the theses of Anes Vrce and Aladin Brdar, the latter shown here presenting his work on the openPCIE platform, tapping into its hardware, software and simulation facets.
We are grateful to NLnet Foundation for their sponsorship of this development activity.
This project was funded through the NGI0 Core Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101092990.
The wyvernSemi's wisdom and contribution made a great deal of difference -- Thank you, we are honored to have you on the project.
The Envox, our next-door buddy, is responsible for the birth of our backplane, which we like to call BB (not to be mistaken for their gorgeous blue beauty BB3)
KiCad turns electrical idea into a manufacturable board. openXC7, with Yosys at its core, turns RTL into a loadable FPGA bitfile. PeakRDL turns our SystemRDL file into CSR RTL+headers+RegMap docs. WaveCrux greatly facilitates waveform decoding and viewing. But, that's not everything that made this project possible -- Thank you all for these wonderful opensource tools ✨.
Feel like helping opensource PCIE community grow better and larger?! See Contributions.
Don't feel shy to reach out and ask for help ===> .
Our next step is openPCIE3, a 24-lane Gen3 backplane with Optical Copper Link (OCuLink). It is built around the Diodes PI7C9X3G1224GP switch (PCIE 3.1, 24 lanes, 12 ports), and links one or two PCs, each over an x4 OCuLink cable, to four x4 EP connectors (two slots, two M.2).
Its main use is as a PC I/O extender, adding compute, storage or I/O cards, e.g. for opensource AI servers. The PC drives REFCLK and reset over the cable, so the board needs no local clock or reset generator. Design input is welcome in #9 and #13.
Our repo may contain elements of work facilitated by the modern GenAI tools , used under strict guidance and tight supervision of the blood-and-flesh developers, and solely as suggestions.
In the end, it is us, the human devs, who are fully responsible for any shortfalls you may uncover while tapping into repo resources.
1,003 followers · starred Apr 2025
104 followers · starred Oct 2026
Peripheral Component Interconnect (PCI) has taken the Express lane long ago, moving to Gbps SerDes. Now for the first time in opensource on the Host side too. Our project roots for the Root Port in 4 ways: |1| openRTL |2| openBFM with unique SIM and WAVE capabilities, way better than vendor's |3| openSW stack |4| one-of-a-kind open backplane.
See the codeComputing is about communicating. Some would also say about networking. Digital independence tags along on the wave of "Recommendations and Roadmap for European Sovereignty in open source HW, SW and RISC-V Technologies (2021)", calling for the development of critical open source IP blocks, such as PCIE Root Complex (RC). This is the first step in that direction. And, if you are looking for an opensource, soft PCIE EndPoint (EP) core, please check our other repo.
This project opens Artix7 PCIE Gen2 RC IP blocks for use outside of proprietary tool flows. While still reliant on Xilinx Series7 Hard Macros (HMs), it surrounds them with open-source soft logic for PIO accesses — The RTL and, even more importantly, the layered software Driver with Demo App.
All that with full HW/SW opensource co-sim. Augmented with a rock-solid openBackplane in the basement of our hardware solution, the geek community thus gets all it takes for building their own, end-to-end openCompute systems.
The project‘s immediate goal, now accomplished, was to empower the makers with ability to drive PCIE-based peripherals from their own soft RISC-V SOCs.
Given that the PCIE End-Point (EP) with DMA is already available in opensource, the opensource PCIE peripherals do exist for Artix7. Except that they are always, without exception, controlled by the proprietary RC on the motherboard side, typically in the form of RaspberryPi ASIC, or x86 PC. This project changes that status quo.
Our long-term goal is to set the stage for the development of full opensource PCIE stack, gradually phasing out Xilinx HMs from the solution. That’s a long, ambitious track, esp. when it comes to mixed-signal SerDes and high-quality PLLs. We therefore anticipate a series of follow on projects that would build on the foundations hereby set.
This first phase implemented an open source PCIE Root Complex (RC) for Artix7 FPGA, utilizing Xilinx Series7 PCIE HM and GTP IP blocks, along with their low-jitter PLL.
The project relies on a modular hardware ecosystem that combines our custom-designed openPCIE Backplane with SQRL Acorn CLE-215+ FPGA modules and various PCIE adapters to create a flexible testing platform.
Please, refer to 1.pcb for additional detail, and to 1.pcb/KiCad-library for the self-contained KiCad library. Plain-text versions of the PDF and slide documents are in 0.doc/1.pcb.
The hardware platform for this project is the SQRL Acorn CLE-215+, a versatile FPGA development board. Although originally designed as a crypto-accelerator, its powerful Artix-7 FPGA and modular design make it an excellent choice for general-purpose PCIE development.
The system consists of two main components:
|
|
| M.2 FPGA Module (Top View) | M.2 FPGA Module (Bottom View) |
|
|
| PCIE Adapter Board (Top View) | PCIE Adapter Board (Bottom View) |
The fully assembled Acorn CLE-215+ development board, ready for use in a PCIE slot.
It is important to note that the Acorn CLE-215+ is functionally identical to the more widely known NiteFury board, with the primary difference being the amount of onboard memory. The Acorn model features 1 GB of DDR3 RAM, while the standard NiteFury has 512 MB. Therefore, the NiteFury schematic serves as a direct and accurate reference for the board's hardware layout.
The central component of the SQRL Acorn CLE-215+ system is the Xilinx Artix-7 XC7A200T-FBG484 chip. This FPGA is crucial for implementing the PCIE Root Complex - and, on the other card, the Endpoint - possessing a range of features that make it highly suitable for this purpose.
The key specifications are summarized below:
| Specification | Value |
|---|---|
| Family | Xilinx Artix-7 |
| Speed Grade | -3 |
| Logic Cells (LUT4-Equivalent)¹ | 215,360 |
| LUT6 | 134,600 |
| Flip-Flops | 269,200 |
| Block RAM | 13 Mbit |
| DSP Slices | 740 |
| GTP Transceivers | 4 (up to 6.6 Gbit/s) |
| DDR3 SDRAM (Board) | 1 GB, 16-bit |
| QSPI Flash (Board) | 32 MB |
| User LEDs | 4 |
| General Purpose IOs | 4 |
| LVDS Pairs | 4 |
¹ The 'Logic Cells' count is a Xilinx metric derived from the physical 6-input LUTs to provide an estimated equivalent in simpler 4-input LUTs for comparison purposes. The number of physical LUTs and other resources are the exact counts for the XC7A200T chip.
The opensource Root Complex RTL is a chain of blocks joined by SystemVerilog interfaces: the RISC-V SoC hands TLPs over AXI-Stream to the PCIE stack, which converts them for the PCIE_2_1 hard block and drives the GTP transceiver over PIPE.
Details are in the RTL README. Per design: common RTL, EP, RC-direct, RC-switched. The AMD/Vivado-IP reference designs are in 2.amd-rtl-with-Vivado-build (EP, RC-direct, RC-switched).
The software stack is designed to run bare-metal on the soft RISC-V SoC embedded within the FPGA. In a standard PC, the Operating System (Linux/Windows) manages PCIE enumeration automatically in the background, hiding the complexity from the developer. In this project, our baremetal open-source driver takes full control, manually performing every step of the enumeration process to act as the PCIE Host.
The architecture adopts a clean, well-defined, layered approach:
Application Layer (The "User" Logic):
PCIE Driver (Enumeration & Setup):
HAL (Hardware Abstraction Layer):
Note: This structure allows developers to treat PCIE devices just like any other local peripheral, abstracting away the complexities of the physical link.
Details are in the SW README.
The openPCIE test bench aims to have a flexible approach to simulation which allows a common test environment to be used whilst selecting between alternative CPU components, one of which uses the VProc virtual processor co-simulation element. This allows simulations to be fully HDL, with the RISC-V RTL core that goes into the bitstream (eduBOS5 by default, or PicoRV32), or to co-simulate software using the virtual processor, with a significant speed up in simulation times.
The test bench has the following features:
soc_cpu.VPROC.picorv32 component
make CPU=rtl|vproc|issMore details on the architecture and usage of the openPCIE test bench can be found in the README.md in the 5.sim directory.
The co-simulation can also be followed at TLP level in the WaveCrux waveform viewer, with an open-source PCIE TLP decoder plugin and a ready-made session -- here the firmware sizing BAR0 by readback and placing it at 0x80000000 (more):
One level down, Ferrite's PCIe PIPE and Data Link Layer decoders show the same link on the wire: link training, flow-control credits, and every TLP with its sequence number and Ack (more). With all three layers in one view, you can also see how long a TLP spends inside the hard macro: about 0.4 µs each way (more).
The openPCIE control and status register hardware abstraction layer (HAL) software is auto-generated, as is the CSR RTL, using peakrdl. A single SystemRDL specification, 4.build/csr_build/csr.rdl, describes the TLP transmit/receive window the RISC-V firmware drives, and everything else is derived from it: the register block RTL (csr.sv, csr_pkg.sv), which soc_csr.sv bridges to the picorv32 memory bus, and the software header. For co-simulation purposes an additional layer is auto-generated from the same SystemRDL specification using systemrdl-compiler that accompanies the peakrdl tools. This produces two header files that define a common API to the application layer for both the RISC-V platform and the VProc based co-simulation verification environment. The details of the HAL generation can be found in the README.md in the 4.build/ directory.
More details of the test bench, the pcievhost component and its usage can be found in the 5.sim/README.md file. See also the pcievhost model, its LTSSM support code, and the superseded DUT stubs.
The openPCIE implementation workflow is organized into several stages, covering the complete process from setting up the development environment to verifying the design on physical hardware.
Before building the project, install and configure the required development tools. These include an FPGA toolchain such as AMD Vivado or openXC7, a bare-metal RISC-V cross-compilation toolchain, Python, and the project-specific dependencies listed in the corresponding directories.
Before deploying the design to physical hardware, run the available simulation environment to verify the interaction between the PCIE hardware design and the software components.
The co-simulation flow is used to test essential operations such as device initialization, register access, PCIE link behavior, and data exchange between the Root Complex (RC) and Endpoint (EP). This stage helps identify hardware and software integration issues before synthesis and hardware deployment.
Compile the bare-metal RISC-V driver and test application using the configured cross-compilation toolchain, see 4.build/sw_build.
The software is responsible for initializing the required hardware components, configuring the PCIE communication flow, and transferring test payloads between the RC and EP. The generated executable can be used during simulation or deployed together with the FPGA design for hardware verification.
The FPGA design can be synthesized and implemented using either the commercial AMD Vivado toolchain or the open-source openXC7 toolchain. Depending on the selected flow, the process includes design elaboration, synthesis, placement, routing, timing analysis, and final bitstream generation.
The resulting .bit file contains the complete hardware configuration for the selected FPGA board. The appropriate board-specific constraints, build configuration, and target design must be selected depending on whether the board operates as the Root Complex (RC) or Endpoint (EP).
Detailed build instructions for both the Vivado and openXC7 flows are provided in the corresponding project directories.
Program the RC and EP FPGA boards with their corresponding bitstreams. After both designs have been loaded, start the software application and allow the boards to initialize the PCIE connection.
The deployed system can then be verified by checking the PCIE link-status indicators and comparing the transmitted payload with the data displayed or received on the Endpoint.
Detailed commands, configuration options, supported boards, and stage-specific instructions are provided in the corresponding project directories.
Properly programming and operating the Artix-7 FPGA on the SQRL board requires some soldering and work on open desktop motherboard.
The JTAG connector on the Acorn CLE-215+ is non-standard and not directly compatible with the standard 14-pin connector on the Xilinx Platform Cable. A custom adapter cable is therefore required.
|
|
| Custom JTAG Cable connecting the Xilinx Programmer to the board | JTAG Connector Pinout on the Board |
The connector on the board is a Molex Pico-Lock 1.50mm pitch male header. This is not a standard 2.54mm or 2.00mm header, so standard DuPont-style cables will not fit.
To simplify making the cable, we highly recommend purchasing a pre-assembled cable with the correct female connector.
This cable has the correct female connector on both ends. The easiest method is to cut the cable in half, which gives you two connector cables with open ends. You can then splice one of these cable ends onto the wires of your Xilinx programmer cable, matching the signals according to the following wiring diagram.
JTAG Connection Guide: Physical Pinout and Wiring Diagram.
The board cannot be programmed or operated solely from the PCIE/M.2 slot power. It requires an external 12V supply to function correctly, especially when complex designs and high-speed transceivers are active. Power is provided via a standard 6-pin PCIE power connector from an ATX power supply.
External 12V power connection.
The complete system, including the custom cabling, is mounted in a test PC chassis for verification.
The complete FPGA system mounted in a PCIE slot.
After the hardware was prepared, the connection was verified using the Vivado Hardware Manager. As shown below, the tool successfully detected the JTAG programmer and identified the xc7a200t_0 FPGA chip. This confirms that the physical connections are correct and the board is ready for programming.
Successful device detection in Vivado Hardware Manager.
Before interacting over PCIE, here is the complete bench validation setup used for the Direct (Point-to-Point) connection scenario. It features the openPCIE Backplane powered by an external 12V supply, populated with two Acorn CLE-215+ FPGA modules (one configured as RC, the other as EP).
Dual Xilinx Platform Cable USB units are connected via custom adapters to allow simultaneous debugging and bitstream loading from two separate host workstations.
The complete hardware validation environment for the Direct connection test.
We used a two-PC setup to streamline development:
Why this setup?
To bring up the system and verify the PCIE link, follow these steps:
The goal of this test is to verify that the Root Complex can successfully enumerate the link and perform both Memory Write and Memory Read transactions.
1. Visual Verification (LEDs) Visual feedback is provided via the 4 user LEDs on both FPGA boards:
2. Internal Signal Monitoring (ILA) Using the Vivado Integrated Logic Analyzer (ILA) on both PCs enables detailed monitoring of internal signals to see exactly what data was sent and received, its precise timing, and the low-level transaction details.
The implementation was verified on physical hardware by checking both PCIE link establishment and successful payload transfer between the Root Complex (RC) and Endpoint (EP).
On the RC board, LED A3 indicates the PCIE link status. When this LED is illuminated, the PCIE link has been successfully established. We can see that the LED A3 is active, confirming that the link between the RC and EP is up.
On the EP board, the LEDs display the received data payload. The RC transmitted the decimal value 6, represented in binary as 0110. The LED pattern on the EP matches this value, confirming that the payload was transferred and received correctly.
These results confirm that PCIE link initialization and RC-to-EP data transfer operate successfully on physical hardware.
|
|
| RC-LED-Link-Up | EP-LED-Data-Payload |
PCIE Protocol Analyzers
PART 1. Mini PCIE Backplane PCBAlmost all consumer PCIE installations have the RC chip soldered down on the motherboard, typically embodied in the CPU or "North Bridge" ASIC, where PCIE connectors are used solely for the EP cards. Similarly, all FPGA boards on the market are designed for EP applications. As such, they expect clock, reset and a few other signals from the infrastructure. It is only the professional and military-grade electronics that may have both RC and EP functions on add-on cards, with a backplane or mid-plane connecting them (see VPX chassis, or VITA 46.4).
This dev activity is about creating the minimal PCIE infrastructure necessary for using a plethora of ready-made FPGA EP cards as a Root Complex. This infrastructure takes the physical form of a mini backplane that provides the necessary PCIE context similarly to what a typical motherboard would give, but without a soldered-down RC chip that would be conflicting with our own FPGA RC node.
Such approach is less work and less risk than to design our own PCIE motherboard, with a large FPGA on it. But, it is also a task that we did not appreciate from the get-go. In a bit of a surprise, half-way through planning, we've realized that a suitable, ready-made backplane was not available on the market. This initial disappointment then turned into excitement knowing that this new outcome would make the project even more attractive / more valuable for the community... esp. when Envox.eu has agreed to step in and help. They will take on the PCIE backplane PCB development activity.
PART 2. Project setup and preparatory activitiesPART 3. Initial HW/SW implementationPART 4. HW/SW co-simulation using full PCIE EP modelThis dev activity is significantly beefed up compared to our original plan, which was to use a much simpler PCIE EP BFM, and non-SOC sim framework. While that would have reduced the time and effort spent on the sim, prompted by NLnet astute questions, we're happy to announce that wyvernSemi is now also onboard!
Their VProc can be used not only to faithfully model the RISC-V CPU and SW interactions with HW, but it also comes with an implementation of the PCIE model. The PCIE model has some EP capabilities with a configurable configuration space, which can be paired in sim with our RC RTL design. Moreover, the existence of both RC and EP models paves the way for future plug-and-play, pick-and-choose opensource sims of the entire PCIE subsystem.
With the full end-to-end simulation thus in place, we hope that the need for hardware debugging, using ChipScope, expensive test equipment and PCIE protocol analyzers would be alleviated.
PART 5. Integration, testing and iterative design refinementsPART 6. Prepare Demo and port it to openXC7Given that PCIE is an advanced, high-speed design, in the light of nextpnr-xilinx and openXC7 shortcomings when it comes to timing constraints and timing closure, we expect to run into showstoppers, and have therefore planned to experiment with WIP ScalePNR. In turned out that, with some corrections, the nextpnr-xilinx was good enough -- The bitstream built with it brings the link up at Gen2 speeds on hardware, the same as Vivado does. Getting there took six fixes - one latent bug in our RTL and five workarounds for openXC7 defects - all documented in 4.build/hw_build.openXC7, along with the issues we filed against openXC7.
The design has also been ported to, and tested with openXC7 1.0.0 edition, which was a major step forward and essentially what "ScalePNR" idea eventually evolved into. It brought to the forefront Yosys0.69 with integrated Slang, nextpnr-himbaechel (instead of nextpnr-xilinx) and fpga-as. With that, the earlier SV2V standalone prep step for our SystemVerilog design sources proved to be unnecessary, which simplified the build process. The SV2V option is however still retained for cross-tool checking.
openPCIE has served as the basis for a number of Master's theses at the Faculty of Electrical Engineering, University of Sarajevo (ETF Sarajevo). Among them are the theses of Anes Vrce and Aladin Brdar, the latter shown here presenting his work on the openPCIE platform, tapping into its hardware, software and simulation facets.
We are grateful to NLnet Foundation for their sponsorship of this development activity.
This project was funded through the NGI0 Core Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101092990.
The wyvernSemi's wisdom and contribution made a great deal of difference -- Thank you, we are honored to have you on the project.
The Envox, our next-door buddy, is responsible for the birth of our backplane, which we like to call BB (not to be mistaken for their gorgeous blue beauty BB3)
KiCad turns electrical idea into a manufacturable board. openXC7, with Yosys at its core, turns RTL into a loadable FPGA bitfile. PeakRDL turns our SystemRDL file into CSR RTL+headers+RegMap docs. WaveCrux greatly facilitates waveform decoding and viewing. But, that's not everything that made this project possible -- Thank you all for these wonderful opensource tools ✨.
Feel like helping opensource PCIE community grow better and larger?! See Contributions.
Don't feel shy to reach out and ask for help ===> .
Our next step is openPCIE3, a 24-lane Gen3 backplane with Optical Copper Link (OCuLink). It is built around the Diodes PI7C9X3G1224GP switch (PCIE 3.1, 24 lanes, 12 ports), and links one or two PCs, each over an x4 OCuLink cable, to four x4 EP connectors (two slots, two M.2).
Its main use is as a PC I/O extender, adding compute, storage or I/O cards, e.g. for opensource AI servers. The PC drives REFCLK and reset over the cable, so the board needs no local clock or reset generator. Design input is welcome in #9 and #13.
Our repo may contain elements of work facilitated by the modern GenAI tools , used under strict guidance and tight supervision of the blood-and-flesh developers, and solely as suggestions.
In the end, it is us, the human devs, who are fully responsible for any shortfalls you may uncover while tapping into repo resources.
1,003 followers · starred Apr 2025
104 followers · starred Oct 2026