Lesson 22 of 25  ·  10 min read

FPGA Configuration Process

FPGA Fundamentals & Architecture · 88% complete · 10 MIN

What actually happens between the moment you apply power and the moment the DONE pin goes high? This lesson walks through every stage of the FPGA configuration process — Power-On Reset, SRAM clearing, mode detection, bitstream loading, CRC verification, the startup sequence, and finally user mode. Understanding this sequence is essential for board bring-up, debugging boot failures, and implementing reliable field update strategies like MultiBoot.

Power-On Reset (POR)

The configuration process begins as soon as FPGA power supplies ramp up. The FPGA has an internal Power-On Reset (POR) circuit that monitors the core supply voltage (VCCINT). Until VCCINT crosses a minimum threshold and remains stable for a defined hold time, the POR circuit keeps the entire device in reset.

During POR:

  • All configuration SRAM cells are cleared to 0 — all routing switches open, all LUTs set to output 0
  • All IO pins are placed in a high-impedance, input-only state to avoid bus contention
  • The INIT_B pin is driven low, signaling to external circuits that the FPGA is not yet ready
  • The MODE pins M[2:0] are sampled and latched — the values must be stable before POR deasserts

When VCCINT is stable and the POR hold time expires, INIT_B rises to indicate the FPGA is ready to accept configuration data. On some boards an external circuit can hold INIT_B low longer than necessary (by driving it low externally) to delay configuration start — this can be useful for synchronizing multiple FPGAs.

Configuration Phase State Machine

The FPGA internal configuration controller implements a state machine with five sequential phases. Each phase must complete successfully before the next begins:

Phase 1
Initialization
POR releases. INIT_B goes high. MODE pins are latched — the configuration source (SPI, JTAG, SelectMAP, etc.) is now fixed until the next power cycle or PROGRAM_B pulse. The configuration controller enters the appropriate interface mode and prepares to receive bitstream data.
Phase 2
Configuration Loading
Bitstream frames are loaded sequentially into the configuration SRAM. In Master SPI mode, the FPGA drives the SPI flash clock and reads bitstream bytes. In Slave SelectMAP, the host CPU writes data to the FPGA data bus. The configuration controller writes each frame to the address specified by the FAR register.
Phase 3
CRC Verification
After each major section of the bitstream, the configuration controller verifies a CRC value embedded in the bitstream against the CRC it computed from the received data. If the CRC matches, loading continues. A CRC mismatch causes the controller to assert INIT_B low again (configuration error) and halt — it does not proceed to user mode.
Phase 4
Startup Sequence
Once all frames are loaded and CRCs pass, the startup sequencer executes a configurable sequence of events: releasing global three-state (GTS), releasing global set/reset (GSR), activating end-of-startup (EOS), and finally asserting the DONE pin. The user design must not begin operation until GSR is released.
Phase 5
User Mode
DONE pin goes high. The user design begins operating — all clocks are running, all IOs are actively driving per the bitstream IO settings, and the user RTL logic begins executing. Configuration mode pins are no longer sampled. JTAG remains active for debug access.

Startup Sequence Detail

The startup sequence is a programmable series of events controlled by the COR0 (Configuration Option Register 0). The key events and their order are:

  • GTS release — Global Three-State release: IO output drivers become active. Before this event all FPGA IOs are high-impedance even though configuration is complete.
  • GSR release — Global Set/Reset release: all flip-flops are released from their power-up reset state. The user design's flip-flops begin in a known state (set or reset according to their INIT attribute) and then begin clocking.
  • EOS (End of Startup) — signals to the configuration controller that startup is complete.
  • DONE assertion — DONE pin goes high. External circuits monitoring DONE know the FPGA is fully operational.

The startup clock source is configurable: JTAG clock (JTAGCLK), a user-provided clock (USERCLK2), or the internal configuration oscillator (CFGMCLK at ~65 MHz). The startup sequence typically completes within a few hundred nanoseconds after the last bitstream byte is loaded.

Master SPI Boot Sequence — Step by Step

Master SPI is the standard production boot mode. Here is the exact sequence of events from power-on to user mode:

graph TD A["Power On\nVCCINT ramps up"] --> B["POR: VCCINT stable\nINIT_B held low\nSRAM cleared"] B --> C["M[2:0] sampled\nSPI mode confirmed\nINIT_B rises"] C --> D["Assert CS_B on SPI flash\nSend 0x03 READ command\n+ 24-bit address 0x000000"] D --> E["Clock in bitstream bytes\nfrom SPI flash at CCLK rate\n(default 3.125 MHz, up to 100 MHz)"] E --> F["Parse sync word 0xAA995566\nBegin frame loading via FAR+FDRI"] F --> G["CRC check after each section"] G --> H{"CRC OK?"} H -->|Yes| I["Continue loading next section"] H -->|No| J["Assert INIT_B low\nHalt — Config Error\nWait for PROGRAM_B pulse"] I --> K["All frames loaded\nDeassert CS_B on SPI flash"] K --> L["Startup sequence:\nGTS release → GSR release → EOS"] L --> M["DONE pin goes HIGH\nUser mode active\nDesign begins operation"]

