Configuration Memory
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
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 word —
0xAA995566marks 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.
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 |
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.
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
- A.bin
- B.bit
- C.hex
- D.mcs
- AA new bitstream is received via JTAG
- BPower is removed from the device
- CThe device reaches operating temperature
- DThe DONE pin goes high
- AJTAG
- BSlave SelectMAP
- CMaster SPI
- DMaster BPI
- ADES-56
- BRSA-2048
- C3DES-168
- DAES-256
- 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
Practical Exercise
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:
- 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.
- 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.
-
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. -
In Vivado TCL console, run
write_cfgmem -format mcs -size 32 -interface SPIx4 -loadbit "up 0x0 design.bit" design.mcsto generate an MCS file for SPI flash programming. Note how the flash address map is organized.