Skip to content
VLSI Mentor

DDR · Module 1

The Memory Hierarchy

Why a processor needs several storage technologies instead of one. Speed, capacity, cost per bit, power and physical distance from compute cannot all be maximised at once, and the hierarchy is what that conflict forces — with DRAM holding the working-memory tier that DDR exists to drive.

Before you meet a single DDR command, timing parameter or training step, answer the question the whole standard exists to serve: why does a processor need a hierarchy of different storage technologies at all? A modern system holds data in register files, in two or three levels of cache, in main memory, and in persistent storage — four tiers, built on different storage mechanisms, with different rules, all managed at once. That is not historical accident or unfinished engineering. It is what happens when the properties you want from memory conflict with each other.

This chapter builds the model the rest of the curriculum stands on. Once you can say why a capacity tier has to exist and what it must give up in exchange for capacity, DRAM stops being a component you memorise facts about and becomes the predictable consequence of a trade-off — and DDR becomes the discipline that lets a processor actually use it.

1. Start From the Memory We Cannot Build

Design the ideal memory first. Write down what you want, without worrying yet about whether it is achievable:

  • Fast — an access answered within the time budget of a single instruction, so the pipeline never waits.
  • Large — enough capacity for every program, dataset and operating-system structure the machine will ever hold at once.
  • Cheap per bit — affordable at that capacity, because capacity is bought in bits.
  • Low power — because energy per access and static power both scale with how much storage you build.
  • Persistent — contents survive a power cycle.
  • Physically close to compute — because distance is delay, and because moving a bit a long way costs energy.

Each property is reasonable. Any two of them can be satisfied together. All six cannot, and the reasons are structural rather than a matter of effort.

Speed argues with capacity. A storage array is a physical structure: a larger array means longer wires, more decode, and more distance between the point of access and the cell being accessed. Growing an array makes it slower even when nothing else changes.

Speed argues with cost per bit. The cell designs that answer quickly are the ones that spend the most silicon per bit. The cell designs that are cheap per bit are cheap precisely because they store a bit with almost nothing — and something that stores a bit with almost nothing is harder and slower to read reliably.

Persistence argues with speed. Retaining a bit without power means holding it in a physically stable state rather than in a circuit that is actively maintained — and establishing or reading such a state is not as quick as switching a powered one.

Proximity argues with capacity. The space immediately adjacent to an execution pipeline is the most contested area on a die. Whatever sits there must be small, because everything else that needs to be close is competing for the same place.

2. What the Hierarchy Actually Is

The hierarchy is a set of storage tiers, ordered by distance from the execution pipeline. Each tier makes a different trade among the six properties above, and data is promoted toward compute when it is being used and left further away when it is not. Moving down the tiers, capacity generally grows and cost per bit generally falls, while access latency generally rises.

Four storage tiers ordered from closest to compute to furthest: the register file inside the execution path, SRAM caches near the core, DRAM main memory off-chip as the capacity tier, and non-volatile storage as the persistent tier.RegistersInside the execution path · named by instructions · smallestInside the execution path · named by instructions · smallestCaches (SRAM)Near the core · hardware-managed · holds the active working setNear the core · hardware-managed · holds the active working setMain memory (DRAM)The capacity tier · addressable working memory · volatileThe capacity tier · addressable working memory · volatilePersistent storageSurvives power loss · block-oriented · furthest from computeSurvives power loss · block-oriented · furthest from compute
Figure 1 — the storage tiers, ordered by distance from execution; DRAM is the tier this curriculum is about.

Two cautions about reading a figure like this one.

First, the ordering is real but the spacing is not. Do not infer a fixed ratio between tiers from a diagram, and be sceptical of anyone who quotes one as a law: the relationships are tendencies produced by technology and cost, and they move with every generation and every product class.

Second, a tier is a place data can be, which is not the same thing as a component data passes through. That distinction becomes important in §8, and getting it backwards is one of the most common errors in a whiteboard answer.

3. Registers — Storage Inside the Execution Path

