The Versal Memory Controller issues refreshes to the DRAM automatically. The controller will issue refreshes as needed to maintain data integrity of the DRAM.
tREFI(ps) according to the DRAM refresh interval requirement at the maximum intended operating temperature. Consult the DRAM vendor datasheet for tREFI requirements.
For LPDDR4/4X, the Versal Memory Controller supports all-bank or per-bank refreshes; however, per-bank refresh is only supported for single-rank systems running at 1250 Mb/s or faster. Dual-rank systems do not support per-bank refresh.
For DDR4, fine granularity refresh modes of 1x, 2x, and 4x are supported in the following configurations:
- All configurations
- Configurations with equal or less than eight logical ranks (ranks * stacks)
- Configurations with equal or less than four logical ranks (ranks * stacks)
On-the-fly refresh for DDR4 is not supported.
During normal DDR4 operation and when operating LPDDR4/4x in all-bank refresh mode the Versal DDRMC will block accesses to the rank which requires the refresh. Next it will issue a Precharge All command to the rank and then it will issue the Refresh command. The Versal DDRMC does not support Auto Precharge for Write/Read commands to opportunistically Precharge Banks before a Refresh command.
User Refresh and ZQ Periodic Calibration
The MC has two main refresh modes, internal and user, the default being internal. There is no support for switching between these two modes on the fly. User refresh mode can be enabled from the GUI while configuring the memory IP. Refer to the DDR Advanced Tab in Configuring the Memory Controller. This will create additional ports that can be controlled through PL.
|ref_req_*||Obsolete input - unused|
In user mode, the refresh request can be made in rank-wise granularity, with separate controls for each channel. A four-bit request vector can be used to implement this from PL. The ref_rank_en interface controls when the controller’s per-rank “pending refresh counters” are incremented.
Each request/acknowledge pair corresponds to a single DDRMC channel, with one bit per physical rank. Each pair operates independently of the other pairs. The “ref_rank_en” signals are driven by PL and are asynchronous to the DDRMC clock. The “ref_ack” signals are driven by the DDRMC and are asynchronous to the PL clock. It is up to the receiving clock domain to synchronize the signals before use to avoid metastability problems.
After the “ref_usr_port_available / cal_done” is asserted then “ref_rank_en” can be asserted high by the PL and needs to stay asserted until it detects a high on the corresponding “ref_ack”. Completing this handshake signifies that the DDRMC has incremented the associated “pending refresh counter” by one and will schedule the refresh as soon as the controller can halt system traffic and DRAM timing is safe. To initiate another user request, the PL must de-assert “ref_rank_en”, wait for “ref_ack” to de-assert, and then assert “ref_rank_en” again to start the handshake cycle over again. This process is broken down into individual steps below:
- PL waits for
- PL asserts
- PL waits for corresponding
ref_ackbit to assert
- PL de-asserts
- PL waits for corresponding
ref_ackbit to de-assert
- PL can loop back to step 2 to request another refresh
The following timing diagram shows two refresh request handshake cycles, with two timing parameters, t_EN_HOLD and t_ACK_DLY. t_EN_HOLD is a requirement for the PL, and t_ACK_DLY is a requirement for the DDRMC.
|t_ACK_DLY||0||16 mc_clk cycles|
- In user mode the MC does not track tREFI or postponed Autorefreshes. Instead, it issues Refreshes when it receives a request to a target Rank through the PL.
- The maximum interval to schedule a refresh is 7*tREFI, namely the maximum number of postponed refreshes for a target is 6. Failure to meet this requirement will possibly violate the tRAS max.
- In user refresh mode with LPDDR4, per-bank refresh is not allowed.
- For a multi-rank system made up of DDR4 3DS devices, you must make a refresh request to all the ranks during every request.
- While under single channel configuration, enable the clock gate for channel 1 or make a refresh request to both channels (even when channel 1 is not configured) to work successfully under the user refresh mode.
- The number of refresh requests made to each of the ranks should be the same by every (tREFI/refresh_rate).
cal_doneare de-asserted, the DDRMC will not execute any user requested refreshes.
- The ZQCS/ZQCal_START command will be issued internally at ZQ
interval following a refresh command requested through PL. If you do not
want periodic ZQ calibration then
block_periodic_cal_*should be asserted.