Lesson 21 of 25  ·  12 min read

Configuration Memory

FPGA Fundamentals & Architecture · 84% complete · 12 MIN

FPGA fabric is built from SRAM cells — they are volatile, fast, and infinitely rewritable, but they forget everything when power is removed. This lesson explains the bitstream format, how configuration memory is organized into frames, what external non-volatile memory options exist, and advanced topics like partial reconfiguration and bitstream security.

FPGA Configuration Fundamentals

Modern SRAM-based FPGAs — which includes virtually all high-performance devices from Xilinx/AMD, Intel/Altera, and Lattice — store their configuration in on-chip SRAM cells. These cells are fast, can be written millions of times, and offer excellent radiation performance, but they are fundamentally volatile: the instant power is removed, all configuration is lost.

This means every time the FPGA powers on, it must reload its configuration from an external non-volatile memory source. The configuration file — called a bitstream — is computed by the Vivado toolchain and encodes every aspect of the design onto the FPGA fabric.

The SRAM configuration cells program the following aspects of the FPGA:

  • LUT INIT values — the 64-bit truth table stored in every LUT6, defining the Boolean function it computes
  • Routing switches — which wire segments connect to which logic cells via programmable interconnect points (PIPs)
  • IO standards — voltage levels, drive strength, slew rate, differential termination for every IO pin
  • Clock settings — BUFG enables, MMCM/PLL multiplier and divider values, BUFR configurations
  • BRAM initial contents — if INIT values are specified in RTL, they are embedded directly in the bitstream
  • DSP48E1 mode bits — cascade enables, pipeline register enables, operational modes
Key Concept FPGA configuration memory is purely SRAM — it draws power to maintain state. The moment power is removed, all configuration is lost. This is why external NVM is mandatory in production systems.

Bitstream Format

Vivado generates the bitstream as a .bit file (for JTAG/Vivado programming) or a .bin file (for direct SPI flash writing). The binary format is standardized and contains several distinct fields:

  • Dummy words and sync word0xAA995566 marks the start of valid configuration data; the FPGA searches for this pattern after reset and ignores everything before it
  • Header section — .bit files include design name, part number, build date, and Vivado version as ASCII strings before the binary payload
  • Configuration packets — type-1 and type-2 packets carry register write commands and bulk data
  • FAR (Frame Address Register) — sets the destination frame address before each data write
  • FDRI (Frame Data Register Input) — the packet type that carries the actual frame configuration bits
  • CRC packets — cyclic redundancy check values verified after each major section; a mismatch aborts configuration

Bitstream sizes scale with device density. The complete bitstream must be loaded sequentially into the configuration controller on every power cycle:

Device Family Logic Cells Bitstream Size
XC7A35T Artix-7 33,280 ~17 MB
XC7A200T Artix-7 215,360 ~78 MB
XC7K325T Kintex-7 326,080 ~130 MB
XC7VX690T Virtex-7 693,120 ~230 MB

Bitstream encryption is supported via AES-256. When enabled in Vivado, the bitstream payload is encrypted with a 256-bit key stored in battery-backed BBRAM or one-time-programmable eFUSE cells on the device. Only a device programmed with the matching key can decrypt and load the bitstream, protecting proprietary IP against cloning or reverse-engineering.

Configuration Cell Organization

The bitstream is organized into frames — the smallest independently addressable unit of configuration memory. In Xilinx 7-series devices, the frame structure is:

  • Each frame = 101 words × 32 bits = 3,232 bits
  • Frames are addressed hierarchically: Block Type → Row → Column → Minor frame number within column
  • Block types: CLB frames, BRAM data frames, BRAM address frames, IOB frames, clock/CMT frames
  • XC7A35T contains approximately 7,000 total frames; XC7K325T contains approximately 24,000 frames

The frame-based organization is what enables partial reconfiguration. By writing only the frames belonging to a specific region, the FPGA can update that region while all surrounding logic continues to operate undisturbed. The FAR register in the configuration controller tracks which frame is currently being programmed.

graph TD BS["Bitstream .bit file"] --> SM["Sync Word + Header\n0xAA995566 + Device ID + Date"] BS --> FR["Configuration Frames\n(FAR addressed units)"] FR --> CLB_F["CLB Frames\nLUT INIT values + routing switches"] FR --> BRAM_F["BRAM Frames\nInitial memory contents"] FR --> IOB_F["IOB Frames\nIO standards + drive strength"] FR --> CLK_F["Clock Frames\nBUFG enables + MMCM settings"]
Suggested GIF: animation showing configuration frames loading one by one from SPI flash into the FPGA — each CLB column lighting up as its LUT INIT values are programmed, progressing left to right across the die, ending with the DONE pin going high and the design becoming active.

External Memory Options

