Memory Hierarchy Basics

Similar documents
Memory Hierarchy Basics. Ten Advanced Optimizations. Small and Simple

LRU. Pseudo LRU A B C D E F G H A B C D E F G H H H C. Copyright 2012, Elsevier Inc. All rights reserved.

Memory Hierarchy Computing Systems & Performance MSc Informatics Eng. Memory Hierarchy (most slides are borrowed)

Memory Hierarchy Computing Systems & Performance MSc Informatics Eng. Memory Hierarchy (most slides are borrowed)

Copyright 2012, Elsevier Inc. All rights reserved.

Computer Architecture. A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

Copyright 2012, Elsevier Inc. All rights reserved.

LECTURE 5: MEMORY HIERARCHY DESIGN

Computer Architecture A Quantitative Approach, Fifth Edition. Chapter 2. Memory Hierarchy Design. Copyright 2012, Elsevier Inc. All rights reserved.

Memory Hierarchy. Advanced Optimizations. Slides contents from:

EI338: Computer Systems and Engineering (Computer Architecture & Operating Systems)

Copyright 2012, Elsevier Inc. All rights reserved.

Adapted from David Patterson s slides on graduate computer architecture

Advanced optimizations of cache performance ( 2.2)

Copyright 2012, Elsevier Inc. All rights reserved.

Advanced cache optimizations. ECE 154B Dmitri Strukov

EITF20: Computer Architecture Part4.1.1: Cache - 2

CACHE MEMORIES ADVANCED COMPUTER ARCHITECTURES. Slides by: Pedro Tomás

EITF20: Computer Architecture Part4.1.1: Cache - 2

CSE 502 Graduate Computer Architecture

COSC 6385 Computer Architecture. - Memory Hierarchies (II)

Cache Optimisation. sometime he thought that there must be a better way

MEMORY HIERARCHY DESIGN. B649 Parallel Architectures and Programming

Chapter-5 Memory Hierarchy Design

COSC 6385 Computer Architecture - Memory Hierarchy Design (III)

Lec 11 How to improve cache performance

Pollard s Attempt to Explain Cache Memory

Outline. 1 Reiteration. 2 Cache performance optimization. 3 Bandwidth increase. 4 Reduce hit time. 5 Reduce miss penalty. 6 Reduce miss rate

Advanced Caching Techniques

Lecture 9: Improving Cache Performance: Reduce miss rate Reduce miss penalty Reduce hit time

COSC 6385 Computer Architecture - Memory Hierarchies (II)

Advanced cache memory optimizations

Lecture-18 (Cache Optimizations) CS422-Spring

Advanced Caching Techniques

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier

Memory Hierarchies 2009 DAT105

TDT Coarse-Grained Multithreading. Review on ILP. Multi-threaded execution. Contents. Fine-Grained Multithreading

Improving Cache Performance. Dr. Yitzhak Birk Electrical Engineering Department, Technion

EITF20: Computer Architecture Part 5.1.1: Virtual Memory

CS222: Cache Performance Improvement

MEMORY HIERARCHY DESIGN

Control Hazards. Branch Prediction

Chapter 5 Memory Hierarchy Design. In-Cheol Park Dept. of EE, KAIST

Memories. CPE480/CS480/EE480, Spring Hank Dietz.

Lecture 19: Memory Hierarchy Five Ways to Reduce Miss Penalty (Second Level Cache) Admin

Reducing Miss Penalty: Read Priority over Write on Miss. Improving Cache Performance. Non-blocking Caches to reduce stalls on misses

Locality. Cache. Direct Mapped Cache. Direct Mapped Cache

CISC 662 Graduate Computer Architecture Lecture 18 - Cache Performance. Why More on Memory Hierarchy?

Types of Cache Misses: The Three C s

Chapter 2 (cont) Instructor: Josep Torrellas CS433. Copyright Josep Torrellas 1999, 2001, 2002,

