Skip to content
VLSI

DDR Controller Verification: Initialization, Refresh, and Timing Checks with Real-World Scenarios

  • 11 min read

DDR memory is a critical component of modern System-on-Chip (SoC) architectures, supporting processors, GPUs, networking devices, and embedded systems that require high memory bandwidth. A DDR controller manages communication between the system interconnect and external DRAM, ensuring that memory commands are issued in the correct sequence and that all protocol timing requirements are satisfied.

Verifying a DDR controller involves much more than checking whether data can be written and read successfully. The controller must initialize the memory correctly after reset, schedule refresh operations without losing data, manage bank-level activities, and enforce timing restrictions between commands.

A controller may pass basic read/write tests but still fail under heavy traffic, refresh contention, unusual bank-access patterns, or boundary timing conditions. These failures can lead to intermittent data corruption, protocol violations, or reduced memory performance.

This article explains three essential areas of DDR controller verification: initialization, refresh management, and timing checks. It also covers practical verification scenarios, SystemVerilog assertions, and debugging approaches used in functional verification projects.

1. Understanding DDR Controller Architecture

A DDR controller acts as an interface between the SoC's internal bus and the external DDR memory device. It accepts read and write requests, schedules memory commands, manages bank states, and coordinates with the DDR PHY.

A typical DDR subsystem contains:

  • DDR Controller: Manages memory requests, address mapping, command scheduling, refresh, and timing enforcement.
  • DDR PHY: Handles physical signaling, data capture, transmit timing, calibration, and training.
  • DDR DRAM: Stores data in banks, rows, and columns.
  • DFI Interface: Provides a standardized interface between the controller and PHY in many implementations.

For example, when a processor issues a memory read request, the controller determines the target rank, bank, row, and column. If the required row is already open, it may issue a READ command after satisfying the relevant timing restrictions. If another row is open in that bank, the controller may first issue PRECHARGE, followed by ACTIVATE and READ.

Verification must check both the correctness of the returned data and the legality of the command sequence.

2. DDR Controller Initialization Verification

DDR initialization prepares the DRAM device for normal operation after power-up or reset. The controller must follow the initialization procedure specified for the selected memory generation and device.

Depending on the DDR generation and device, initialization can involve power-up timing requirements, reset handling, clock stabilization, CKE control, mode-register programming, ZQ calibration, and PHY training.

For example, a DDR4 initialization sequence includes operations such as:

  1. Apply the required power and clock conditions.
  2. Perform the specified reset procedure.
  3. Enable the required clock and CKE conditions.
  4. Satisfy the required initialization delays.
  5. Issue the required mode-register commands.
  6. Perform ZQ calibration as specified.
  7. Complete any required PHY training.
  8. Make the memory available for normal commands.

The exact ordering and timing must be derived from the target DDR4 device datasheet and applicable JEDEC specification. DDR3, DDR4, DDR5, and LPDDR devices do not share an identical initialization sequence.

Important initialization verification scenarios

Scenario 1: Reset release and initialization sequence

After reset is released, monitor the controller-to-PHY interface and confirm that the controller begins initialization in the expected order.

Check:

  • Reset and clock sequencing.
  • CKE behavior.
  • Mode-register command ordering.
  • Required delays between initialization commands.
  • Completion indication before normal traffic is accepted.
Scenario 2: Mode-register configuration

Mode registers control device operating features such as latency settings, burst behavior, and other generation-specific options.

For example, if the controller is configured for a particular CAS latency, verify that the corresponding mode-register programming matches the intended configuration and that subsequent read scheduling respects the selected latency.

Scenario 3: Initialization delay violation

Introduce a verification condition in which a required initialization delay is shortened or a command is attempted too early.

The checker should identify the timing violation rather than allowing the sequence to pass simply because the DRAM model responds.

Scenario 4: Initialization completion handling

Attempt to issue a normal memory request before initialization completes. Verify that the controller handles the request according to its documented interface behavior, such as holding, queuing, or rejecting it.

This checks whether the controller protects the DRAM from premature normal operation.

3. DDR Refresh Verification: Protecting Stored Data

DRAM stores information using capacitive memory cells. These cells require periodic refresh to retain their data. The DDR controller must schedule refresh operations within the limits defined by the memory specification and device operating conditions.

The main refresh timing parameters include:

  • tREFI: The average refresh interval.
  • tRFC: The minimum refresh cycle time during which the device is unavailable for certain normal operations.
  • tRP: The minimum precharge time.
  • tRAS: The minimum active time for a row.

The controller must ensure that refresh requirements are met without issuing conflicting commands.

