Cache Basics Define temporal and spatial locality.

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

Computation I pg 1 Embedded Computer Architecture Memory Hierarchy: Cache Recap Course 5KK73 Henk Corporaal November 2014
© Karen Miller, What do we want from our computers?  correct results we assume this feature, but consider... who defines what is correct?  fast.
1 Copyright © 2012, Elsevier Inc. All rights reserved. Chapter 2 (and Appendix B) Memory Hierarchy Design Computer Architecture A Quantitative Approach,
The Memory Hierarchy CPSC 321 Andreas Klappenecker.
1 Lecture 20 – Caching and Virtual Memory  2004 Morgan Kaufmann Publishers Lecture 20 Caches and Virtual Memory.
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
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.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Nov. 3, 2003 Topic: Memory Hierarchy Design (HP3 Ch. 5) (Caches, Main Memory and.
331 Lec20.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
Computer ArchitectureFall 2007 © November 12th, 2007 Majd F. Sakr CS-447– Computer Architecture.
Caching I Andreas Klappenecker CPSC321 Computer Architecture.
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
Caches The principle that states that if data is used, its neighbor will likely be used soon.
11/3/2005Comp 120 Fall November 10 classes to go! Cache.
331 Lec20.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 13 Basics of Cache [Adapted from Dave Patterson’s UCB CS152.
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.
CS 524 (Wi 2003/04) - Asim LUMS 1 Cache Basics Adapted from a presentation by Beth Richardson
Memory: PerformanceCSCE430/830 Memory Hierarchy: Performance CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng Zhu (U. Maine)
CSCE 212 Quiz 11 – 4/13/11 Given a direct-mapped cache with 8 one-word blocks and the following 32-bit memory address references: 1 2, ,
1 CSE SUNY New Paltz Chapter Seven Exploiting Memory Hierarchy.
Lecture 31: Chapter 5 Today’s topic –Direct mapped cache Reminder –HW8 due 11/21/
Memory Hierarchy and Cache Design The following sources are used for preparing these slides: Lecture 14 from the course Computer architecture ECE 201 by.
Storage HierarchyCS510 Computer ArchitectureLecture Lecture 12 Storage Hierarchy.
ECM534 Advanced Computer Architecture
EECS 318 CAD Computer Aided Design LECTURE 10: Improving Memory Access: Direct and Spatial caches Instructor: Francis G. Wolff Case.
Chapter 5 Large and Fast: Exploiting Memory Hierarchy CprE 381 Computer Organization and Assembly Level Programming, Fall 2013 Zhao Zhang Iowa State University.
£899 – Ultimatum Computers indiegogo.com/ultimatumcomputers The Ultimatum.
10/18: Lecture topics Memory Hierarchy –Why it works: Locality –Levels in the hierarchy Cache access –Mapping strategies Cache performance Replacement.
Ch. 12 Cache Direct Mapped Cache. Comp Sci mem hierarchy 2 Memory Hierarchy Registers: very few, very fast cache memory: small, fast main memory:
1 CMPE 421 Advanced Computer Architecture Accessing a Cache PART1.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 10 Memory Hierarchy.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
1 Chapter Seven. 2 Users want large and fast memories! SRAM access times are ns at cost of $100 to $250 per Mbyte. DRAM access times are ns.
Caching Chapter 7.
CS.305 Computer Architecture Memory: Caches Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made available.
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.
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.
CS2100 Computer Organisation Cache I (AY2015/6) Semester 1.
1 Chapter Seven. 2 Users want large and fast memories! SRAM access times are ns at cost of $100 to $250 per Mbyte. DRAM access times are ns.
1  1998 Morgan Kaufmann Publishers Chapter Seven.
1  2004 Morgan Kaufmann Publishers Locality A principle that makes having a memory hierarchy a good idea If an item is referenced, temporal locality:
The Memory Hierarchy (Lectures #17 - #20) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
Chapter 5 Large and Fast: Exploiting Memory Hierarchy.
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.
Computer Organization CS224 Fall 2012 Lessons 37 & 38.
Fall EE 333 Lillevik 333f06-l16 University of Portland School of Engineering Computer Organization Lecture 16 Write-through, write-back cache Memory.
Advanced Computer Architecture CS 704 Advanced Computer Architecture Lecture 26 Memory Hierarchy Design (Concept of Caching and Principle of Locality)
COSC3330 Computer Architecture
Yu-Lun Kuo Computer Sciences and Information Engineering
Improving Memory Access 1/3 The Cache and Virtual Memory
How will execution time grow with SIZE?
Morgan Kaufmann Publishers Memory & Cache
CSCI206 - Computer Organization & Programming
Lecture 11 Memory Hierarchy.
Lecture 11 Memory Hierarchy.
Systems Architecture II
Lecture 22: Cache Hierarchies, Memory
EE108B Review Session #6 Daxia Ge Friday February 23rd, 2007
Morgan Kaufmann Publishers Memory Hierarchy: Introduction
CS-447– Computer Architecture Lecture 20 Cache Memories
Lecture 21: Memory Hierarchy
Chapter Five Large and Fast: Exploiting Memory Hierarchy
Memory & Cache.
10/18: Lecture Topics Using spatial locality
Presentation transcript:

Cache Basics Define temporal and spatial locality. Define hit rate and miss rate. Define the term cache Explain how a direct mapped cache determines the location in the cache. Given a memory address and cache size information, perform the calculations to convert an address to a cache block number.

Memory access time - exercise Recall: The MEM stage of the MIPS pipeline takes 200ps. Is it actually possible to request and retrieve (i.e. make a round trip) a word of memory in that period of time (assume that the memory chip is 60mm away from the CPU)? C=300,000,000 m/s = 3E8m/s = 3E11mm/s in a vacuum; assume 2/3 that in a conductor, or 2E11mm/s T = x/c = 60/2E11 = 3E-10s = 0.3ns = 300ps Round trip is thus 600ps (3x the MEM duration), and that’s not counting the time it takes the memory chip to respond to the request and produce the data to be sent back. To make a round trip in 200ps, the distance would have to be <20mm (<~3/4 inch), and that’s still assuming 0ps for chip response time. CS2710 Computer Organization

CS2710 Computer Organization Definitions Temporal Locality The principle stating that if a data location is referenced then it will again be referenced soon. Spatial Locality The locality principle stating that if a data location is referenced, data locations with nearby addresses will tend to be referenced soon. CS2710 Computer Organization

Computer memory hierarchy Note the various levels CS2710 Computer Organization

CS2710 Computer Organization SYX SG-125 Gaming PC Intel Core i7 2600 3.4 GHz, Genuine Windows® 7 Professional 64 Bit, 1GB NVIDIA GeForce GTX 550 Ti, 8GB DDR3, 1TB 7200rpm HDD, Blu-Ray, USB 3.0 4 x 256 KB L2 Cache 8MB Cache 8 GB System Memory 1 TB Hard Drive Space Many Many internal registers 4 x 256 KB L2 Cache 8MB Cache 8 GB System Memory 1 TB Hard Drive Space Many Many internal registers CS2710 Computer Organization

CS2710 Computer Organization Definitions Block The minimum unit of information that can be either present or not present in the cache Hit Rate The fraction of memory accesses found in the level of the memory hierarchy Miss Rate The fraction of memory accesses not found in a level of the memory hierarchy Miss penalty The time required to fetch a block into a level of memory hierarchy from the lower level. CS2710 Computer Organization

CS2710 Computer Organization Cache Memory The level of memory closest to the Processor CS2710 Computer Organization

Determining where to look Direct Mapped Cache Block to access Cache Location (16 blocks) 0x01 0x05 0x15 0x22 0x37 0x3F 0x3D CS2710 Computer Organization

CS2710 Computer Organization Direct Mapped Cache #Blocks is a power of 2 Use low-order address bits CS2710 Computer Organization

CS2710 Computer Organization Tags and Valid bits If we search the cache, how do we know if the data is valid or not? How do we know which specific block in in the cache? Valid Bit Indicates the data in the associated block is valid Tag: A field in the table containing the address information required to identify if the associated block is the correct block. The upper bits of the address CS2710 Computer Organization

Example Address stream Index V Tag Data 000 N 001 010 011 100 101 110 111 10110, 11010, 10000, 10110, 00011, 10010, CS2710 Computer Organization

CS2710 Computer Organization Address Subdivision CS2710 Computer Organization

CS2710 Computer Organization Determining Sizes CS2710 Computer Organization

CS2710 Computer Organization Minute Quiz Which of the following statements is generally false? Caches primarily take advantage of temporal locality On a read, the value returned depends upon which blocks are in the cache Most of the capacity of the memory hierarchy is at the lowest level The most expensive portion of the memory hierarchy is at the highest level CS2710 Computer Organization