NOW Handout Page # Why More on Memory Hierarchy? CISC 662 Graduate Computer Architecture Lecture 18 - Cache Performance

Lecture 20: Memory Hierarchy Main Memory and Enhancing its Performance. Grinch-Like Stuff

Memory Hierarchy 3 Cs and 6 Ways to Reduce Misses

Classification Steady-State Cache Misses: Techniques To Improve Cache Performance:

Chapter 2: Memory Hierarchy Design Part 2

A Cache Hierarchy in a Computer System

Lecture notes for CS Chapter 2, part 1 10/23/18

CPU issues address (and data for write) Memory returns data (or acknowledgment for write)

LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY

Chapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY

Chapter 5. Topics in Memory Hierachy. Computer Architectures. Tien-Fu Chen. National Chung Cheng Univ.

Improving Cache Performance. Reducing Misses. How To Reduce Misses? 3Cs Absolute Miss Rate. 1. Reduce the miss rate, Classifying Misses: 3 Cs

Advanced Caching Techniques (2) Department of Electrical Engineering Stanford University

Computer Architecture Spring 2016

CPE 631 Lecture 06: Cache Design

Cache Performance! ! Memory system and processor performance:! ! Improving memory hierarchy performance:! CPU time = IC x CPI x Clock time

Aleksandar Milenkovich 1

High Performance Computer Architecture Prof. Ajit Pal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Lecture 18: Memory Hierarchy Main Memory and Enhancing its Performance Professor Randy H. Katz Computer Science 252 Spring 1996

DECstation 5000 Miss Rates. Cache Performance Measures. Example. Cache Performance Improvements. Types of Cache Misses. Cache Performance Equations

CS650 Computer Architecture. Lecture 9 Memory Hierarchy - Main Memory

Chapter 2: Memory Hierarchy Design Part 2

ארכיטקטורת יחידת עיבוד מרכזי ת

Memory Cache. Memory Locality. Cache Organization -- Overview L1 Data Cache

Advanced Computer Architecture- 06CS81-Memory Hierarchy Design

Memory Hierarchies. Instructor: Dmitri A. Gusev. Fall Lecture 10, October 8, CS 502: Computers and Communications Technology

Name: 1. Caches a) The average memory access time (AMAT) can be modeled using the following formula: AMAT = Hit time + Miss rate * Miss penalty

Cache performance Outline

Control Hazards. Prediction

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Why memory hierarchy? Memory hierarchy. Memory hierarchy goals. CS2410: Computer Architecture. L1 cache design. Sangyeun Cho

Cache Performance! ! Memory system and processor performance:! ! Improving memory hierarchy performance:! CPU time = IC x CPI x Clock time

Cache Performance (H&P 5.3; 5.5; 5.6)

Lecture 11 Reducing Cache Misses. Computer Architectures S

Announcements. ! Previous lecture. Caches. Inf3 Computer Architecture

CS 152 Computer Architecture and Engineering. Lecture 8 - Memory Hierarchy-III

Lecture 16: Memory Hierarchy Misses, 3 Cs and 7 Ways to Reduce Misses. Professor Randy H. Katz Computer Science 252 Fall 1995

Reducing Hit Times. Critical Influence on cycle-time or CPI. small is always faster and can be put on chip

Computer Architecture Spring 2016

The University of Adelaide, School of Computer Science 13 September 2018

COSC4201. Chapter 5. Memory Hierarchy Design. Prof. Mokhtar Aboelaze York University

CSF Cache Introduction. [Adapted from Computer Organization and Design, Patterson & Hennessy, 2005]

CMSC 611: Advanced Computer Architecture. Cache and Memory

EEC 170 Computer Architecture Fall Cache Introduction Review. Review: The Memory Hierarchy. The Memory Hierarchy: Why Does it Work?

10/16/2017. Miss Rate: ABC. Classifying Misses: 3C Model (Hill) Reducing Conflict Misses: Victim Buffer. Overlapping Misses: Lockup Free Cache

