FPGARelated.com

DDR Memory

Category: Protocols | Also known as: DDR, DDR2, DDR3, DDR4

DDR (Double Data Rate) SDRAM is a class of synchronous DRAM that transfers data on both the rising and falling edges of the clock, doubling throughput compared to single data rate (SDR) SDRAM at the same clock frequency. Successive generations -- DDR, DDR2, DDR3, DDR4, and DDR5 -- raise clock speeds, lower core voltages, and introduce deeper prefetch buffers to increase bandwidth.

In practice

DDR memory appears primarily in higher-end embedded platforms: application processors (Cortex-A, MIPS, RISC-V Linux-class SoCs), FPGAs with hard or soft memory controllers, and DSPs handling large data sets. Microcontroller-class devices (Cortex-M, AVR, PIC) typically use on-chip SRAM or external SRAM/PSRAM rather than DDR, because DDR requires a dedicated, carefully timed memory controller and a PCB layout designed for high-frequency differential signals.

Interfacing DDR from an FPGA is one of the more demanding tasks in embedded design. The memory controller must handle command/address timing, DQS (data strobe) capture, read/write leveling, ZQ calibration, and periodic refresh -- all with sub-nanosecond margins. On FPGAs, vendors supply hard memory controllers (Xilinx MIG, Intel EMIF) or verified soft-IP cores precisely because hand-rolling this logic reliably is extremely difficult. On SoCs such as the NXP i.MX series, Allwinner, or Rockchip parts, the DDR controller is a hard block and initialization is handled by a vendor-supplied DRAM training sequence in the bootloader (U-Boot SPL, for example).

PCB layout is a major source of bring-up problems. DDR traces must be length-matched within tight tolerances (often a few hundred micrometers per byte lane for DDR3/DDR4), terminated correctly, and routed to minimize crosstalk. Voltage reference (VREF) and on-die termination (ODT) settings are also generation-specific. A mistake caught in layout review is far cheaper than one discovered during signal integrity debug.

Power sequencing matters as well. DDR2 runs at 1.8 V, DDR3 typically at 1.5 V (with DDR3L variants at 1.35 V), and DDR4 at 1.2 V; low-power variants and some vendor-specific parts may differ. Many SoCs require VDD_DDR to ramp before or alongside the core supply in a specific order; violating this can cause the DRAM to fail training or sustain latent damage.

 Learn this in FPGA Fundamentals

Discussed on FPGARelated

Frequently asked

Can I use DDR memory with a Cortex-M microcontroller?
A small number of Cortex-M parts include an FMC (Flexible Memory Controller) peripheral that supports SDRAM, but most of those support SDR SDRAM, not DDR. True DDR support on Cortex-M class devices is rare. If you need large external RAM on a Cortex-M design, PSRAM (pseudo-SRAM with a simple parallel or SPI/QSPI interface) or SRAM with the FMC are the practical options.
What is the difference between DDR, DDR2, DDR3, DDR4, and DDR5?
Each generation raises the maximum data rate, lowers supply voltage, and increases the internal prefetch depth. DDR1 prefetches 2 bits per pin; DDR2 and DDR3 prefetch 4 and 8 bits respectively; DDR4 also uses an 8-bit prefetch but improves signaling and bank organization. DDR5 moves to 16-bit prefetch, splits the data bus into two channels per DIMM, and pushes per-pin rates past 6.4 Gbps. The generations are physically and electrically incompatible -- differing in pin counts, keying, voltages, and signaling specifications.
What is read/write leveling and why does it matter?
At DDR3 and DDR4 speeds, trace length variations and package delays mean each data strobe (DQS) and data pin arrives at slightly different times relative to the clock. Leveling is a training procedure run at boot where the memory controller sweeps delay values to find the valid sampling window for each byte lane. Without leveling, data captured from DRAM is unreliable. SoC vendors include this training in their bootloader initialization code; on FPGAs, the hard or soft memory controller IP runs the same procedure automatically.
How does LPDDR differ from standard DDR?
LPDDR (Low Power DDR) targets mobile and battery-operated embedded systems. It uses lower voltages (LPDDR4 at 1.1 V, LPDDR5 at 1.05 V), supports deeper low-power states (self-refresh with partial array retention), and uses a different physical interface with a fly-by topology on some versions. Electrically and mechanically, LPDDR is incompatible with standard DDR. It appears in SoCs for phones, tablets, and embedded Linux boards such as those using NXP i.MX 8, Rockchip RK3399, or Qualcomm application processors.
Why is DDR bring-up on an FPGA so difficult?
FPGAs lack the analog PHY structures (DLL/PLL tap delays, differential I/O with programmable impedance) built into dedicated DRAM controllers on SoCs. The FPGA vendor's memory interface IP (Xilinx MIG for 7-series/UltraScale, Intel EMIF for Cyclone/Arria/Stratix) abstracts this, but it requires careful pin assignment to specific I/O banks, correct XDC/SDC constraints, and a board that meets the signal integrity requirements. Using pins outside the supported I/O banks, skipping length matching, or running the interface faster than the FPGA speed grade supports are common reasons a DDR interface fails to train.

Differentiators vs similar concepts

DDR is often conflated with LPDDR, PSRAM, and HBM. LPDDR shares the double data rate architecture but uses a different physical interface, lower voltages, and deeper sleep states targeting mobile/embedded power budgets -- the two are electrically incompatible. PSRAM (pseudo-SRAM) presents a simple SRAM-like parallel interface or SPI/QSPI interface with no explicit refresh or training requirement, making it usable from microcontrollers, at the cost of lower bandwidth. HBM (High Bandwidth Memory) is a DRAM family that transfers data on both edges of strobe/clock-like signals over a wide parallel interface on an interposer, targeting GPU and HPC workloads -- it is architecturally distinct from standard DDR interfaces and does not appear in typical embedded designs. Within the DDR family, each generation (DDR2/3/4/5) is electrically and physically incompatible with the others despite sharing the same double data rate principle.