Engineering Notes

PCIe Gen4 on FPGAs whose hard block stops at Gen3

pcieip corevideo
The PCIe 4.0 Soft Endpoint at 16 GT/s. Our IMX530 camera on the Aper-Oculus sends RGB8 4096x2160 at 44.6 fps over CoaXPress CXP-12 to a KCU116. The soft endpoint, in place of the hard block, carries it into the PC through the LitePCIe driver: 1.18 GB/s over PCIe Gen4 x1 at 16 GT/s.

Kintex UltraScale+ and Zynq UltraScale+ MPSoC parts have transceivers fast enough for 16 GT/s. Their PCIe blocks aren't: the PCIE4 hard block in those families stops at Gen3. If you wanted Gen4, the usual answer was a different part. We built the PCIe stack in the fabric instead.

The PCIe 4.0 Soft Endpoint is a complete PCI Express 4.0 endpoint built in programmable logic: link training and equalization, the data link layer, the transaction layer and configuration space. It sits on AMD's own PG239 PHY, so the transceiver side is generated exactly the way AMD generates it. Everything above that is ours.

Three PCIe stacks side by side: AMD's PG213 hard block, AMD's PG239 PHY with everything above it left to you, and the ApotheoTech soft endpoint built on PG239
Where each option puts the PCIe stack. PG213 is hardened silicon. PG239 is only a PHY, and the rest is up to you. The soft endpoint builds everything above PG239 and keeps PG213's user interface.

From the outside, it looks like PG213

This was the part we cared about most. The core has PG213's port list and PG213's CONFIG names and values, at 512 bits for x8 and 256 bits for narrower links. A design that instantiates the hard block takes this core in its place, and a create_ip script written for PG213 configures it once the VLNV changes:

create_ip -vlnv apotheotech.com:ip:apt_pcie_ep:1.0 -module_name pcie_ep
set_property -dict [list CONFIG.PL_LINK_CAP_MAX_LINK_SPEED {16.0_GT/s} \
  CONFIG.PL_LINK_CAP_MAX_LINK_WIDTH {X8}] [get_ips pcie_ep]

Because it is a drop-in replacement for PG213's interface, it supports LitePCIe, with its Linux driver, its DMA and its MSI interrupts. The lanes can sit on any GTY or GTH quad your board routes them to, which also helps on boards whose PCIe lanes land somewhere the hard block can't reach.

Twice the bandwidth per lane

At 16 GT/s each lane carries 1.97 GB/s in each direction, so a Gen4 x4 link does the work of a Gen3 x8. At x8 the core moves 15.75 GB/s each way, and the user interface, 512 bits at x8 and 256 bits below, takes one beat per clock in every direction, so it never becomes the bottleneck.

Bar chart of PCIe bandwidth per direction for x1, x2, x4 and x8 links at Gen3 and Gen4
Link bandwidth per direction, after 128b/130b coding and before packet overhead.

The demo: one lane, one 4K camera

The video at the top is four of our cores between a Sony IMX530 and a PC. On the Aper-Oculus, the SLVS-EC receiver takes the pixels off the sensor over two lanes and the CoaXPress Device core turns them into a CXP-12 stream. On a KCU116 with our CoaXPress FMC card, the Host core decodes that stream, LitePCIe DMA moves it, and the soft endpoint carries it into the PC.

  1. IMX530
  2. SLVS-EC RX
  3. CXP Device
  4. CXP-12 coax
  5. CXP Host
  6. LitePCIe DMA
  7. apt_pcie_ep
  8. PCIe Gen4 x1
  9. PC

The stream is RGB8 at 4096 x 2160 and 44.6 fps. That is 1.18 GB/s, carried over PCIe Gen4 x1 at 16 GT/s. A Gen3 x1 lane tops out at 0.98 GB/s, so the same stream would not fit. On a board whose hard block stops at Gen3, that is the difference between one lane and two.

What it costs in fabric

Here are the numbers for every width, from the current builds on a KCU116. Each build includes the PG239 PHY. x8 uses the 512-bit user interface; x4, x2 and x1 use the 256-bit one.

WidthLUTsRegistersBlock RAMShare of a KU5P
PCIe Gen4 x122,84322,0932110.5%
PCIe Gen4 x229,96726,9612113.8%
PCIe Gen4 x436,46632,6472116.8%
PCIe Gen4 x865,47954,40122.530.2%

No DSP slices and no UltraRAM at any width. LitePCIe DMA on top adds about 5.2K LUTs (6.2K at x8). For a design that doesn't need them, size options can drop request tracking, the x2 and x1 links and packets at 2.5 and 5.0 GT/s, at least 18,100 more LUTs at x8 with all three.

Share of the LUTs in an AMD Kintex UltraScale+ KU5P used by the soft PCIe endpoint: 10.5% at x1, 13.8% at x2, 16.8% at x4, 30.2% at x8.0%10%20%30%x110.5%x213.8%x416.8%x830.2%
Share of a KU5P's LUTs, PG239 PHY included. KCU116 builds, December 2026.

x8 nearly doubles the LUTs of x4, because it moves to the wider datapath. Going the other way, x4 to x1 saves about 13.6K LUTs, not three quarters of the core: x1 is still 63% of the x4 build. A good part of the endpoint does not shrink with lane count. So the question is less "how wide can we afford" and more "how narrow can we get away with". For a lot of camera work, the answer is one lane at Gen4.

How we tested it

Every layer had its own SystemVerilog testbench before anything touched a board, and then the whole endpoint ran end to end in simulation. On hardware it has been through PCs with AMD and Intel processors, under Ubuntu and AlmaLinux, and every width from x1 to x8 has run at 16 GT/s. On every host it reaches 16 GT/s at full width, trains down to Gen3 when the slot is capped, and streams stamped test-pattern frames into host memory without dropping one.

Five verification steps: layer testbenches, full-stack simulation, hardware bring-up, DMA streaming and a host matrix
Simulated layer by layer, then proven on AMD and Intel x86 hosts. A Jetson Orin is the next host.

What's next

  • Done: Gen4 at x1, x2, x4 and x8 on PG239 with Gen3 fallback, PG213-compatible CQ, CC, RQ and RC ports, LitePCIe support, AMD and Intel x86 hosts, and measured utilization at every width.
  • Next: bring-up on an NVIDIA Jetson Orin, an ARM host where the SMMU, cache coherency and DMA mapping all behave differently from x86, then the CoaXPress demo on it. And a test-pattern build that maxes out the link.
  • Later: target tracking on the Orin, fed by a CoaXPress camera.

The datasheet has every figure, port and setting, and the product page has the short version. If you have a design that's stuck at Gen3, tell us about it.