Since FPGA configuration is volatile, every production design requires an external non-volatile memory to store the bitstream. The choice of memory type affects boot time, cost, density, board area, and interface complexity:

Memory Type Capacity Interface Boot Time Cost
SPI Flash 32Mb–2Gb Serial SPI (1/2/4-bit) 200ms–2s Low
BPI Flash (NOR) 64Mb–2Gb Parallel 8/16-bit 50–200ms Medium
NAND Flash 1Gb–32Gb Parallel Slow (ECC overhead) Very low
SD Card 4GB+ SPI mode 500ms+ Very low
JTAG (cable) N/A JTAG 4-wire 10–60s Cable cost only

SPI Flash is the dominant choice for production hardware — it needs only 4 PCB traces (CS_B, CLK, MOSI, MISO), is available from many vendors including Micron, Winbond, and Spansion, and Quad-SPI mode (x4) can halve load times compared to standard SPI. The FPGA's internal configuration controller natively drives SPI flash with no external logic required.

Configuration Modes

Three dedicated MODE pins (M[2:0]) on the FPGA package determine which configuration interface is used at power-on. These pins are sampled after POR deasserts and must be stable before that event. On the PCB they are typically tied to fixed logic levels via 1k–10k pull-up or pull-down resistors:

M[2:0] Mode Description
000 Master SPI FPGA drives SPI flash clock, asserts CS_B, reads bitstream autonomously from address 0
001 Master BPI FPGA drives parallel NOR flash with address bus and control signals (OE_B, WE_B)
010 Master Serial FPGA clocks data in from external shift register — legacy mode for older boards
011 JTAG Configured exclusively via JTAG cable — no autonomous boot from flash
100 Slave SelectMAP Host CPU sends bitstream over 8/16/32-bit parallel bus to the FPGA
101 Slave Serial Host CPU sends bitstream bit-by-bit via dedicated serial interface
110 Master SelectMAP FPGA autonomously reads from parallel NOR flash using wide data bus
Production Warning Never use JTAG as the sole configuration method in production hardware. JTAG programming is slow (tens of seconds to minutes) and non-persistent — the configuration is lost on every power cycle. Always provision SPI flash for field units so the device boots autonomously. JTAG remains available as a secondary debug/override path regardless of MODE pin settings.

Bitstream Security

When FPGA designs contain proprietary algorithms or licensed IP, the bitstream must be protected against unauthorized readback, cloning, or reverse-engineering. Xilinx 7-series and later devices provide a layered security architecture:

  • AES-256 Encryption — the bitstream is encrypted in Vivado using a 256-bit key. The AES-256 decryption engine is embedded in the FPGA configuration controller and operates transparently during boot. The SPI flash contains only ciphertext — useless without the device key.
  • eFUSE key storage — one-time programmable (OTP) eFUSE cells permanently burn the AES key into the device during factory programming. Once programmed, eFUSE keys cannot be erased or read back via any interface. BBRAM provides an alternative battery-backed volatile key store that can be updated in the field.
  • JTAG readback disable — bitstream readback and partial readback via JTAG can be permanently disabled via eFUSE programming, preventing IP extraction even if a deployed device is captured.
  • Xilinx Secure Boot — available on UltraScale and Zynq devices, combining AES-256 encryption with RSA-2048 or ECDSA-256 authentication. This ensures both confidentiality (no one can read the design) and authenticity (only genuine Xilinx-toolchain-generated bitstreams load).

Partial Reconfiguration (PR)

One of the most powerful features enabled by the frame-based configuration architecture is Partial Reconfiguration (PR). PR allows a designated region of the FPGA — called a Reconfigurable Partition (RP) — to be reconfigured while the rest of the device continues operating without any interruption or glitching.

A partial bitstream is generated by Vivado and contains only the configuration frames that fall within the RP boundaries. When loaded via ICAP (Internal Configuration Access Port) or an external interface, only those frames are overwritten — the surrounding logic is untouched and continues clocking. The RP boundary pins remain stable during reconfiguration, isolating the rest of the design from any transient state.

Common applications of partial reconfiguration:

  • Adaptive computing — swap in different processing kernels (FFT, FIR, AES, compression) based on runtime workload without stopping the system
  • Multi-function overlays — a single FPGA chip time-multiplexes multiple independent applications by reconfiguring the RP
  • Field design updates — update a specific subsystem in a deployed product (e.g., upgrade the signal processing core) without rebooting the host CPU or disrupting live data links
  • Fault recovery in space/defense — if radiation-induced errors corrupt a module, reconfigure it from a stored golden image while the rest of the system continues operating

In Vivado, enable PR via: Tools → Enable Partial Reconfiguration → define Reconfigurable Modules for each partition → synthesize each RM independently → implement with PR DRC rules enabled → generate full and partial bitstreams.