Configuration Time by Device

Configuration time is determined by bitstream size divided by interface bandwidth. The table below shows theoretical loading times at the specified SPI clock rates. Real-world times may be slightly longer due to flash latency and protocol overhead:

Device Bitstream Size SPI x1 @ 50 MHz SPI x4 (QSPI) @ 50 MHz BPI @ 100 MHz
XC7A35T ~17 MB ~2.7 s ~0.7 s ~1.4 s
XC7A200T ~78 MB ~12.5 s ~3.1 s ~6.3 s
XC7K325T ~130 MB ~20.8 s ~5.2 s ~10.4 s
XC7VX690T ~230 MB ~36.8 s ~9.2 s ~18.4 s

JTAG Configuration

JTAG (IEEE 1149.1) is always available as a programming and debug interface regardless of MODE pin settings. The four JTAG signals are:

  • TCK — Test Clock: clocks the JTAG state machine and data shift registers
  • TMS — Test Mode Select: controls the JTAG state machine transitions
  • TDI — Test Data In: serial data input to the device
  • TDO — Test Data Out: serial data output from the device (captured on TDI edge)

In Vivado Hardware Manager: Open Target → Auto Connect → Program Device → select .bit file → Program. Multiple FPGA devices can be daisy-chained in a JTAG scan chain — TDO of device N connects to TDI of device N+1, sharing TCK and TMS. Vivado supports scan chains with up to 40+ devices. Recommended JTAG cables: Xilinx Platform Cable USB II or Digilent JTAG-SMT3-NC.

SelectMAP Configuration (CPU-Driven)

SelectMAP allows a host processor to push the bitstream to the FPGA over a parallel bus. This is the configuration method used in Zynq-7000 systems where the ARM Processing System (PS) programs the Programmable Logic (PL) after booting Linux or a bare-metal application.

  • Bus width: 8, 16, or 32 bits. Wider buses dramatically reduce configuration time.
  • Byte-wide SelectMAP bandwidth: at 100 MHz → 100 MB/s → XC7K325T loads in ~1.3 seconds
  • 32-bit SelectMAP: theoretical 400 MB/s → XC7K325T in ~330 ms
  • ICAP (Internal Configuration Access Port) — a dedicated primitive available in the FPGA fabric that allows the user design itself to write partial bitstreams to the FPGA configuration controller. Used for partial reconfiguration, MultiBoot management, and in-field design updates.

Configuration Error Recovery

If configuration fails — due to a corrupted bitstream, CRC mismatch, wrong bitstream for the device, or a noisy SPI bus — the FPGA indicates the error by reasserting INIT_B low. DONE will not go high. Recovery options:

  • PROGRAM_B pulse — asserting PROGRAM_B low for at least 300 ns clears the configuration SRAM and restarts the entire configuration process from Phase 1. On production boards, this pin is often connected to a watchdog timer or supervisor IC.
  • Watchdog supervisor — if DONE does not go high within a defined timeout (e.g., 5 seconds for a large device), the supervisor pulses PROGRAM_B to trigger a retry. After N retries, the supervisor can switch to a golden bitstream address.
  • IPROG primitive — available from within running FPGA fabric, IPROG asserts PROGRAM_B internally and instructs the configuration controller to boot from a new address in SPI flash. Used to implement software-triggered reboot and MultiBoot.

MultiBoot / Golden Image Strategy

MultiBoot is Xilinx's mechanism for storing multiple bitstreams in SPI flash and automatically selecting between them based on boot success. Every production system handling field firmware updates should implement a MultiBoot scheme:

  • Golden image — stored at SPI flash address 0. Contains a known-good, proven bitstream that should never be overwritten during field updates. The FPGA always boots from address 0 on power-on.
  • Upgrade image — stored at a higher flash address (e.g., 0x400000). After verification, the golden image uses the WBSTAR (Warm Boot Start Address) register to redirect to the upgrade image address and triggers IPROG.
  • Fallback mechanism — if the upgrade image fails (DONE does not go high within the POR timeout), the FPGA's internal MultiBoot watchdog automatically boots the golden image at address 0.
  • Typical flash layout:
