fpga processor interface

    FPGA and Processor Interfaces: Choosing Between SPI, Parallel Bus, AXI, and PCIe

    Compare SPI/QSPI, FSMC/parallel bus, AXI4, and PCIe for FPGA-processor designs: bandwidth, pin count, CDC, DMA, and XTELL PolarFire & Lattice lessons.

    ·XTELL Engineering Team

    Why the FPGA-to-CPU boundary decides system architecture

    Many hardware teams choose an MCU or application processor on one side and an FPGA on the other, then treat the bus between them as a last-minute detail. When prototype bring-up begins, they discover that SPI cannot drain ADC bursts fast enough, a parallel memory bus violates hold timing across board traces, or polling over a register link burns half the CPU cores.

    Picking the right FPGA-processor interface—and designing the clock-domain crossing (CDC) and buffering around it—determines PCB layer count, pin budget, software driver complexity, and real-time latency.

    Comparing the four main FPGA-processor interconnects

    Use this comparison table early in architecture review before locking chip packages and pinouts:

    InterfacePractical Sustained BandwidthPin CountDriver & DMA ModelBest Fit
    SPI / Quad-SPI~5–80 Mbps (SPI) / ~100–200 Mbps (QSPI)4–8 pins + IRQSimple MCU/Linux SPI + DMA burstRegister control, status telemetry, modest packet streams
    Parallel Bus (FSMC / EBI / EMIF)~200 Mbps–1.5 Gbps20–40+ pinsMemory-mapped SRAM/NOR timing + DMAMedium-speed acquisition, deterministic MCU-to-FPGA memory windows
    On-Chip AXI4 / AXI-Stream (SoC FPGA)Multiple Gbps (internal fabric)0 external board pinsUIO, DMA engine, or Linux kernel driverTight CPU + FPGA co-processing (Zynq / PolarFire SoC)
    PCIe (Gen1 / Gen2 / Gen3)~2 Gbps/lane (Gen1) up to ~6+ Gbps/lane (Gen3)Differential lanes + REFCLK + PERST#Scatter-gather DMA ring + MSI/MSI-X IRQHigh-speed vision, SDR, multi-channel capture to host MPU/PC

    Engineering rules for each interface tier

    1. SPI and QSPI: register framing and interrupt-driven DMA

    SPI is the lowest-pin-count way to pair an MCU or Linux SoC with a Lattice or Microchip FPGA. The most common mistake is treating SPI as a bare byte stream without packet framing or a dedicated hardware interrupt pin:

    • Always add an FPGA-to-CPU IRQ line so the processor only initiates DMA reads when a threshold in the FPGA FIFO is reached, avoiding continuous SPI polling loops.
    • Use fixed-header register transactions (for example 1-byte read/write + 15-bit address + dummy wait cycles before read data) so the FPGA state machine has deterministic turnaround time to fetch block RAM data before shifting MISO.
    • In XTELL's Lattice fiber signal communication board (Lattice LCMXO2-4000HC FPGA + FreeRTOS), FreeRTOS handled system supervision, master-slave auto-adaptation, and AGC configuration (0–40 dB in 2 dB steps) while the FPGA handled the deterministic 14-bit 80 MSPS ADC and 16-bit 50 MSPS DAC real-time datapath—a clean split where control traffic never interferes with sample-rate timing.

    2. Parallel memory bus (STM32 FSMC/FMC, i.MX EIM/GPMC): watch the clock domain

    When an MCU has an external memory controller, mapping the FPGA as an asynchronous or synchronous SRAM gives natural pointer access from C code. However, asynchronous strobes (NWE, NOE, NE) come from the MCU clock domain, not the FPGA system clock:

    • Never clock FPGA flip-flops directly on the MCU NWE pin. Synchronize control strobes through a two-flip-flop synchronizer (or oversample at ≥4× the strobe rate) into the FPGA fabric clock, detect the edge cleanly, and latch address/data once stable.
    • Constrain external bus timing in SDC with board trace delays and configure sufficient MCU wait states so setup and hold margin remain positive across temperature.
    • For context on external memory-mapped industrial designs, see how XTELL paired an STM32F407 with SRAM expansion and FreeRTOS in our STM32 PLC industrial control project.

    3. AXI4 and PCIe: backpressure, scatter-gather DMA, and board integrity

    At multi-hundred-megabit and gigabit rates, CPU-driven PIO reads collapse throughput. High-speed links need hardware DMA rings and strict flow control:

    • Separate data streaming from control registers: Use lightweight AXI4-Lite (or PCIe BAR0) for configuration registers and AXI4-Stream into a DMA descriptor ring (or BAR1 scatter-gather buffers) for payload bursts.
    • Honor TVALID / TREADY backpressure by placing an asynchronous skid/packet FIFO inside the FPGA ahead of the DMA interface so real-time sensors or ADCs never drop words during short bus stalls.
    • Design power and differential routing from reference schematics up: On XTELL's Microchip PolarFire MPF100T FPGA core board, PCB stackup, high-speed differential routing, power integrity, and Type-C/FSI high-speed interface design were validated directly against Microchip evaluation kit schematics and datasheet pin rules.

    Illustrative Verilog CDC pattern for an MCU-to-FPGA register write

    The snippet below illustrates how to capture an asynchronous MCU write strobe inside an FPGA system clock domain without creating a secondary clock tree (illustrative only—adapt polarity and setup hold cycles to your MCU bus timing):

    // Illustrative synchronous edge-capture for external MCU write strobe
    always @(posedge sys_clk) begin
        wr_sync <= {wr_sync[1:0], mcu_nwe}; // 3-stage sync (falling edge detect)
        if (wr_sync[2:1] == 2'b10) begin    // falling edge of active-low NWE
            addr_lat <= mcu_addr;
            data_lat <= mcu_data;
            wr_pulse <= 1'b1;
        end else begin
            wr_pulse <= 1'b0;
        end
    end

    Build the FPGA and processor interface as one hardware-software team

    An interface bug between an FPGA and a processor sits right on the boundary where separate hardware, FPGA, and Linux/firmware contractors blame each other. At XTELL, the same engineering team handles KiCad PCB layout, FPGA RTL and timing closure, and MCU firmware or Linux drivers—so pin assignments, CDC logic, and DMA buffers are verified together on the bench.

    Read our companion FPGA articles on choosing between PolarFire, Lattice, and Xilinx, FPGA timing constraints and closure, and high-speed ADC/DAC board design, or reach out via our contact page to review your architecture.

    Frequently Asked Questions

    When should we upgrade an FPGA-processor link from SPI to a parallel bus or PCIe?

    SPI/QSPI works well below roughly 50–150 Mbps when framed with an interrupt line and DMA bursts. Move to a parallel memory bus (FSMC/EIM) for deterministic low-latency MCU register/buffer access up to ~1 Gbps, and use AXI4 (SoC FPGA) or PCIe when streaming high-channel ADC, vision, or SDR data continuously.

    Why should an external MCU write strobe never drive an FPGA flip-flop clock pin directly?

    External MCU bus strobes are asynchronous to the FPGA clock, lack dedicated global clock routing, and introduce hold/glitch hazards. Synchronizing strobes into the FPGA global clock domain and sampling edge transitions keeps timing analysis clean and deterministic.

    Which FPGA and processor platforms does XTELL support for combined hardware and RTL projects?

    XTELL delivers PCB design, RTL/timing closure, and processor firmware/Linux drivers across Lattice (LCMXO2), Microchip PolarFire (MPF100T), Xilinx, and Altera CPLD devices paired with STM32, NXP i.MX6, Rockchip, Allwinner, and Raspberry Pi hosts.

    Need Professional Services?

    Contact us for customized solutions and quotes