Pro Tip: Compressed Bitstreams Use compressed bitstreams (Vivado → Bitstream Settings → Enable Bitstream Compression) to reduce SPI flash storage requirements by up to 50% and significantly speed up boot time. Compression is especially effective for designs with many unused resources — a sparse design on a large device can compress to 20% of its original size. Compression is lossless and fully transparent to the configuration controller.
Interview Question Q: Why are FPGAs SRAM-based rather than using non-volatile memory for configuration?

A: SRAM can be written and erased millions of times at extremely high speed, enabling rapid reconfiguration (including partial reconfiguration in milliseconds) with no wear-out concerns. Flash memory — as used in flash-based FPGAs from Lattice and Microchip — has limited write endurance (typically 100,000 cycles), slower write speeds, and is susceptible to single-event upsets (SEUs) from cosmic radiation in space applications where the upset is permanent until reprogrammed. SRAM FPGAs can be continuously scrubbed and reconfigured to recover from SEUs, which is critical in defense and space systems.

Knowledge Check

1. What file extension is Vivado's primary bitstream output format used for JTAG and Hardware Manager programming?
  • A.bin
  • B.bit
  • C.hex
  • D.mcs
Correct! The .bit file is the primary Vivado bitstream output. It contains an ASCII header with design metadata (device, date, version) followed by the binary configuration payload. The .bin file is a raw binary without the header, typically used for direct SPI flash programming via write_cfgmem.
2. FPGA SRAM configuration cells lose their state when:
  • AA new bitstream is received via JTAG
  • BPower is removed from the device
  • CThe device reaches operating temperature
  • DThe DONE pin goes high
Correct! SRAM is volatile by nature — it requires continuous power (VCC above the retention voltage) to hold its data. The moment VCC drops, all configuration bits reset and the entire FPGA design is erased. This is a fundamental characteristic of SRAM technology, not a defect, and is why external NVM is always required.
3. Which configuration mode is selected when M[2:0] = 000?
  • AJTAG
  • BSlave SelectMAP
  • CMaster SPI
  • DMaster BPI
Correct! M[2:0] = 000 selects Master SPI mode — the most common production boot mode. In this mode the FPGA autonomously drives the SPI flash clock, asserts CS_B, sends the read command, and clocks in the full bitstream starting at address 0. Only 4 PCB signals are needed: CS_B, CLK, MOSI, and MISO.
4. What encryption standard protects Xilinx 7-series FPGA bitstreams?
  • ADES-56
  • BRSA-2048
  • C3DES-168
  • DAES-256
Correct! AES-256 (Advanced Encryption Standard with a 256-bit key) is the bitstream encryption algorithm for Xilinx 7-series and later devices. The decryption engine is embedded in the FPGA's configuration controller. The 256-bit key is stored in either battery-backed BBRAM or permanently in one-time-programmable eFUSE cells.
5. Partial Reconfiguration (PR) enables which capability?
  • AFaster boot from SPI flash by skipping unused frames
  • BRunning the FPGA without any external flash memory
  • CUpdating one FPGA region without stopping the rest of the design
  • DEncrypting the bitstream automatically at runtime
Correct! Partial Reconfiguration allows a defined Reconfigurable Partition to be reprogrammed with a partial bitstream while all surrounding logic continues operating undisturbed. This is possible because configuration memory is organized as independently addressable frames — only the frames within the RP boundary are overwritten.

Practical Exercise

Hands-On: Explore Vivado Bitstream Settings and the .bit File Format

In Vivado, generate a bitstream for any target device. Open Bitstream Settings via Flow Navigator → Generate Bitstream → right-click → Bitstream Settings. Work through these steps:

  1. Enable Bitstream Compression (Configuration tab → Enable Bitstream Compression = Yes). Regenerate the bitstream and note the original vs compressed .bit file sizes. Typical savings are 30–50% for moderately utilized designs.
  2. Enable AES Encryption with a test key (Security tab → Encryption = Enable). Choose BBRAM as the key storage location to avoid permanently burning eFUSE during experimentation. Compare encrypted vs unencrypted file sizes.
  3. Open the .bit file in a hex editor (e.g., HxD on Windows). The file begins with ASCII text — the design name and part number. Scroll until you find the sync word: AA 99 55 66. Everything after this is the binary configuration packet stream.
  4. In Vivado TCL console, run write_cfgmem -format mcs -size 32 -interface SPIx4 -loadbit "up 0x0 design.bit" design.mcs to generate an MCS file for SPI flash programming. Note how the flash address map is organized.
Bitstream SRAM Configuration SPI Flash AES-256 Partial Reconfiguration Configuration Frames MODE Pins eFUSE MultiBoot