Home

Awesome

DDR3-Notes

A DRAM chip contains multiple banks. A bank contains multiple DRAM rows and 1 row of sense amplifiers. A DRAM cell is composed of a capacitor and an access transistor. Only 1 row can be open in an open bank. image

Steps:

  1. Initialize
  2. Set 2 registers: Mode Register (latency, burst length...) and Extended Mode Register (DLL settings)
  3. Activate = Transferring the charge from a DRAM row to sense amp. This is destructive so the sense amp will then restore the value of the DRAM cells. Input: Bank and Row address
  4. Read/Write = Read/Write to a specified column. Input: Bank and Column address
  5. Precharge = Close current row and prepare the sense amp for next activation. The sense amp is restored to VDD/2. The DRAM cell must already be restored to its original value before precharging. Input: Bank address

Precharging charges the bit line and sense amp to VDD/2 so that reading/writing a DRAM cell is faster (the bit line needs only small charge to latch either direction). Sense amp are just SRAM cells (a D-latch with 6 CMOS so access is fast). There are other commands to refresh other rows and bank that is not used. Retention time is usually 64ms above so 64ms is used usually as the refresh time.

Refresh:

A refresh period is usually 64ms (32ms for higher temp since leakage is higher). If there are 8192 rows (13-bit row address), then 64ms/8192rows=7.8us/row. So a row must be refreshed EVERY 7.8us to cover all 8192 rows. Now this is a bottleneck since refresh takes time, what we can do is to access other bank while another bank is being refreshed. Refresh is essentially activate + precharge a row every 64ms. Distributed refresh is what used mostly in today's controllers than burst refresh (all rows are refreshed consecutively immediately which has long pause time). DRAM Bank is unavailable during refresh.

In the power-down state (precharge power-down or active power-down), the DRAM still requires refresh commands to be sent to maintain the memory contents. Since no refresh operations are performed in this mode, the device may not remain in the power-down state longer than the refresh period (64ms)

Latency:

Latency or delay is due to the fact that DRAM uses capacitor which induces delay.

image image

Note: The timing parameters are set for worst case, so we can reduce the timing delay slightly to optimise it further

DDR Controller Structural Hierarchy:

  1. CPU system (@800MHZ to GHz clock frequency)
  2. DDR Controller
  3. DDR PHY = (@ ~200MHz clock frequency)
  4. DDR Memory inside IO_wrapper (@200MHz clock frequency)

In CPU, memory becomes bottleneck. Intel i7 is at 3GHz with 64 bit data path (192Gbit/sec). However, the DDR memory core can only work at 200MHz since higher frequency means tighter timing constraint thus lower manufacturing yield. To compensate for this low frequency, prefetching is used on the DDR memory. 2n-prefetching fetches two words at same time to be stored to internal buffer. This will then be released by the DDR memory on the positive and negative edge of clock. DDR also needs DLL (Delay-Locked Looped to align DQ to DQS) and PLL (Phase-Locked Loop used by PHY to generate input clock for DDR memory).

Pins:

DRAM Subsystem Organization:

image

SDR (Single Data Rate) vs DDR (Double Data Rate):

image

On-Die Termination (ODT):

DDR Read and Write Operation:

Extra Notes:

image

February Notes

https://github.com/buttercutter/DDR

https://opencores.org/projects/wbddr3

Reference (YouTube):

Reference (Sites):