Lecture 7 Main Memory
Lecture 7 Main Memory
Lecture 7 Main Memory
Main Memory
Memory Technology
• Random Access Memory (vs. Serial Access Memory)
• Cache uses SRAM: Static Random Access Memory
– No refresh (6 transistors/bit vs. 1 transistor
Size: DRAM/SRAM
Cost/Cycle time: SRAM/DRAM
• Access Time - Time between when a read is requested
and when the requested data arrives
• Cycle Time - The minimum time between two unrelated
requests to the memory. Must include refreshing time if
any
• Main Memory is DRAM: Dynamic Random Access Memory
– Dynamic since needs to be refreshed periodically
– Addresses divided into 2 halves (Memory as a 2D matrix):
» RAS or Row Access Strobe
» CAS or Column Access Strobe
Dynamic RAM
• SRAM cells exhibit high speed/poor density (6 cells per
transistor)
• DRAM: simple transistor/capacitor pairs in high density
form implemented in CMOS
CAS or Column Access Strobe
Word Line
RAS or Row
Bit Line Access Strobe
.
.
.
Sense Amp
Every read must have memory refreshing to restore the charge on the capacitor
DRAM cell
a single x4 bank.
Introduction
High Memory Demand for
Multicore Processors
Aggregate peak bandwidth grows with # cores:
» Intel Core i7 can generate two references
per core per clock
» Four cores and 3.2 GHz clock
25.6 billion 64-bit data references/second +
12.8 billion 128-bit instruction references
= 409.6 GB/s!
» DRAM bandwidth is only 6% of this (25
GB/s)
» Requires:
• Multi-port, pipelined caches
• Two levels of cache per core
• Shared third-level cache on chip
DRAM Banks
Figure 2.12 Internal organization of a DRAM. Modern DRAMs are organized in banks, typically four for DDR3. Each
bank consists of a series of rows. Sending a PRE (precharge) command opens or closes a bank. A row address is
sent with an Act (activate), which causes the row to transfer to a buffer. When the row is in the buffer, it can be
transferred by successive column addresses at whatever the width of the DRAM is (typically 4, 8, or 16 bits in DDR3)
or by specifying a block transfer and the starting address. Each command, as well as block transfers, are
synchronized with a clock.
multi-channel memory architecture is a technology that increases the data
transfer rate between the DRAM memory and the memory controller by
adding more channels of communication between them
Simplified View
DRAM Commands
block
Memory Interleaving
Also helps to reduce memory latency in single cores
Module accessed
Addresses that 0
are 0 mod 4
1
Addresses that 2
Add- are 1 mod 4 Data
ress Dispatch out 3
(based on Return
2 LSBs of data 0
Data address) Addresses that
in are 2 mod 4 1
2
Bus cycle
Addresses that
3
are 3 mod 4 Memory cycle Time
Multiplexor
Cache Cache
Cache
one-word wide
memory organization
Memory Access Time Example
One page/row
Q: Can we schedule memory accesses to maximize row buffer hit?
Memory Access Scheduling – Good research topic
Memory Technology
Memory Technology
• Amdahl:
– Memory capacity should grow linearly with processor
speed
– Unfortunately, memory capacity and speed has not
kept pace with processors
• Some optimizations:
– Multiple accesses to same row
– Synchronous DRAM
» Added clock to DRAM interface
» Burst mode with critical word first
– Wider interfaces
– Double data rate (DDR)
– Multiple banks on each DRAM device
DRAM Technology
Constant improvement in packaging and data transfer rate at the cost
of capacity increase
•DRAM followed Moore’s law for 20 years bringing out a new chip with 4 times the
capacity every three years.
•Due to packaging constraint, new chips double in capacity every two years
•Since 2006, the capacity doubles only in four years
Memory Technology
• Graphics memory:
– Achieve 2-5 X bandwidth per DRAM vs.
DDR3
» Wider interfaces (32 vs. 16 bit)
» Higher clock rate
• Possible because they are attached via soldering
instead of socketted DIMM modules
Power consumption for a DDR3 SDRAM operating under three conditions: low
power (shutdown) mode, typical system mode (DRAM active 30% for reads and
15% for writes), and fully active mode, where DRAM is continuously reading or
writing. All recent SDRAMs support power down mode.
Memory Technology
Flash Memory
• Type of EEPROM
• Must be erased (in blocks) before being
overwritten
• Non volatile
• Limited number of write cycles
• Cheaper than SDRAM, more expensive
than disk
• Slower than SRAM, faster than disk