Concepts / DRAM Access Steps

DRAM Access Steps

The memory controller is the coordination layer between processors and off-chip DRAM.

  • Programming

The Request Path

When a processor needs data from main memory, the request does not travel directly to an arbitrary stored bit. Main memory is provided by an off-chip DRAM system, so a memory controller coordinates the interface between the processor chip and the DRAM chips. The controller turns changing read and write requests into memory commands while respecting the timing and resource limits imposed by the DRAM hardware.

requestmemory commandsdataresponseProcessorread or write requestMemory controllercoordinates commandsOff-chip DRAMstores dataReturned datato processor
How does a memory request and its returned data move between the processor, the memory controller, and the external DRAM system?

The controller is therefore a coordination layer, not merely a wire between the processor and memory. It determines which DRAM operation can occur next and arranges the steps needed to make the requested row and column accessible.

Inside a DRAM Array

A DRAM system contains multiple DRAM chips. Each chip contains rectangular storage-cell arrays organized into rows and columns. Each cell stores one bit as charge on a capacitor. Because that charge decreases over time, each cell must be refreshed every few milliseconds so that its stored content is not lost. This periodic refreshing is why the memory is called dynamic RAM.

containsorganized intocontains cells withorganized intoactivated intoselectprovides working bits forDRAM chipsmultiple chipsCell arrayrectangular organizationSelected rowone row of cellsCapacitorsone bit per cellColumnscolumn selectionRow bufferselected row bitsRequested wordread or write target
What contains what, and how does a selected row connect the capacitors, columns, and row buffer?

The row buffer is the key working location in this structure. It temporarily holds the bits from one selected row. A read or write does not treat every cell as an independently open destination; instead, a row is made available in the row buffer, and a column operation selects the requested word from that open row or writes into it.

The Three Access Stages

Suppose a request targets a row that is not currently open. The controller cannot begin with the read or write command for the requested word. It must first make the requested row available in the row buffer. After the read or write, the row-buffer contents must be restored to the array before another row can be opened.

targets a closed rowrow is availablefinish current row before switchingprepare forMemory requesttarget row and columnActivate rowmove row into row bufferRead or writeselect requested columnPrechargerestore row-buffer contentsDifferent rowcan be activated next
What happens as a request moves from making a row available to reading or writing a column and preparing for another row?

Activate makes the requested row available in the row buffer. Read or write selects the requested column within the currently open row and performs the requested operation. Precharge restores the row-buffer contents to the array so that a different row can be activated.

A Request for a Closed Row

A generated request targets a word in a row that is not currently open. Trace the required stages.

Activate: The controller first activates the requested row so that its bits become available in the row buffer.

Read or write: The controller then selects the requested column and performs the requested read or write.

Precharge: Before a different row can be opened, the controller precharges the current row and restores the row-buffer contents to the array.

The access follows activate, read or write, and then precharge when the system must prepare to change to another row.

Row Locality

After a row has been activated, it remains the currently open row in the row buffer. A later request to another column in that same row can proceed with a read or write command. It does not require the extra work of precharging the current row and activating a different row.

receivessame-row requestalready availablerequiresRow Acurrently openRow Astill openColumn B requestsame rowRead or writeColumn BDifferent rowrequires row changePrecharge andactivatebefore different-row access
How does accessing another column in the currently open row avoid the row-change work required by a different-row access?

This performance advantage is called row locality. Row locality is not a separate storage structure. It is an effect created by the row buffer and by the rule that a different row requires precharge followed by activate. The currently open row can therefore serve several column requests without repeating the row-change work.

Request targetFirst required operationAdditional row-change work
Currently open rowRead or writeNo precharge and activate for a different row
Different rowPrecharge, then activateRequired before read or write

Managing Pending Requests

The controller does not necessarily handle every processor request in isolation. It maintains a memory transaction queue containing memory-access requests from processors that share the memory system. The queue gives the controller a set of pending work from which it can issue commands to DRAM.

enterselect pending worklegalnot legalafter commandcontinue with pending workProcessor requestsreads and writesTransaction queuepending requestsCheck constraintstiming and resourcesIssue DRAM commandactivate, read, write, orprechargeUpdate memory stateopen row and pending workWait in queuenot legal yet
How do requests wait in a transaction queue while the controller chooses an operation that obeys DRAM timing and resource constraints?

The scheduling problem has two sides. Request patterns change dynamically, but every command must also obey the timing and resource constraints required by the DRAM hardware. With multiple processor cores sharing DRAM, the pending set can become especially difficult to manage. The controller must choose commands that are both useful for pending requests and currently permitted by the memory state and hardware constraints.

Common Reasoning Errors

  • Treating a DRAM cell as an independently open location.

    The row must be activated and made available in the row buffer before its words can be read or written.

    Fix: Identify the requested row first, then determine whether it is already open.

  • Putting read or write before activate for a closed row.

    A request targeting a row that is not currently open must first make that row available in the row buffer.

    Fix: For a closed-row request, reason through activate, read or write, and then precharge when preparing to change rows.

  • Forgetting precharge when switching rows.

    Precharge is required before a different row can be activated.

    Fix: Insert precharge between the operation on the current row and activation of a different row.

  • Calling row locality a separate memory structure.

    Row locality is a performance effect created by reusing the currently open row.

    Fix: Explain that same-row accesses avoid the extra precharge and activate work needed for a different row.

  • Assuming every queued request can execute immediately.

    The controller must issue commands under timing and resource constraints.

    Fix: Treat the transaction queue as pending work, then check which operation is legal next.

Trace the Next Command

MEDIUM

A generated scenario has two pending requests. Request A targets the row that is currently open but a different column. Request B targets another row. Which request can proceed directly with a read or write, and what operations are required before Request B can perform its read or write?

Hints
  • Start by checking whether each request targets the currently open row.
  • A same-row request does not need the extra row-change work.
  • A different-row request needs precharge before activate.

What do you think happens?

Which request can proceed directly with a read or write?

  • Request A, because it targets the currently open row
  • Request B, because it targets a different row
  • Neither request, because every request requires precharge first
Reveal answer

Answer: Request A, because it targets the currently open row.

Request A demonstrates row locality. Request B requires precharge for the current row, followed by activate for the new row, before its read or write command can be issued.

Comparing Two Pending Requests

The row buffer currently holds one open row. Request A targets another column in that row, while Request B targets a different row.

Classify Request A: Request A targets the currently open row, so its read or write can proceed without changing the open row.

Classify Request B: Request B targets a different row, so the controller must first precharge the current row.

Prepare Request B: After precharge, the controller activates Request B's row and then issues its read or write command.

Request A benefits from row locality. Request B does not, because it requires precharge and activate before its read or write.

What to Remember

  1. The memory controller coordinates requests between the processor and off-chip DRAM.
  2. DRAM cells store bits as charge on capacitors inside row-and-column arrays, while the row buffer temporarily holds one selected row.
  3. A closed-row access requires activate before read or write, and precharge before a different row can be activated.
  4. Row locality lets later requests to the currently open row avoid the extra precharge and activate work required for a different row.
  5. A transaction queue gives the controller pending requests to manage while timing and resource constraints determine which command is legal next.

Key Takeaways

  • The memory controller is the coordination layer between the processor and off-chip DRAM.
  • A DRAM array contains rows and columns of capacitor-based cells, and a row buffer holds the currently selected row.
  • The main access sequence is activate, read or write, and precharge when preparing to switch rows.
  • Row locality reduces work when a later request targets another column in the currently open row.
  • The transaction queue lets the controller manage pending requests under DRAM timing and resource constraints.