Flash Address Content Notes
0x000000 Golden bitstream Never overwritten by OTA updates
0x400000 Upgrade bitstream slot A Active upgrade image
0x800000 Upgrade bitstream slot B Secondary slot for A/B updates
0xC00000 User data / parameters Calibration, serial numbers, etc.
Board Bring-Up Tip The DONE pin is your most important debug signal during initial board bring-up. If DONE does not go high within the expected configuration time, the boot failed. Check: (1) SPI flash is correctly programmed and powered, (2) SPI clock traces are routed cleanly, (3) MODE pins are tied correctly for Master SPI, (4) VCCINT supply is stable before INIT_B is expected to release.
Pro Tip: MultiBoot in Every Production Design Implement MultiBoot with a golden image for all production hardware — even if you don't plan field updates initially. Storage costs nothing (a few MB of flash), but the fallback protection it provides can save an entire product recall if a field update corrupts the upgrade slot. The golden image should be programmed during factory testing and never touched again.
ICAP Safety Warning Never power down the FPGA mid-configuration when using ICAP for in-system partial reconfiguration. If power is removed while ICAP is writing a partial bitstream, the configuration SRAM will be left in an indeterminate state and the device will fail to boot on the next power cycle. Always complete the ICAP transaction before allowing power removal, and implement a safe shutdown sequence in your design.
Interview Question Q: How does an FPGA fall back to a golden bitstream after a failed firmware update?

A: Using MultiBoot — two bitstreams are stored in SPI flash. The golden image lives at address 0 and is never overwritten. During normal operation, the golden image writes the upgrade bitstream address into the WBSTAR register and triggers IPROG to redirect boot to the upgrade slot. If the upgrade image fails to reach user mode (DONE stays low within the internal MultiBoot watchdog timeout), the configuration controller automatically resets and boots from address 0, loading the golden image. This recovery happens entirely in hardware with no external CPU intervention required.

Knowledge Check

1. Which FPGA pin indicates that configuration has completed successfully and the user design is active?
  • AINIT_B
  • BPROGRAM_B
  • CDONE
  • DTCK
Correct! The DONE pin goes high only after all configuration frames have been loaded, CRC verification has passed, and the startup sequence (GTS release, GSR release, EOS) has completed. External circuits monitoring DONE can use it to enable downstream logic, release bus arbitration, or signal to a supervisory processor that the FPGA is fully operational.
2. What signal must go low during Power-On Reset to indicate the FPGA is not yet ready for configuration?
  • AINIT_B
  • BDONE
  • CTMS
  • DCS_B
Correct! INIT_B is driven low by the FPGA during Power-On Reset while the configuration SRAM is being cleared. It rises when the FPGA is ready to accept bitstream data. If INIT_B stays low longer than expected, it can indicate either a slow supply ramp, insufficient POR hold time, or (after configuration starts) a CRC error that has aborted the configuration process.
3. The ICAP (Internal Configuration Access Port) allows what capability?
  • AProgramming an adjacent FPGA via JTAG
  • BEncrypting bitstreams at runtime
  • CThe FPGA user design to reconfigure the FPGA from within the fabric
  • DReading back the active bitstream to verify its contents
Correct! ICAP is a hard primitive embedded in the FPGA fabric that provides a direct interface to the configuration controller. The user design can write partial bitstreams to ICAP to perform partial reconfiguration, write to the WBSTAR register to set the next boot address, or trigger IPROG to initiate a warm reboot — all without any external hardware involvement.
4. MultiBoot solves which critical production hardware problem?
  • AReducing SPI flash boot time by half
  • BAutomatic recovery from failed field firmware updates
  • CEncrypting the bitstream during SPI flash programming
  • DEnabling JTAG programming in the field
Correct! MultiBoot enables automatic fallback to a known-good golden image if a field firmware update fails. Without MultiBoot, a failed update could permanently brick the device — it would fail to boot with no recovery path. With MultiBoot, the golden image at address 0 always provides a recovery path, making field updates safe.
5. The SelectMAP configuration interface supports which bus widths?
  • A1, 2, or 4 bits (serial variants only)
  • B4, 8, or 16 bits
  • C8, 16, or 32 bits
  • D64 bits only
Correct! SelectMAP supports 8-bit, 16-bit, and 32-bit parallel bus widths. The 32-bit version is used in high-performance Zynq PL programming scenarios where fast configuration time is critical. At 100 MHz with 32-bit bus, theoretical throughput is 400 MB/s — loading a 130 MB bitstream in under 400 milliseconds.

Practical Exercise

Hands-On: Measure FPGA Configuration Time with an Oscilloscope

On a board with a Xilinx FPGA and SPI flash, measure the exact configuration time using a 2-channel oscilloscope:

  1. Connect Channel 1 to the INIT_B pin and Channel 2 to the DONE pin. Set both channels to 3.3V scale, 500ms/div time base.
  2. Trigger on Channel 1 rising edge (INIT_B going high = configuration starting). Power cycle the board.
  3. Measure the time between INIT_B rising and DONE rising — this is the total configuration time. Compare against the theoretical value from the table above.
  4. If measured time is much longer than theoretical: probe the SPI CLK pin and measure the actual clock frequency. Many boards default to CCLK = 3.125 MHz instead of 50 MHz — check the SPI_BUSWIDTH and CONFIGRATE Vivado bitstream settings.
  5. Enable QSPI (x4) mode in Vivado settings and reprogram. Measure again — boot time should decrease by ~4×.
Power-On Reset DONE Pin INIT_B Startup Sequence Master SPI Boot SelectMAP ICAP MultiBoot Golden Image WBSTAR