EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Caches!! Theory Design Examples 2.

Slides:



Advertisements
Similar presentations
SE-292 High Performance Computing
Advertisements

SE-292 High Performance Computing Memory Hierarchy R. Govindarajan
Lecture 19: Cache Basics Today’s topics: Out-of-order execution
Computation I pg 1 Embedded Computer Architecture Memory Hierarchy: Cache Recap Course 5KK73 Henk Corporaal November 2014
Virtual Memory. The Limits of Physical Addressing CPU Memory A0-A31 D0-D31 “Physical addresses” of memory locations Data All programs share one address.
Lecture 8 Memory Management. Paging Too slow -> TLB Too big -> multi-level page table What if all that stuff does not fit into memory?
1 Recap: Memory Hierarchy. 2 Unified vs.Separate Level 1 Cache Unified Level 1 Cache (Princeton Memory Architecture). A single level 1 cache is used for.
1 Recap: Memory Hierarchy. 2 Memory Hierarchy - the Big Picture Problem: memory is too slow and or too small Solution: memory hierarchy Fastest Slowest.
CS2100 Computer Organisation Cache II (AY2014/2015) Semester 2.
Cs 325 virtualmemory.1 Accessing Caches in Virtual Memory Environment.
1 Copyright © 2012, Elsevier Inc. All rights reserved. Chapter 2 (and Appendix B) Memory Hierarchy Design Computer Architecture A Quantitative Approach,
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Caches P & H Chapter 5.1, 5.2 (except writes)
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Caches P & H Chapter 5.1, 5.2 (except writes)
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Caches 2 P & H Chapter 5.2 (writes), 5.3, 5.5.
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 2 Instructors: Krste Asanovic & Vladimir Stojanovic
The Lord of the Cache Project 3. Caches Three common cache designs: Direct-Mapped store in exactly one cache line Fully Associative store in any cache.
Multilevel Memory Caches Prof. Sirer CS 316 Cornell University.
How caches take advantage of Temporal locality
Embedded Computer Architecture 5KK73 TU/e Henk Corporaal Bart Mesman Data Memory Management Part d: Data Layout for Caches.
Caches J. Nelson Amaral University of Alberta. Processor-Memory Performance Gap Bauer p. 47.
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 ( )
5/27/99 Ashish Sabharwal1 Cache Misses - The 3 C’s n Compulsory misses –cold start –don’t have a choice –except that by increasing block size, can reduce.
2/27/2002CSE Cache II Caches, part II CPU On-chip cache Off-chip cache DRAM memory Disk memory.
Caches – basic idea Small, fast memory Stores frequently-accessed blocks of memory. When it fills up, discard some blocks and replace them with others.
Systems I Locality and Caching
ECE Dept., University of Toronto
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
0 High-Performance Computer Architecture Memory Organization Chapter 5 from Quantitative Architecture January 2006.
Multilevel Memory Caches Prof. Sirer CS 316 Cornell University.
10/18: Lecture topics Memory Hierarchy –Why it works: Locality –Levels in the hierarchy Cache access –Mapping strategies Cache performance Replacement.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 10 Memory Hierarchy.
CSIE30300 Computer Architecture Unit 08: Cache Hsin-Chou Chi [Adapted from material by and
3-May-2006cse cache © DW Johnson and University of Washington1 Cache Memory CSE 410, Spring 2006 Computer Systems
CS2100 Computer Organisation Cache II (AY2015/6) Semester 1.
Computer Organization CS224 Fall 2012 Lessons 45 & 46.
Memory Architecture Chapter 5 in Hennessy & Patterson.
Systems I Cache Organization
COMP SYSTEM ARCHITECTURE PRACTICAL CACHES Sergio Davies Feb/Mar 2014COMP25212 – Lecture 3.
Constructive Computer Architecture Realistic Memories and Caches Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology.
EECS 370 Discussion 1 Calvin and Hobbes by Bill Watterson.
1 Memory Hierarchy Design Chapter 5. 2 Cache Systems CPUCache Main Memory Data object transfer Block transfer CPU 400MHz Main Memory 10MHz Bus 66MHz CPU.
CSCI206 - Computer Organization & Programming
CS161 – Design and Architecture of Computer
Improving Memory Access The Cache and Virtual Memory
Virtual Memory Chapter 7.4.
CSE 351 Section 9 3/1/12.
CS161 – Design and Architecture of Computer
Associativity in Caches Lecture 25
Section 9: Virtual Memory (VM)
Ramya Kandasamy CS 147 Section 3
The Hardware/Software Interface CSE351 Winter 2013
Lecture: Cache Hierarchies
Lecture: Cache Hierarchies
Lecture 21: Memory Hierarchy
Lecture 21: Memory Hierarchy
Lecture 22: Cache Hierarchies, Memory
Performance metrics for caches
CDA 5155 Caches.
Adapted from slides by Sally McKee Cornell University
Caches III CSE 351 Autumn 2018 Instructor: Justin Hsia
Lecture 22: Cache Hierarchies, Memory
Lecture 21: Memory Hierarchy
Fundamentals of Computing: Computer Architecture
Cache Memory Rabi Mahapatra
Lecture 13: Cache Basics Topics: terminology, cache organization (Sections )
10/18: Lecture Topics Using spatial locality
Caches III CSE 351 Spring 2019 Instructor: Ruth Anderson
Overview Problem Solution CPU vs Memory performance imbalance
Memory Management & Virtual Memory
Presentation transcript:

EECS 370 Discussion 1 xkcd.com

EECS 370 Discussion Topics Today: – Caches!! Theory Design Examples 2

EECS 370 Discussion Memory Hierarchy 3 Cache Main Memory (RAM) Disk (Hard Drive)

EECS 370 Discussion Memory Hierarchy Real World Example - Intel i7 4 Cache LevelSizeAccess Time L1 64 kB4 cycles L2 256 kB10 cycles L38192 kB40 cycles RAM kB200 cycles Disk kB cycles

EECS 370 Discussion Memory Hierarchy Problem: Caches are very tiny, but memory is quite large If memory accesses are totally random, caches are useless Solution: Memory accesses really aren’t random at all! 5

EECS 370 Discussion Memory Hierarchy Temporal Locality You are likely to access memory locations multiple times Spatial Locality You are likely to access memory locations near each other 6

EECS 370 Discussion Memory Hierarchy Example: int data[10]; int sum = 0; … for (int i=0; i<10; i++) { sum += data[i]; } 7

EECS 370 Discussion Memory Hierarchy Real World Example - Intel i7 8 Core0Core1Core2Core3

EECS 370 Discussion Cache Design Split Cache – portion your cache into two halves I-Cache: Instruction Cache D-Cache: Data Cache Why would we want to do this? 9

EECS 370 Discussion Types of Caches Fully Associative Blocks map to any cache line 10 Cache TagData Memory 0x x x x100C40 0x x x x101C80 0x x x

EECS 370 Discussion Types of Caches Direct Mapped Blocks map to one cache line 11 Cache TagData Memory 0x x x x100C40 0x x x x101C80 0x x x

EECS 370 Discussion Types of Caches Set Associative Blocks map to any line in a set 12 Cache TagData Memory 0x x x x100C40 0x x x x101C80 0x x x

EECS 370 Discussion Types of Caches Set Associative Sets = Cache Lines / Ways 13 Cache TagData Cache TagData Cache TagData Cache TagData 1-Way 2-Way 3-Way 6-Way

EECS 370 Discussion Three C’s There are three reasons a cache miss occurs 1)Compulsory – never been loaded before 2)Capacity – evicted due to small cache size 3)Conflict – evicted due to overlap with another block 14

EECS 370 Discussion Cache Addressing Addresses split into: 15 TagSet IndexBlock Offset log 2 (Block Size) log 2 (Number of Sets) Remaining Bits

EECS 370 Discussion Cache Writing Policy For Writes Only On misses: Write Allocate – add to cache No Write Allocate – don’t add to cache On hits: Write Through – always write to memory Write Back – only write to cache 16

EECS 370 Discussion Caches Cache Examples 17

EECS 370 Discussion Block size = 1 Word, Address = 16 bits 2-way Set Associative 18 Cache TagData Memory 0x x x x100C40 0x x x x101C80 0x x x x102C120

EECS 370 Discussion Caches Cache Examples Options: – Type of Cache – Cache Size – Block Size – Address Bits – Write Policy 19