Download Memory Systems: Making the Most of Different Technologies for Data Storage and more Slides Computer Aided Design (CAD) in PDF only on Docsity! Memory Systems How to make the most out of cheap storage Docsity.com Memory so far • We have discussed two structures that hold data: – Register file (little array of storage) – “Memory” (bigger array of storage) • How do we implement memory? – What technologies? Docsity.com Memory Hierarchy • We want to have lots of memory for our processor: – LC2K needs 216 words of memory ( ~ 256 KB) – MIPS needs 232 bytes of memory ( ~ 4 GB ) – x86-64 needs 264 bytes of memory ( ~ 16 exabytes ) • What are our choices? – SRAM, DRAM, Magnetic Disk, paper? Docsity.com Option 1: build it out of fast SRAM • On-chip memory – Fabricated in the same technology as the processor • About 2-10 ns access (depending on size) – Decoders are big – Array are big • It will cost LOTS of money – SRAM costs $10 per megabyte • $2.50 for LC2K • $40,960 for MIPS • $175 trillion for x86-64 Docsity.com Option 2: build it out of DRAM • About 50 ns access – Why build a fast processor that stalls for dozens of cycles on each memory load? • Still costs lots of money for new machines – DRAM costs $0.015 per megabyte – < $0.001 for LC2K – $54.99 for MIPS – $236 billion for x86-64 Docsity.com Option 5: build it using Optical Disks (CD/DVD) • About 50,000,000 ns access (about 5-10x Hard disks) – Depends mostly on seeking out the data. – Writing to this media is much slower. • Costs are pretty reasonable – Disk storage costs $0.00002 per megabyte – Basically free for LC2K – $0.08 for MIPS – $400 million for x86-64 Docsity.com Our requirements • We want a memory system that runs a processor clock speed – about 1 ns access – Otherwise, why bother pipelining? • We want a memory system that we can afford – maybe 25% to 33% of the total system costs • Options 2-5 are too slow (1 is pretty close) • Options 1-2 (at least) are too expensive Time for option 6! Docsity.com Option 6: Use a little of everything (wisely) • Use a small array of SRAM – Big enough to hold whatever you use most often – Small means fast! – Small means cheap! • Use a larger amount of DRAM – And hope that you rarely have to use it • Use a really big amount of Disk storage – Disks are getting cheaper at a faster rate than we fill them up with data (for most people) • Don’t try to buy 264 bytes of anything – It would take decades to format it anyway! Docsity.com A Favorite Cache Analogy • Hungry! must eat! – Option 1: go to refrigerator • Found eat! • Latency = 1 minute – Option 2: go to store • Found purchase, take home, eat! • Latency = 20-30 minutes – Option 3: grow food! • Plant, wait … wait … wait … , harvest, eat! • Latency = ~250,000 minutes (~ 6 months) • Crazy fact: ratio of growing food:going to the store = 10,000 ratio of disk access:DRAM access = 200,000 Docsity.com Rehashing our terms • The Architectural view of memory is: – What the machine language sees – Memory is just a big array of storage • Breaking up the memory system into different pieces – cache, main memory (made up of DRAM) and Disk storage – is not architectural. – The machine language doesn’t know about it – The processor may not know about it – A new implementation may not break it up into the same pieces (or break it up at all). Caching needs to be Transparent! Docsity.com