Registers are the top tier because they are not really reached at all: they sit inside the pipeline that uses them, read and written as part of executing an instruction rather than as a separate journey.

Two properties follow from that placement. They are the fastest storage in the machine, because there is no distance to cover and no lookup to perform — an instruction names the register directly. And they cannot supply system-scale capacity, because the register file is deliberately tiny: every additional architectural register consumes encoding space in the instruction format, and every additional entry adds area and timing pressure to a structure the pipeline must read and write every single cycle.

That is the whole argument at this level. Chapter 1.2 takes the register file apart properly.

4. Cache — Fast Storage That Earns Its Place Through Locality

Below the registers sit one or more levels of cache, built from SRAM: a cell that holds its bit in a self-sustaining circuit of several transistors (the classic arrangement uses six) and needs no periodic maintenance while powered. It answers quickly and it costs a lot of silicon per bit, which is exactly the trade you want for something small and close.

The interesting question is not what SRAM is, but why a cache helps at all. A cache is smaller than the data a program uses. If accesses were spread uniformly across everything the program owns, a small fast store would almost never hold the thing being asked for, and the effort would be wasted.

Caches work because real access patterns are not uniform — a property called locality, developed in §7. For now, hold the consequence: a cache is a bet that the data used recently, and the data near it, will be used again soon. When the bet pays off, most accesses are answered close to the core. When it does not, the access continues down the hierarchy.

One structural point worth fixing early, because it shapes how DDR traffic is generated: caches are not separately addressable in the programmer's model. An instruction names a memory address, not a cache level. Hardware decides which tier answers, and it is that decision — invisible in the program — that determines whether a request ever reaches main memory at all.

Chapter 1.3 owns SRAM as a technology.

5. Main Memory — The Capacity Tier

Now the tier this curriculum is about.

A system needs far more working memory than registers and caches can economically provide. Everything currently loaded needs somewhere to live and be addressed: program code, the data structures a program is actively working through, operating-system state, buffers that devices are filling or draining. All of it must be reachable by ordinary loads and stores, because that is the only way a processor touches memory.

Building that capacity out of the cache tier's technology is not an option — not because it would fail to work, but because cost per bit and area per bit make it uneconomic at the capacity required, and because a much larger array would be a much slower array anyway. So the system adds a tier with a different compromise: give up latency and give up being on-die, and buy capacity and cost per bit in exchange.

DRAM is the technology that took that tier. It stores each bit as charge on a small capacitor reached through a single transistor, which is why it is dramatically denser and cheaper per bit than SRAM — and why it has consequences SRAM does not: the charge leaks, so the contents must be periodically refreshed; sensing that small a quantity of charge is a delicate operation rather than an instant read; and an access has to be sequenced rather than simply performed.

That last consequence is the one to carry forward. Reading DRAM is not a single event. It is a short series of steps the device requires, in order, with minimum times between them. Everything that makes DDR an engineering discipline — commands, timing parameters, scheduling, the existence of a controller at all — grows from that fact.

6. Persistent Storage — A Different Job Entirely

The bottom tier is not simply a slower version of main memory. It answers a different requirement.

DRAM is volatile: remove power and the contents are gone. Anything that must outlive a power cycle — a filesystem, an installed program, a saved dataset — therefore needs a tier built on a mechanism that retains without power. Flash-based storage provides that, and pays for it in two ways that matter to this discussion: it is much slower to reach, and it is organised in pages and blocks rather than individual words, so it is accessed in sizeable chunks rather than by a load naming an address.

That second property is the reason storage sits outside the processor's normal memory path rather than being another stop along it. Data is brought into main memory to be worked on, and written back when it must be preserved. Storage is where data lives; main memory is where data is used.

This curriculum goes no further into storage than that role. Its job here is to mark the boundary at the bottom of the hierarchy so the tier above it — DRAM — has a defined purpose.

7. Why the Hierarchy Works — Locality

A hierarchy only helps if the small, fast tiers can answer most requests. That depends entirely on a property of real programs.

