PCILeech Firmware Generator
PCILeech Firmware Generator builds PCIe DMA firmware from real donor hardware. It reads a donor card's configuration over VFIO and builds a PCILeech FPGA bitstream that presents as that card.
You need a real donor card
Firmware is built from the identifiers of an actual device, and placeholder values are rejected. Using your own donor keeps your firmware unique.
How it works
A build runs in three stages:
- Collect (host, root): reads the donor's config space, BARs, capability chain and MSI-X table over VFIO, and learns register behavior by tracing the native driver with
mmiotrace. - Generate (host or container): renders SystemVerilog, TCL and COE files from the collected data. The container never touches VFIO.
- Synthesize (host, Vivado): builds the bitstream. Timing, clock coverage, DRC and CDC checks must pass before a bitstream is written. Skip this stage with
--templates-only.
See How a build works and Build gates for details.
Requirements
- Linux with VFIO and IOMMU enabled (Ubuntu 22.04+ or Debian 12+). macOS, Windows and WSL2 are not supported.
- Python 3.11 or newer.
- A donor PCIe card. An inexpensive NIC, sound or capture card works.
- A PCILeech FPGA board, such as
pcileech_35t325_x1,pcileech_75t484_x1orpcileech_100t484_x1. - Xilinx Vivado 2022.2 or newer to build bitstreams. The free Standard edition covers the supported boards.
- Optional: Podman, to run the generate stage in a container.
Quick install
python3 -m venv ~/.pcileech-venv
source ~/.pcileech-venv/bin/activate
pip install "pcileechfwgenerator[tui]"
echo "alias pcileech-sudo='sudo -E ~/.pcileech-venv/bin/python3 -m pcileechfwgenerator.pcileech_main'" >> ~/.bashrc && source ~/.bashrc
pcileech-sudo tui
You also need IOMMU enabled and the VFIO modules loaded. The installation guide covers both.
Where to go next
Getting started:
- Installation: venv, root alias, IOMMU and VFIO setup.
- Quick start: the shortest path to a first build.
- Build walkthrough: each stage in detail.
- Vivado setup: edition, version and how Vivado is found.
- Choosing a donor: choosing a donor.
- TUI guide: the interactive interface.
Building:
What the firmware does:
Help:
- Troubleshooting
- Contributing
- Support on Discord. Bug reports on GitHub Issues.
Responsible use
Use only on systems you own or are authorized to test
This tool is for educational research and legitimate PCIe development. Use generated firmware only with hardware you own, against systems you own or are explicitly authorized to test. You are responsible for complying with applicable laws. Keep generated firmware and captures private; they contain real device identifiers.
License
MIT. See LICENSE.txt.