Skip to content

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:

  1. 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.
  2. Generate (host or container): renders SystemVerilog, TCL and COE files from the collected data. The container never touches VFIO.
  3. 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_x1 or pcileech_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:

Building:

What the firmware does:

Help:

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.