Temporal locality — a location accessed now is likely to be accessed again soon. Loop counters, stack frames, a hot data structure, the instructions of an inner loop: all are touched repeatedly over a short interval.

Spatial locality — when one location is accessed, nearby locations are likely to be accessed soon after. Walking an array, executing straight-line code, reading the fields of a structure: all sweep through adjacent addresses.

Hardware turns both into policy. Temporal locality justifies keeping recently used data close. Spatial locality justifies fetching in fixed-size blocks — a cache moves a whole line, not a single byte, because the neighbours are likely wanted too.

This is also where the hierarchy's behaviour becomes something you can reason about quantitatively rather than rhetorically. The set of data a program is actively using over some interval is its working set. Compare it against the cache capacity available and three regimes fall out:

  • Working set fits comfortably — most accesses are answered near the core. Main memory sees little traffic beyond the initial fill.
  • Working set is larger than cache — misses become routine, and each one produces a request the memory subsystem must serve. Main-memory traffic scales with how badly the fit fails.
  • Access pattern has no locality to exploit — even a large cache cannot help, because each access is unrelated to the last. A cache retains data that is never asked for again.

That chain — working set → cache behaviour → main-memory traffic — is the bridge between everything above DRAM and everything this curriculum teaches below it. Cache misses are not incidental. They are the mechanism by which DDR traffic is created.

8. Where DDR Enters

Now connect the hierarchy to a real access path. A load that cannot be answered by any cache does not reach the DRAM device directly. It travels through logic whose entire job is to turn a memory request into something a DRAM device will accept.

A cache miss travels from the core through the cache hierarchy to the memory controller, then to the DDR PHY, and finally to the DRAM device. The core, caches and DRAM are storage tiers; the memory controller and DDR PHY are path components that hold no data.Coreregisters + executionCache hierarchyL1 / L2 / L3 — a tierMemory controllerpath logic, not a tierDDR PHYpath logic, not a tierDRAM devicethe capacity tierload / storeon a misscommandsDDR channel12
Figure 2 — the path a cache miss follows, top to bottom; the grey blocks are path logic, not storage tiers.

Read the path one stage at a time, staying deliberately high-level — each stage is a module of its own later on.

The core issues loads and stores against addresses. It has no notion of DRAM.

The cache hierarchy answers what it can. What it cannot answer becomes a request aimed at main memory. This is the point at which DDR traffic is born.

The memory controller is where a memory request becomes a DRAM operation. It translates an address into the device's own coordinates, produces the sequence of commands the device requires, respects the minimum times the device imposes between those commands, and decides the order in which pending requests are served. Modules 17 and 18 build it.

The DDR PHY is where logical commands and data become signalling on a physical channel, and where returning data is captured with enough timing margin to be trusted. Modules 19 to 21 build it.

The DRAM device holds the data and enforces its own rules. Modules 2 to 16 explain those rules.

9. Why This Matters to a Semiconductor Engineer

This is not background reading. The hierarchy is why several ordinary engineering tasks look the way they do.

Cache misses are your workload. A memory controller's traffic is not generated by the program directly; it is what survives the cache hierarchy. Reasoning about a controller means reasoning about miss streams — their rate, their address pattern, and how much of it arrives at once.

Observed latency is not a device parameter. What a core actually waits for includes the journey through the path in §8 and whatever queueing it meets, not just the device's own internal delay. An engineer who quotes only the device figure will mispredict system behaviour every time.

Bandwidth can be the binding constraint. An accelerator's arithmetic units are only as busy as their operand supply. When a design is limited by how fast operands can be delivered rather than by how fast they can be processed, adding compute changes nothing — and the memory path becomes the thing that has to improve.

Locality is a design variable, not a fact of nature. Data layout, traversal order and the controller's own address mapping all change how a given computation is expressed as DRAM traffic. The same arithmetic can produce very different memory behaviour.

Verification has to reason across layers. A request crosses architectural boundaries — bus interface, controller, PHY, device — and correctness claims usually live on one side of a boundary while the symptom shows up on another. Knowing which layer owns which guarantee is what makes a memory testbench a design rather than a pile of stimulus.