Lecture 11. Virtual Memory Review: Memory Hierarchy

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 7: Memory Organization Part II

Lec 12 How to improve cache performance (cont.)

Lecture 16: Memory Hierarchy Misses, 3 Cs and 7 Ways to Reduce Misses Professor Randy H. Katz Computer Science 252 Spring 1996

Portland State University ECE 587/687. Caches and Prefetching

Transcription:

Computer Architecture A Quantitative Approach, Fifth Edition Chapter 2 Memory Hierarchy Design 1 Memory Hierarchy Basics Six basic cache optimizations: Larger block size Reduces compulsory misses Increases capacity and conflict misses, increases miss penalty Larger total cache capacity to reduce miss rate Increases hit time, increases power consumption Higher associativity Reduces conflict misses Increases hit time, increases power consumption Higher number of cache levels Reduces overall memory access time Giving priority to read misses over writes Reduces miss penalty Avoiding address translation in cache indexing Reduces hit time Introduction 2 Chapter 2 Instructions: Language of the Computer 1

Ten Small and simple first level caches Critical timing path: addressing tag memory, then comparing tags, then selecting correct set Direct-mapped caches can overlap tag compare and transmission of data Lower associativity reduces power because fewer cache lines are accessed 3 L1 Size and Associativity Access time vs. size and associativity 4 Chapter 2 Instructions: Language of the Computer 2

L1 Size and Associativity Energy per read vs. size and associativity 5 Way Prediction To improve hit time, predict the way to pre-set mux Mis-prediction gives longer hit time Prediction accuracy > 90% for two-way > 80% for four-way I-cache has better accuracy than D-cache First used on MIPS R10000 in mid-90s Used on ARM Cortex-A8 Extend to predict block as well Way selectio Increases mis-prediction penalty 6 Chapter 2 Instructions: Language of the Computer 3

Pipelining Cache Pipeline cache access to improve bandwidth Examples: Pentium: 1 cycle Pentium Pro Pentium III: 2 cycles Pentium 4 Core i7: 4 cycles Increases branch mis-prediction penalty Makes it easier to increase associativity 7 Nonblocking Caches Allow hits before previous misses complete Hit under miss Hit under multiple miss L2 must support this In general, processors can hide L1 miss penalty but not L2 miss penalty 8 Chapter 2 Instructions: Language of the Computer 4

Multibanked Caches Organize cache as independent banks to support simultaneous access ARM Cortex-A8 supports 1-4 banks for L2 Intel i7 supports 4 banks for L1 and 8 banks for L2 Interleave banks according to block address 9 Critical Word First, Early Restart Critical word first Request missed word from memory first Send it to the processor as soon as it arrives Early restart Request words in normal order Send missed work to the processor as soon as it arrives Effectiveness of these strategies depends on block size and likelihood of another access to the portion of the block that has not yet been fetched 10 Chapter 2 Instructions: Language of the Computer 5

Merging Write Buffer When storing to a block that is already pending in the write buffer, update write buffer Reduces stalls due to full write buffer Do not apply to I/O addresses No write buffering Write buffering 11 Compiler Optimizations Loop Interchange Swap nested loops to access memory in sequential order Blocking Instead of accessing entire rows or columns, subdivide matrices into blocks Requires more memory accesses but improves locality of accesses 12 Chapter 2 Instructions: Language of the Computer 6

Hardware Prefetching Fetch two blocks on miss (include next sequential block) Pentium 4 Pre-fetching 13 Compiler Prefetching Insert prefetch instructions before data is needed Non-faulting: prefetch doest cause exceptions Register prefetch Loads data into register Cache prefetch Loads data into cache Combine with loop unrolling and software pipelining 14 Chapter 2 Instructions: Language of the Computer 7

Summary 15 Chapter 2 Instructions: Language of the Computer 8