Cs 61C L16 Review.1 Patterson Spring 99 ©UCB CS61C Memory Hierarchy Introduction and Eight Week Review Lecture 16 March 12, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson)

Slides:



Advertisements
Similar presentations
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed., Oct. 23, 2002 Topic: Memory Hierarchy Design (HP3 Ch. 5) (Caches, Main Memory and.
Advertisements

1 Lecture 13: Cache and Virtual Memroy Review Cache optimization approaches, cache miss classification, Adapted from UCB CS252 S01.
Computer System Organization Computer-system operation – One or more CPUs, device controllers connect through common bus providing access to shared memory.
CMSC 611: Advanced Computer Architecture Cache Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from.
CMPE 421 Parallel Computer Architecture MEMORY SYSTEM.
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
Modified from notes by Saeid Nooshabadi COMP3221: Microprocessors and Embedded Systems Lecture 25: Cache - I Lecturer:
Memory Subsystem and Cache Adapted from lectures notes of Dr. Patterson and Dr. Kubiatowicz of UC Berkeley.
CS 61C L20 Caches I (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
331 Week13.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 20 - Memory.
COMP3221 lec33-Cache-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 12: Cache Memory - I
Computer ArchitectureFall 2008 © October 27th, 2008 Majd F. Sakr CS-447– Computer Architecture.
1 Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon, Oct 31, 2005 Topic: Memory Hierarchy Design (HP3 Ch. 5) (Caches, Main Memory and.
CS61C L31 Caches I (1) Garcia 2005 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Nov. 3, 2003 Topic: Memory Hierarchy Design (HP3 Ch. 5) (Caches, Main Memory and.
CS 61C L35 Caches IV / VM I (1) Garcia, Fall 2004 © UCB Andy Carle inst.eecs.berkeley.edu/~cs61c-ta inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures.
331 Lec20.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
CS61C L20 Caches I (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #20: Caches Andy Carle.
CIS629 - Fall 2002 Caches 1 Caches °Why is caching needed? Technological development and Moore’s Law °Why are caches successful? Principle of locality.
CIS °The Five Classic Components of a Computer °Today’s Topics: Memory Hierarchy Cache Basics Cache Exercise (Many of this topic’s slides were.
Computer ArchitectureFall 2007 © November 7th, 2007 Majd F. Sakr CS-447– Computer Architecture.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Cs 61C L17 Cache.1 Patterson Spring 99 ©UCB CS61C Cache Memory Lecture 17 March 31, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson) www-inst.eecs.berkeley.edu/~cs61c/schedule.html.
331 Lec20.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
Overview: Memory Memory Organization: General Issues (Hardware) –Objectives in Memory Design –Memory Types –Memory Hierarchies Memory Management (Software.
1  2004 Morgan Kaufmann Publishers Chapter Seven.
1 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: –value is stored as a charge.
©UCB CS 161 Ch 7: Memory Hierarchy LECTURE 14 Instructor: L.N. Bhuyan
1 CSE SUNY New Paltz Chapter Seven Exploiting Memory Hierarchy.
Computer ArchitectureFall 2007 © November 12th, 2007 Majd F. Sakr CS-447– Computer Architecture.
DAP Spr.‘98 ©UCB 1 Lecture 11: Memory Hierarchy—Ways to Reduce Misses.
CPE432 Chapter 5A.1Dr. W. Abu-Sufah, UJ Chapter 5A: Exploiting the Memory Hierarchy, Part 1 Adapted from Slides by Prof. Mary Jane Irwin, Penn State University.
CMPE 421 Parallel Computer Architecture
CS1104: Computer Organisation School of Computing National University of Singapore.
Five Components of a Computer
Lecture 14 Memory Hierarchy and Cache Design Prof. Mike Schulte Computer Architecture ECE 201.
EEE-445 Review: Major Components of a Computer Processor Control Datapath Memory Devices Input Output Cache Main Memory Secondary Memory (Disk)
10/18: Lecture topics Memory Hierarchy –Why it works: Locality –Levels in the hierarchy Cache access –Mapping strategies Cache performance Replacement.
CSIE30300 Computer Architecture Unit 08: Cache Hsin-Chou Chi [Adapted from material by and
223 Memory Hierarchy: Caches, Virtual Memory Big memories are slow Fast memories are small Need to get fast, big memories Processor Computer Control Datapath.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
EEL5708/Bölöni Lec 4.1 Fall 2004 September 10, 2004 Lotzi Bölöni EEL 5708 High Performance Computer Architecture Review: Memory Hierarchy.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
1010 Caching ENGR 3410 – Computer Architecture Mark L. Chang Fall 2006.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
The Goal: illusion of large, fast, cheap memory Fact: Large memories are slow, fast memories are small How do we create a memory that is large, cheap and.
CSE378 Intro to caches1 Memory Hierarchy Memory: hierarchy of components of various speeds and capacities Hierarchy driven by cost and performance In early.
CS.305 Computer Architecture Memory: Caches Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made available.
CPE232 Cache Introduction1 CPE 232 Computer Organization Spring 2006 Cache Introduction Dr. Gheith Abandah [Adapted from the slides of Professor Mary Irwin.
1 Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4.
1  1998 Morgan Kaufmann Publishers Chapter Seven.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 14: Memory Hierarchy Chapter 5 (4.
What is it and why do we need it? Chris Ward CS147 10/16/2008.
1 Chapter Seven. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: –value.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
CMSC 611: Advanced Computer Architecture
COSC3330 Computer Architecture
Yu-Lun Kuo Computer Sciences and Information Engineering
The Goal: illusion of large, fast, cheap memory
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Memory Hierarchy Memory: hierarchy of components of various speeds and capacities Hierarchy driven by cost and performance In early days Primary memory.
CMSC 611: Advanced Computer Architecture
Morgan Kaufmann Publishers Memory Hierarchy: Introduction
Lecturer PSOE Dan Garcia
Memory Hierarchy Memory: hierarchy of components of various speeds and capacities Hierarchy driven by cost and performance In early days Primary memory.
Cache Memory and Performance
Presentation transcript:

cs 61C L16 Review.1 Patterson Spring 99 ©UCB CS61C Memory Hierarchy Introduction and Eight Week Review Lecture 16 March 12, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson) www-inst.eecs.berkeley.edu/~cs61c/schedule.html

cs 61C L16 Review.2 Patterson Spring 99 ©UCB Review 1/1 °Magnetic Disks continue rapid advance: 60%/yr capacity, 40%/yr bandwidth, slow on seek, rotation improvements, MB/$ improving 100%/yr? Designs to fit high volume form factor Quoted seek times too conservative, data rates too optimistic for use in system °RAID Higher performance with more disk arms per $ Adds availability option at modest cost

cs 61C L16 Review.3 Patterson Spring 99 ©UCB Outline °Memory Hierarchy Analogy °Illusion of Large, Fast, Cheap Memory °Principle of Locality °Terms °Who manages each level of Hierarchy? °Administrivia, “Computer in the News” °Big Ideas on 61C: What we’ve seen so far °Conclusion

cs 61C L16 Review.4 Patterson Spring 99 ©UCB Hierarchy Analogy: Term Paper in Library °Working on paper in library at a desk °Option 1: Every time need a book Leave desk to go to shelves (or stacks) Find the book Bring one book back to desk Read section interested in When done with section, leave desk and go to shelves carrying book Put the book back on shelf Return to desk to work Next time need a book, go to first step

cs 61C L16 Review.5 Patterson Spring 99 ©UCB Hierarcgy Analogy: Library °Option 2: Every time need a book Leave some books on desk after fetching them Only go to shelves when need a new book When go to shelves, bring back related books in case you need them; sometimes you’ll need to return books not used recently to make space for new books on desk Return to desk to work When done, replace books on shelves, carrying as many as you can per trip °Illusion: whole library on your desktop

cs 61C L16 Review.6 Patterson Spring 99 ©UCB Technology Trends DRAM YearSizeCycle Time Kb250 ns Kb220 ns Mb190 ns Mb165 ns Mb145 ns Mb120 ns CapacitySpeed (latency) Processor-- 4x in 3 yrs DRAM:4x in 3 yrs2x in 10 yrs Disk:4x in 3 yrs 2x in 10 yrs 1000:1!2:1!

cs 61C L16 Review.7 Patterson Spring 99 ©UCB Who Cares About the Memory Hierarchy? µProc 60%/yr. (2X/1.5yr) DRAM 9%/yr. (2X/10 yrs) DRAM CPU 1982 Processor-Memory Performance Gap: (grows 50% / year) Performance Time Processor-DRAM Memory Gap (latency)

cs 61C L16 Review.8 Patterson Spring 99 ©UCB The Goal: Illusion of large, fast, cheap memory °Fact: Large memories are slow, fast memories are small °How do we create a memory that is large, cheap and fast (most of the time)? °Hierarchy of Levels Similar to Principle of Abstraction: hide details of multiple levels

cs 61C L16 Review.9 Patterson Spring 99 ©UCB Why Hierarchy works: Natural Locality °The Principle of Locality: Program access a relatively small portion of the address space at any instant of time. Address Space 02^n - 1 Probability of reference °What programming constructs lead to Principle of Locality?

cs 61C L16 Review.10 Patterson Spring 99 ©UCB Memory Hierarchy: How Does it Work? °Temporal Locality (Locality in Time):  Keep most recently accessed data items closer to the processor Library Analogy: Recently read books are kept on desk Block is unit of transfer (like book) °Spatial Locality (Locality in Space):  Move blocks consists of contiguous words to the upper levels Library Analogy: Bring back nearby books on shelves when fetch a book; hope that you might need it later for your paper

cs 61C L16 Review.11 Patterson Spring 99 ©UCB Memory Hierarchy Pyramid Levels in memory hierarchy Central Processor Unit (CPU) Size of memory at each level Level 1 Level 2 Level n Increasing Distance from CPU, Decreasing cost / MB “Upper” “Lower” Level 3... (data cannot be in level i unless also in i+1)

cs 61C L16 Review.12 Patterson Spring 99 ©UCB Big Idea of Memory Hierarchy °Temporal locality: keep recently accessed data items closer to processor °Spatial locality: moving contiguous words in memory to upper levels of hierarchy °Uses smaller and faster memory technologies close to the processor Fast hit time in highest level of hierarchy Cheap, slow memory furthest from processor °If hit rate is high enough, hierarchy has access time close to the highest (and fastest) level and size equal to the lowest (and largest) level

cs 61C L16 Review.13 Patterson Spring 99 ©UCB Memory Hierarchy: Terminology °Hit: data appears in some block in the upper level (example: Block X) Hit Rate: the fraction of memory access found in the upper level Analogy: fraction of time find book on desk °Miss: data needs to be retrieve from a block in the lower level (Block Y) Miss Rate = 1 - (Hit Rate) Analogy: fraction of time must go to shelves for book

cs 61C L16 Review.14 Patterson Spring 99 ©UCB Memory Hierarchy: Terminology °Hit Time: Time to access the upper level which consists of Time to determine hit/miss + Memory access time Analogy: time to find, pick up book from desk °Miss Penalty: Time to replace a block in the upper level + Time to deliver the block the processor Analogy: time to go to shelves, find needed book, and return it to your desk, pick up °Note: Hit Time << Miss Penalty

cs 61C L16 Review.15 Patterson Spring 99 ©UCB Current Memory Hierarchy Control Data path Processor Regs Secon- dary Mem- ory L2 Cache Speed(ns):0.5ns2ns6ns100ns10,000,000ns Size (MB): ,000 Cost ($/MB):--$100$30$1 $0.05 Technology:Regs SRAMSRAMDRAM Disk L1 $ Main Mem- ory

cs 61C L16 Review.16 Patterson Spring 99 ©UCB Memory Hierarchy Technology °Random Access: “Random” is good: access time is the same for all locations (binary hardware tree to select table entry: billionths of a second) °DRAM: Dynamic Random Access Memory High density, low power, cheap, slow Dynamic: needs to be “refreshed” regularly °SRAM: Static Random Access Memory Low density, high power, expensive, fast Static: content last “forever”(until lose power) °Sequential Access Technology: access time linear in location (e.g.,Tape)

cs 61C L16 Review.17 Patterson Spring 99 ©UCB How is the hierarchy managed? °Registers  Memory By compiler (or Asm Programmer) °Cache  Main Memory By the hardware °Main Memory  Disks By the hardware and operating system (virtual memory; after the break) By the programmer (Files)

cs 61C L16 Review.18 Patterson Spring 99 ©UCB Administrivia °Upcoming events Midterm Review Sunday 3/14 2PM, 1 Pimentel Fill out questionnaire, answer questions Conflict Midterm Mon 3/15 6PM, 405 Soda Midterm on Wed. 3/17 5pm-8PM, 1 Pimentel No discussion section 3/18-3/19 Friday before Break 3/19: video tape by Gordon Moore, “Nanometers and Gigabucks” °Copies of lecture slides in 271 Soda? Vote on 4 slides/page vs. 6 slides/page? ° Copies before midterm in Copy Central?

cs 61C L16 Review.19 Patterson Spring 99 ©UCB Administrivia Warnings °“Is this going to be on the midterm?” °Option 1: What you really mean is: “I don’t understand this, can you explain it to me?”  Our answer is: “Yes” °Option 2: What you really mean is: “I’m behind in class, and haven’t learned the assigned material yet. Do I have to try to learn this material?”  Our answer is: “Yes” °Bring to exam: Pencil, 1 sheet of paper with handwritten notes No calculators, books

cs 61C L16 Review.20 Patterson Spring 99 ©UCB “Computers in the News” °“Microsoft to Alter Software in Response to Privacy Concerns ”, NY Times, 3/7/99, Front Page “Microsoft conceded that the feature...had the potential to be far more invasive than a traceable serial number in the... new Pentium III that has privacy advocates up in arms. The difference is that the Windows number is tied to an individual's name, to identifying numbers on the hardware in his computer and even to documents that he creates.” “[M/S is] apparently building a data base that relates Ethernet adapter addresses to personal information... Ethernet adapters are cards inserted in a PC that enable it to connect to high- speed networks within organizations and through them to the Internet.

cs 61C L16 Review.21 Patterson Spring 99 ©UCB From First Lecture; How much so far? °15 weeks to learn big ideas in CS&E Principle of abstraction, used to build systems as layers Compilation v. interpretation to move down layers of system Pliable Data: a program determines what it is Stored program concept: instructions are data Principle of Locality, exploited via a memory hierarchy (cache) Greater performance by exploiting parallelism Principles/pitfalls of performance measurement

cs 61C L16 Review.22 Patterson Spring 99 ©UCB Principle of abstraction, systems as layers °Programming Languages: C / Assembly / Machine Language Pseudoinstructions in Assembly Language °Translation: Compiler / Assembler / Linker / Loader °Network Protocol Suites: TCP / IP / Ethernet °Memory Hierarchy: Registers / Caches / Main memory / Disk °Others?

cs 61C L16 Review.23 Patterson Spring 99 ©UCB Compilation v. interpretation to move down °Programming Languages: C / Assembly / Machine Language Compilation °Network Protocol Suites: TCP / IP / Ethernet Interpretation °Memory Hierarchy: Caches / Main memory / Disk: Interpretation Registers / Cache: Compilation °Others?

cs 61C L16 Review.24 Patterson Spring 99 ©UCB Pliable Data: a program determines what it is °Instructions (fetched from memory using PC) °Types include Signed Integers, Unsigned Integers, Characters, Strings, Single Precision Floating Point, Double Precision Floating Point °Everything has an address (  pointers) ° TCP packet? IP packet? Ethernet packet? °Others?

cs 61C L16 Review.25 Patterson Spring 99 ©UCB Stored program concept: instructions as data °Allows computers to switch personalities °Simplifies compile, assembly, link, load °Distributing programs easy: on any disk, just like data  binary compatibility, upwards compatibility (8086, 80286, 80386, 80486, Penitum I, II, III) °Allows for efficient Dynamic Libraries: modify the code to patch in real address °Makes it easier for viruses: Send message that overflows stack, starts executing code in stack area, take over machine

cs 61C L16 Review.26 Patterson Spring 99 ©UCB Principle of Locality °Exploited by memory hierarchy °Registers assume Temporal Locality: data in registers will be reused °Disk seeks faster in practice: short seeks are much faster, so disk accesses take less time  due to Spatial Locality °Disks transfer in 512 Byte blocks assuming spatial locality: more than just 4 bytes useful to program °Networks: most traffic is local, so local area network vs. wide area network

cs 61C L16 Review.27 Patterson Spring 99 ©UCB Greater performance by exploiting parallelism °RAID (Redundant Array of Inexp. Disks) Replace a few number of large disks with a large number of small disks  more arms moving, more heads transferring (even though small disks maybe slower) °Switched Networks More performance in system since multiple messages can transfer at same time, (even though network latency is no better between 2 computers on unloaded system) °Others?

cs 61C L16 Review.28 Patterson Spring 99 ©UCB Performance measurement Principles/Pitfalls °Network performance measure: only looking peak bandwidth, not including software start-up overhead for message °Disk seek time: Its much better than what manufacturer quotes (3X to 4X) °Disk transfer rate (internal media rate): Its worse than what manufacturer quotes (0.75X) See if profs in OS class know these! °Others?

cs 61C L16 Review.29 Patterson Spring 99 ©UCB Rapid Change AND Little Change °Continued Rapid Improvement in Computing 2X every 1.5 years (10X/5yrs, 100X/10yrs) Processor speed, Memory size - Moore’s Law as enabler (2X transistors/chip/1.5 yrs); Disk capacity too (not Moore’s Law) °5 classic components of all computers 1. Control 2. Datapath 3. Memory 4. Input 5. Output } Processor (or CPU)

cs 61C L16 Review.30 Patterson Spring 99 ©UCB “And in Conclusion...” °Principle of Locality + Hierarchy of Memories of different speed, cost; exploit locality to improve cost-performance °Hierarchy Terms: Hit, Miss, Hit Time, Miss Penalty, Hit Rate, Miss Rate, Block, Upper level memory, Lower level memory °Review of Big Ideas (so far): Abstraction, Stored Program, Pliable Data, compilation vs. interpretation, Performance via Parallelism, Performance Pitfalls Applies to Processor, Memory, and I/O °Next Midterm, then Gordon Moore, Break