DDR Controller
DDR Controller
DDR Controller
Benny kesson
Presentation outline
DRAM history and evolution SDRAM scheduling basics Memory efficiency Memory controller overview
DRAM history
DRAM was patented in 1968 by Dennard. Significantly cheaper than SRAM .
1 transistor and 1 capacitor vs. 6 transistors. A bit is represented by a high or low charge on the capacitor.
Presentation outline
DRAM history and evolution SDRAM scheduling basics Memory efficiency Memory controller overview
Multi-bank architecture
SDRAMs have a multi-bank architecture and is organized in banks, rows and columns.
Typical figures:
4 8 banks 16K rows / bank 1024 columns / row 4 16 bits / column
Many chips are combined on a memory module to increase the word width. This is called the memory configuration.
The row is precharged and stored back into the memory array.
7
Refresh
The capacitor is leaking and needs to be periodically refreshed in order not to loose its data. All banks must be precharged when a refresh command is issued. A DDR2 memory needes to be refreshed once every 64 ms.
No operation NOP Ignores all inputs Activate Read Write Precharge Refresh ACT Activate a row in a particular bank RD WR Initiate a read burst to an active row Initiate a write burst to an active row
10
Presentation outline
DRAM history and evolution SDRAM scheduling basics Memory efficiency Memory controller overview
11
Memory efficiency
Memory efficiency is the fraction between the amount of clock cycles when data is transferred and the total amount of clock cycles.
efficiency = transfer _ cycles total _ cycles
Timing behaviour
Delays are required between SDRAM commands. This limits the efficiency of pipelined accesses.
Command delay ACT to PRE ACT to ACT (same bank) ACT to ACT (diff. bank) ACT to RD/WR WR to RD turn-around Cycles 9 12 2 3 2
13
14
Refresh efficiency
No data can be transfered when the memory is being refreshed. Recall that memory needs to be refreshed every 64 ms. With 8192 rows this means that a row should be refreshed, on average, every 7.8 s. A refresh command executes in 75 ns on a DDR2400 256 Mb device. This corresponds to roughly 1% of the time. Refresh efficiency is independent of traffic.
15
Data efficiency
A memory burst can access segments of the programmed burst size. This causes problem with alignment. If the requested data is poorly aligned an extra segment, and thus unrequested data, have to be fetched.
The efficiency loss grows with smaller requests and bigger burst sizes. Alignment depends on data format, compiler technology etc.
16
17
Problem depends on traffic and grows with smaller burst sizes. Command efficiency is generally quite high.
18
Presentation outline
DRAM history and evolution SDRAM scheduling basics Memory efficiency Memory controller overview
19
The back-end:
provides an interface towards the target memory. is dependent on the memory type.
20
Functional blocks
A general memory controller consists of four functional blocks
Memory mapping Arbiter Command generator Data path
21
Memory mapping
The memory map decodes a memory address into (bank, row, column).
Decoding is done by slicing the address.
22
Arbiter
The arbiter chooses the order in which requests access memory.
Potentially multiple layers of arbitration.
Some properties are contradictive and are being traded in arbiter design.
23
Command generator
Generates the commands for the target memory.
Customized for a particular memory generation. Parameterized to handle different timings.
24
Controller designs
Two directions in controller design:
Static memory controllers Dynamic memory controllers We will look into how these address three interesting memory controller properties.
Efficiency
Predictability
Flexibility
25
Clever tricks:
Schedule refresh when it does not interfere. Reorder bursts to minimize bank conflicts. Prefer read after read and write after write.
27
Efficiency
Predictability
Flexibility
29