10. Common Misconceptions

11. Reason It Through

Apply the model to a question an engineer is genuinely asked. Work through it before reading the answer.

A processor has very fast caches. The program it runs repeatedly sweeps a working set far larger than those caches, touching each element once per pass. Its designers propose raising the core clock frequency to improve performance.

Where does the data primarily reside? In main memory. The working set does not fit in cache by a wide margin, so the caches can hold only a fraction of it at any moment, and a sweep that touches everything once per pass keeps evicting what a later pass will need. DRAM is where this program's data actually lives.

What happens after the misses? Each miss becomes a request that leaves the cache hierarchy for the memory controller, which turns it into the command sequence the DRAM device requires and schedules it against every other pending request. The core waits for the round trip.

Which part of the hierarchy becomes important? The main-memory path — the controller's scheduling and address mapping, the channel's capacity, and how many independent requests can be outstanding at once. The cache tier is still doing its job; there is simply nothing in this access pattern for it to exploit.

Why does raising the clock not remove the bottleneck? Because it speeds up the part that is already waiting. A faster core reaches the stalling load sooner and then waits for the same memory delay, now measured as more cycles. Note the one honest qualification: it depends on how much of the run time is actually spent waiting. If the program mixes substantial computation with its sweeps, a faster core still helps the computation. The more time it spends waiting on memory, the less a clock increase buys — which is exactly why memory behaviour, not clock frequency, is the first thing to measure on a workload like this.

12. Understanding Check

13. Summary

The memory hierarchy exists because the properties wanted from memory conflict. Speed, capacity, cost per bit, power, persistence and physical closeness to compute cannot be maximised together, so a system stops trying to build one memory and instead builds several tiers — registers inside the execution path, SRAM caches near the core, main memory further out, persistent storage at the bottom — and moves data between them. Moving down, capacity generally grows and cost per bit generally falls while access latency generally rises; those are tendencies produced by technology and cost, not fixed ratios.

The hierarchy works only because real programs have locality, which is what lets small fast tiers answer most requests. What they cannot answer becomes traffic for the tier below — so cache misses, not programs, are what generates main-memory work.

DRAM holds the main-memory tier because it provides the density and cost per bit that capacity requires, and it pays for that with a cell whose charge leaks and whose reads must be carefully sequenced. DDR is the interface and system discipline that lets a processor use that DRAM effectively: a memory controller that turns requests into legal command sequences in a sensible order, and a PHY that gets those commands and their data across a physical channel with margin to spare. Both are components of the access path, not tiers of the hierarchy — and both exist entirely because of the compromise that put DRAM where it is.

14. What Comes Next

You now have the map. Module 1 walks it tier by tier: registers as the top of the hierarchy, SRAM and its density limits, DRAM as a technology, and flash at the bottom — then the cost-and-density trade surface, the argument for why DRAM took main memory, and the memory-wall problem that explains why this tier's latency has become more, not less, important over time. Module 2 opens the device itself.

Browse the full path on the DDR tutorials index. For the tiers immediately above this one in a real coherent system, see Cache Hierarchy Review. For the same "the requirements conflicted, so the architecture changed shape" reasoning applied to an interconnect rather than to storage, see Evolution of System Interconnects and Why AXI Exists. For what happens when memory stops being a local channel and becomes a fabric-attached resource, see What Is CXL.

Continue learning

Standards & specifications

Governing standard
JEDEC JESD79 (DDR SDRAM)(opens JEDEC Solid State Technology Association in a new tab)

Defines the DDR SDRAM device itself — signals, command encoding, mode registers, timing parameters and the initialisation sequence — one document per generation. Memory-controller microarchitecture, address-mapping policy, PHY training algorithms and board-level design are not specified by it.

This page also covers RTL structure, verification approach and debugging technique. Those are engineering practice built on the standard, not requirements the standard itself imposes.

Where this fits

Part of the DDR curriculum.