All-bank refresh

In an all-bank refresh operation, the required banks must be in an appropriate idle or precharged condition before the refresh command is issued. The device then remains unavailable for the required refresh recovery period.

Practical example:

Assume a DDR4 controller is servicing requests from multiple banks. The refresh timer indicates that a refresh operation is due.

If a bank has an open row, the controller may need to issue PRECHARGE before issuing REFRESH. It must also ensure that the relevant timing requirements, including write recovery and precharge timing, are satisfied.

After issuing REFRESH, the controller must observe tRFC before scheduling commands that are prohibited during the refresh interval.

Refresh verification scenarios

Scenario 1: Periodic refresh

Run continuous memory traffic while monitoring refresh scheduling. Verify that refresh operations occur within the allowed timing window.

Scenario 2: Refresh postponement and pull-in

Some DDR devices support a limited number of postponed or pulled-in refresh operations under defined conditions.

For example, when the controller postpones a refresh to complete an active transaction, it must still satisfy the device's refresh-balance and maximum postponement requirements. Verify that the controller does not indefinitely defer refresh under sustained traffic.

Scenario 3: Refresh during heavy traffic

Generate simultaneous read and write requests across multiple banks. Confirm that the controller completes necessary operations, brings the required banks to an acceptable state, and issues refresh without violating command timing.

Scenario 4: Refresh recovery

After issuing REFRESH, attempt to schedule a prohibited command before tRFC expires. The protocol checker should flag the violation, and the controller should not generate the illegal command.

DDR5 refresh considerations

DDR5 introduces additional refresh options, including same-bank refresh (REFsb), alongside all-bank refresh. Refresh behavior depends on the selected operating mode and device configuration.

For example, same-bank refresh can allow activity to continue in banks that are not being refreshed, subject to the applicable timing restrictions. Verification must therefore check the targeted bank and the restrictions on both refreshed and non-refreshed banks.

Do not reuse DDR4 refresh assumptions directly in a DDR5 verification environment. The selected refresh mode, timing parameters, and command restrictions must be configured from the target device specification.

4. DDR Timing Verification: Preventing Illegal Command Sequences

DDR timing verification is one of the most important parts of controller functional verification. The controller must ensure that commands are issued only after all relevant timing requirements have been satisfied.

Important DDR timing parameters include:

Parameter

Meaning

Verification focus

tRCD

ACTIVATE to READ/WRITE delay

Check minimum delay before column access

tRP

PRECHARGE time

Check delay before a new ACTIVATE

tRAS

Minimum active time

Prevent premature row closure

tRC

Row cycle time

Check spacing between ACTIVATE commands to the same bank

tWR

Write recovery time

Check delay from WRITE to PRECHARGE

tRTP

Read-to-precharge delay

Check READ-to-PRECHARGE restriction

tRRD

ACTIVATE-to-ACTIVATE delay between banks

Check bank activation spacing

tFAW

Four-activate window

Limit ACTIVATE commands within the defined window

tCCD

Column-command spacing

Check READ/WRITE spacing, including bank-group-dependent variants

These parameters are not all expressed in the same units or applicable in exactly the same way across DDR generations. Some are specified in clock cycles, some in time, and some depend on speed grade, bank group, or operating mode.

Practical example: tRCD violation

Suppose the controller issues an ACTIVATE command to open a row in a bank.

The controller must wait at least the configured tRCD before issuing a READ or WRITE command to that row.

If the controller issues READ too early, the DRAM command sequence violates the timing requirement.

A protocol checker can record the ACTIVATE cycle and compare it with the cycle at which READ or WRITE occurs.

Practical example: tFAW violation

Assume a controller attempts to activate several banks in quick succession to improve parallelism.

Even when individual tRRD requirements are satisfied, the controller must also observe the four-activate window restriction. A fifth ACTIVATE may be illegal if it is issued before the required tFAW window has elapsed.

This scenario is particularly useful for verifying command schedulers under high-concurrency traffic.

Timing verification scenarios

  • Issue back-to-back reads and verify the applicable tCCD restrictions.
  • Perform a WRITE followed by PRECHARGE and check tWR.
  • Access different banks to verify tRRD and tFAW.
  • Open and close rows repeatedly to check tRAS, tRP, and tRC.
  • Mix read and write operations to verify turnaround restrictions.
  • Test commands at the minimum legal timing boundary.
  • Introduce an intentionally illegal command sequence to confirm that the checker detects it.

Boundary testing is important. A controller should be checked both at the minimum legal delay and just below that delay, where the checker should detect a violation.

5. Building a DDR Controller Verification Environment Using SystemVerilog and UVM

