# ufrisk/pcileech-fpga architecture

> Architecture diagram of the GitHub repository ufrisk/pcileech-fpga, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ufrisk/pcileech-fpga
- Repository: https://github.com/ufrisk/pcileech-fpga

## Overview

PCILeech FPGA is a family of FPGA firmware designs that pair with the PCILeech DMA toolkit and MemProcFS. The documented workflow is host software communicating over a board-specific link with FPGA firmware, which exposes PCIe memory access and raw TLP capability to a host system. The graph uses CaptainDMA’s representative source paths for the shared design layers; the README documents additional board variants and a UDP/IP-based NeTV2 option. No source excerpts were provided, so internal wiring is kept conservative.

Main entry points: [`CaptainDMA/35t325_x1/src/pcileech_35t325_x1_top.sv`](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_35t325_x1_top.sv) (Board top level), [`CaptainDMA/35t325_x1/src/pcileech_pcie_a7.sv`](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_pcie_a7.sv) (PCIe endpoint), [`CaptainDMA/35t325_x1/src/pcileech_pcie_tlp_a7.sv`](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_pcie_tlp_a7.sv) (TLP handling), [`CaptainDMA/35t325_x1/src/pcileech_ft601.sv`](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_ft601.sv) (FT601 transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host software"]
  node_toolkit["PCILeech toolkit"]
  node_memprocfs["MemProcFS"]
end

subgraph group_link["Device links"]
  node_usb["USB-C / USB3"]
  node_udp["UDP/IP link"]
  node_eth["NeTV2 Ethernet<br/>[pcileech_eth.sv]"]
end

subgraph group_fpga["FPGA firmware"]
  node_top["Board top level"]
  node_transport["FT601 transport<br/>[pcileech_ft601.sv]"]
  node_com["Command interface<br/>[pcileech_com.sv]"]
  node_mux["Data mux<br/>[pcileech_mux.sv]"]
  node_fifo["FIFO buffering<br/>[pcileech_fifo.sv]"]
end

subgraph group_pcie["PCIe functions"]
  node_pcie["PCIe endpoint"]
  node_tlp["TLP handling"]
  node_cfg["PCIe configuration"]
  node_shadow["Config shadow"]
  node_bar["BAR controller"]
end

node_hostpc(("Host PCIe system"))

node_toolkit -->|"sends commands/data"| node_usb
node_usb -->|"carries traffic"| node_transport
node_transport -->|"board interface"| node_top
node_top -->|"routes commands"| node_com
node_top -->|"routes data"| node_mux
node_top -->|"connects PCIe"| node_pcie
node_memprocfs -.->|"uses toolkit"| node_toolkit
node_udp -.->|"carries traffic"| node_eth
node_toolkit -.->|"communicates via"| node_udp
node_pcie -->|"handles packets"| node_tlp
node_pcie -->|"manages config"| node_cfg
node_cfg -->|"uses shadow"| node_shadow
node_tlp -->|"handles BAR traffic"| node_bar
node_hostpc -->|"PCIe access"| node_pcie
node_tlp -->|"transfers memory / raw TLPs"| node_hostpc

click node_top "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_35t325_x1_top.sv"
click node_transport "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_ft601.sv"
click node_com "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_com.sv"
click node_mux "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_mux.sv"
click node_fifo "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_fifo.sv"
click node_pcie "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_pcie_a7.sv"
click node_tlp "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_pcie_tlp_a7.sv"
click node_cfg "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_pcie_cfg_a7.sv"
click node_shadow "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_tlps128_cfgspace_shadow.sv"
click node_bar "https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_tlps128_bar_controller.sv"
click node_eth "https://github.com/ufrisk/pcileech-fpga/blob/master/NeTV2/src/pcileech_eth.sv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_toolkit,node_memprocfs toneBlue
class node_usb,node_udp,node_eth toneAmber
class node_top,node_transport,node_com,node_mux,node_fifo toneMint
class node_pcie,node_tlp,node_cfg,node_shadow,node_bar toneRose
class node_hostpc toneIndigo
```

## Components

### Host software

- **PCILeech toolkit**
- **MemProcFS**

### Device links

- **USB-C / USB3**
- **UDP/IP link**
- [NeTV2 Ethernet](https://github.com/ufrisk/pcileech-fpga/blob/master/NeTV2/src/pcileech_eth.sv): `NeTV2/src/pcileech_eth.sv`

### FPGA firmware

- [Board top level](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_35t325_x1_top.sv): `CaptainDMA/35t325_x1/src/pcileech_35t325_x1_top.sv`
- [FT601 transport](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_ft601.sv): `CaptainDMA/35t325_x1/src/pcileech_ft601.sv`
- [Command interface](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_com.sv): `CaptainDMA/35t325_x1/src/pcileech_com.sv`
- [Data mux](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_mux.sv): `CaptainDMA/35t325_x1/src/pcileech_mux.sv`
- [FIFO buffering](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_fifo.sv): `CaptainDMA/35t325_x1/src/pcileech_fifo.sv`

### PCIe functions

- [PCIe endpoint](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_pcie_a7.sv): `CaptainDMA/35t325_x1/src/pcileech_pcie_a7.sv`
- [TLP handling](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_pcie_tlp_a7.sv): `CaptainDMA/35t325_x1/src/pcileech_pcie_tlp_a7.sv`
- [PCIe configuration](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_pcie_cfg_a7.sv): `CaptainDMA/35t325_x1/src/pcileech_pcie_cfg_a7.sv`
- [Config shadow](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_tlps128_cfgspace_shadow.sv): `CaptainDMA/35t325_x1/src/pcileech_tlps128_cfgspace_shadow.sv`
- [BAR controller](https://github.com/ufrisk/pcileech-fpga/blob/master/CaptainDMA/35t325_x1/src/pcileech_tlps128_bar_controller.sv): `CaptainDMA/35t325_x1/src/pcileech_tlps128_bar_controller.sv`

### Other components

- **Host PCIe system**

## Connections

- PCILeech toolkit → USB-C / USB3: sends commands/data
- USB-C / USB3 → FT601 transport: carries traffic
- FT601 transport → Board top level: board interface
- Board top level → Command interface: routes commands
- Board top level → Data mux: routes data
- Board top level → PCIe endpoint: connects PCIe
- MemProcFS → PCILeech toolkit: uses toolkit
- UDP/IP link → NeTV2 Ethernet: carries traffic
- PCILeech toolkit → UDP/IP link: communicates via
- PCIe endpoint → TLP handling: handles packets
- PCIe endpoint → PCIe configuration: manages config
- PCIe configuration → Config shadow: uses shadow
- TLP handling → BAR controller: handles BAR traffic
- Host PCIe system → PCIe endpoint: PCIe access
- TLP handling → Host PCIe system: transfers memory / raw TLPs
