Difference Between DDR Refresh and Precharge Cycles

Difference Between DDR Refresh and Precharge Cycles


In DDR (Double Data Rate) memory, refresh cycles and precharge cycles are key operations to ensure memory integrity and efficient data access. Both are related to the memory’s internal operations but serve different functions.

Refresh Cycle: Ensures that data stored in the memory cells remains intact over time.

Precharge Cycle: Prepares a memory bank for a new operation by closing an active row, allowing the memory to open another row for subsequent read or write operations.

1. DDR Refresh Cycles:

DDR memory is built using capacitive cells that store bits of data (1 or 0) as charges in tiny capacitors. These capacitors naturally lose their charge over time, which could lead to data loss. Therefore, periodic refresh cycles are required to restore the charge and prevent data corruption.

Characteristics of a Refresh Cycle:

Purpose: Refresh ensures that the charge in the memory cells is periodically restored, preserving the data in those cells.

When It Occurs: Refresh occurs at regular intervals, dictated by the DDR specification (e.g., every 64ms for DDR3). The memory controller handles the scheduling of refresh cycles.

Scope: A refresh cycle applies to entire rows of memory. In DDR, the refresh cycle may affect one or more banks depending on the type of refresh.

Duration: During the refresh cycle, the affected banks are unavailable for read or write operations.

Types of Refresh:

Auto-Refresh: The most common form of refresh where the memory controller periodically issues a refresh command to refresh all rows of memory over a predefined interval.

Self-Refresh: Typically used in low-power states (like sleep mode). The DDR memory manages the refresh cycles internally without CPU or memory controller intervention.

Example of Refresh Cycle Implementation:

For DDR3 memory:

Total Memory Size: 1 GB

Number of Rows: Assume 16,384 rows.

Refresh Interval: Each row must be refreshed within 64ms.

In this case, the memory controller will schedule 16,384 refresh operations over 64ms, so the refresh interval would be 64ms / 16,384 ≈ 3.9 microseconds per refresh command. This ensures that each row is refreshed before data in its cells is lost.

2. DDR Precharge Cycles:

In DDR memory, each memory bank can only have one row active at a time. Before a new row can be activated (for a read or write operation), the currently active row must be precharged (closed) so the memory controller can prepare the bank for the next access. This precharging process introduces precharge cycles that take time before a new row can be accessed.

Characteristics of a Precharge Cycle:

Purpose: Precharge is required to close the currently active row in a specific bank and prepare that bank to activate another row.

When It Occurs: Precharge happens after a read or write operation is completed on a row, before accessing a new row in the same bank.

Scope: Precharge affects only one specific bank, allowing other banks to be accessed independently.

Duration: A precharge cycle introduces a delay before a new row can be activated (often referred to as tRP, the "row precharge time").

Example of Precharge Cycle Implementation:

For DDR4 memory:

Bank Size: Assume 8 banks.

tRP (Precharge Time): 12 ns.

If the memory controller issues a read command to row 0 of bank 1 and then wants to access row 1 of the same bank, it first needs to issue a Precharge command to close row 0. During this time (tRP = 12 ns), the memory controller cannot access that bank. After the precharge cycle is complete, a new Activate command can be issued to open row 1 in the same bank for the next read or write operation.


要查看或添加评论,请登录

社区洞察

其他会员也浏览了