A reusable DDR controller testbench should separate stimulus generation, command monitoring, protocol checking, and data comparison.

A typical UVM environment can contain:

  • Sequence: Generates memory requests, reset operations, and traffic patterns.
  • Driver: Drives requests through the controller's host-side interface.
  • Monitor: Observes controller commands and relevant PHY-interface signals.
  • Protocol checker: Verifies command ordering and timing restrictions.
  • Scoreboard: Compares expected and observed read data.
  • Coverage collector: Tracks command, bank, row, refresh, and timing scenarios.

A memory reference model can maintain the expected contents of each address. When a write transaction completes, the scoreboard updates the reference memory. When a read completes, the returned data is compared with the expected value.

Illustrative SystemVerilog timing assertion

A simplified assertion can check that a READ command is not issued too soon after an ACTIVATE to the same bank.

property p_act_to_read_delay;

  @(posedge clk) disable iff (!rst_n)

    (act_cmd && (act_bank == read_bank))

    |-> ##[MIN_TRCD:MAX_CHECK_WINDOW]

        read_cmd;

endproperty

This is only a conceptual illustration, not a complete DDR protocol checker. A production checker should maintain per-bank ACTIVATE history and verify the actual command sequence, including intervening commands, multiple banks, timing units, and the relevant DDR generation. The example also needs adaptation if ACTIVATE and READ are represented as separate sampled command events.

For refresh checking, a similar monitor can record the refresh issue time and prevent prohibited commands until the configured tRFC requirement has elapsed.

6. Advanced DDR Controller Verification Scenarios

Basic initialization and read/write tests are not sufficient for a robust verification plan. Advanced scenarios help expose failures that occur only under specific traffic or timing conditions.

Concurrent bank accesses: Generate requests to multiple banks and bank groups. Verify that the scheduler uses bank parallelism without violating tRRD, tFAW, or other applicable restrictions.

Row-hit and row-conflict traffic: Repeatedly access the same open row, then alternate between different rows in the same bank. Verify correct READ, WRITE, and PRECHARGE scheduling.

Read/write turnaround: Alternate read and write requests to exercise turnaround timing and data-bus direction changes.

Refresh contention: Keep requests pending while refresh becomes due. Verify that the controller completes required operations and schedules refresh within the allowed limits.

Backpressure and request queues: Stall the host-side interface or create a large request backlog. Verify that requests are neither lost nor reordered in a way that violates the controller's documented ordering rules.

Reset during operation: Exercise reset according to the supported system reset model. Verify that controller state, outstanding transactions, and subsequent initialization behavior are handled correctly.

Error and training conditions: Where the controller/PHY architecture exposes relevant status, exercise training failures, calibration status, and recovery behavior.

7. Functional Coverage and Debugging Strategy

Functional coverage should measure whether important DDR behaviors have actually been exercised.

Useful coverage points include:

  • Initialization sequence completion.
  • Mode-register programming combinations.
  • Reads and writes across all banks.
  • Row-hit and row-conflict access.
  • Refresh operation and refresh postponement.
  • Minimum timing-boundary scenarios.
  • Read/write turnaround.
  • Multiple bank-group combinations.
  • Reset and reinitialization.
  • PHY training and calibration completion, where applicable.

Cross coverage can combine command type, bank, bank group, refresh status, and timing scenario. This helps identify missing combinations that simple command coverage may not reveal.

When a test fails, inspect the command trace around the first protocol violation. Record the previous command, bank, row, timestamp, expected minimum delay, and actual delay.

For example, if a READ violates tRCD, identify the ACTIVATE command for that bank and compare the elapsed time with the configured timing value. Avoid debugging only from the final data mismatch because an earlier command-scheduling error may be the actual root cause.

Conclusion

DDR controller verification requires a combination of initialization checks, refresh scheduling validation, command-timing enforcement, and data-integrity testing. Initialization ensures that the DRAM enters the correct operating mode. Refresh verification protects stored data while managing traffic. Timing verification ensures that every command follows the restrictions defined by the target memory device.

A strong verification environment should combine SystemVerilog assertions, UVM sequences, protocol monitors, scoreboards, and functional coverage. Engineers should also test boundary conditions, concurrent bank activity, refresh contention, and reset scenarios rather than relying only on basic read/write tests.

To develop practical knowledge of DDR memory architecture, initialization, refresh, timing diagrams, and controller behavior, explore DDR Protocol Training at InSkill. Engineers interested in controller-level functional verification can also explore Universal Memory Controller Functional Verification.

Share LinkedIn X WhatsApp