SDR/RF · FPGA · Networking

M.2 SDR on Artix-7

An M.2 SDR built around an Artix-7 and an AD9364. IQ moves between the radio, HyperRAM and the host over PCIe Gen1 x2 or USB, and the design meets timing at 61.44 MSPS on an XC7A50T.

  • 245.76 MB/sRF stream at 61.44 MSPS
  • ~450 MB/sPCIe throughput measured on the host
  • 79%LUTs used
  • +0.094 nsWNS in the 4 ns interface domain

Architecture · block diagram

  • Main data path
  • Logic
  • Processor
  • Memory
  • Interconnect
  • Off-chip
M.2 SDR on Artix-7: PCIe and USB host paths, TX/RX switching, FIR rate conversion, HyperRAM buffering, AD9364ARTIX-7M.2PCIe Gen1 x2USB PHYPCIeFIFOTX switchTX unpackFIR interp.DMA switchRX switchRX cpackFIR decim.USBstream → memmem → streamTDD coreSPI coreAXI DMA busAD9364RF transceiverHyperRAMTX IQRX IQconfig
FIG. 01

The story

The M.2 SDR moves the sample streams of a radio through a small FPGA and a narrow host link. IQ samples flow in both directions over PCIe or USB. When the host falls behind, local HyperRAM buffers the data.

I designed it for the Artix-7. XDMA carries the PCIe link and the register access. HyperRAM connects through the open-source OpenHBMC controller, and USB through an AXI USB2 device core over ULPI. The transceiver IP comes from Analog Devices' Pluto HDL.

Challenges

The XC7A50T is the largest Artix-7 in the CSG325 package, so a bigger device was not an option. The design had to fit in 32600 LUTs. The host link is PCIe Gen1 x2, with 500 MB/s of raw bandwidth in each direction. At 61.44 MSPS, the AD9364 interface logic runs on a 245.76 MHz data clock. That is a 4 ns period on Artix-7 fabric.

What I built

Two host interfaces, PCIe on the M.2 connector and USB, connect into an AXI4-Stream routing fabric. On the transmit side, data flows from PCIe through a FIFO into a TX switch. Then it goes through TX unpack and a FIR interpolator to the AD9364. On the receive side, the AD9364 feeds a FIR decimator, then RX cpack and an RX switch. The RX switch sends samples back toward the host or into a DMA switch.

Stream-to-memory and memory-to-stream DMA movers sit on a separate memory bus to HyperRAM. Samples can pass directly between PCIe and the radio, or they can wait in memory, in both directions and over both host interfaces. The host reaches the register blocks through the XDMA AXI-Lite BAR. A TDD engine handles TX and RX timing, and an SPI core configures the AD9364. At runtime, the switches can also send any path through HyperRAM without a new bitstream, which makes debugging faster.

The hardest problem

The first implementation run failed before placement. Vivado synthesizes each IP out of context, so the overflow only appeared at implementation: 43075 LUTs against 32600 available, 132% of the device. The hierarchical utilization report showed where the LUTs went. The two SmartConnect interconnects used 14473 LUTs and 19496 flip-flops, more than the entire overflow. For throughput, SmartConnect builds pipelines and decoders for each port. A register bus with a single master doesn't need them.

I replaced both with AXI Interconnect in its area-optimized, shared-access mode. One serves the register bus (one master, ten register slaves). The other serves the memory bus (four masters into HyperRAM). The address map stayed the same. That change saved about 12600 LUTs.

In the AD9361 core, I disabled the internal TDD block, because the design has a separate TDD engine. I also changed the four test-tone generators from CORDIC to the polynomial DDS. The sine generation moves into DSP blocks: 2376 fewer LUTs for 32 more DSPs.

Two smaller fixes completed the fit. The ULPI clock sits on a pin that can't drive a global buffer directly. Until the next board revision, it reaches its buffer through general routing. The 600 MHz HyperRAM SERDES clock is above the BUFG limit of the -1 speed grade, so the project now targets the -2 part that the board uses.

At 79% LUT utilization, the next run added the 61.44 MSPS clock constraints, and setup failed in the 4 ns sample-clock domain. The output stream of the DAC DMA fans out to the TX unpacker and both FIFOs. In the default configuration, the block RAM of the DMA drives that stream with no register stage. The downstream ready signal returns combinationally into the DMA. Those paths failed by up to 0.251 ns on 113 endpoints.

The DMA has a built-in output register slice. With the slice enabled, data and valid are registered forward, and ready is registered backward. It costs one 4 ns cycle of TX latency, and the domain met timing. The final run uses timing-driven implementation directives: ExtraTimingOpt placement, and AggressiveExplore physical optimization and routing.

Result

The design fits the XC7A50T at 79% of LUTs, 54% of flip-flops, 44% of block RAM and 87% of DSPs, with 99.7% of slices occupied. All user-specified timing constraints are met. The tightest domain is the 4 ns AD9364 interface clock. It has a WNS of +0.094 ns and a WHS of +0.036 ns, and 0 of 94797 endpoints fail.

In a memory-read test on the host, the PCIe Gen1 x2 link sustains about 450 MB/s. That is about 90% of its 500 MB/s raw rate. An RF stream at 61.44 MSPS needs 245.76 MB/s, about 55% of the measured link throughput.

The area-optimized memory interconnect gives HyperRAM to one master at a time, and the DMAs, USB and the host take turns. HyperRAM is single-ported, so the shared path costs little bandwidth.

Original design diagram
Original design diagram of the M.2 SDR datapath on Artix-7
Vivado block design.
Original design diagram
Vivado block design of the M.2 SDR
Utilization by block after the fixes: XDMA is the largest block, and the two AXI Interconnects are now small.
Measured data
Vivado hierarchical utilization report of the M.2 SDR on the XC7A50T
Timing summary at 61.44 MSPS: all user-specified timing constraints met.
Measured data
Vivado design timing summary: WNS 0.094 ns, WHS 0.036 ns, all constraints met
Routed device view of the XC7A50T, with 99.7% of slices occupied.
Layout render
Vivado device view of the routed M.2 SDR design on the XC7A50T

Where the LUTs went, before and after

BlockLUTs beforeLUTs after
Register bus: SmartConnect → AXI Interconnect94441306
Memory bus: SmartConnect → AXI Interconnect5029586
axi_ad9361 (CORDIC → polynomial DDS, internal TDD removed)87995279
xdma_01185911443
Total Slice LUTs (of 32600)43075 (132%)25829 (79%)
Where it's used

Where you'd find something like this

01

Embedded SDR in laptops, edge servers and drones

02

Spectrum sensing and private LTE/IoT gateways

03

RF teaching labs and prototyping

Available · Asia/Dhaka (UTC+6)

Have hardware that needs to work?

Tell me what you're building. I'll come back with questions, a rough scope and an estimate, usually within 2 days.

PAD 01 · I/O