Lecture 13: Cache Hierarchies. Today: cache access basics and innovations (Sections )

Similar documents
Lecture 14: Cache Innovations and DRAM. Today: cache access basics and innovations, DRAM (Sections )

Lecture: Cache Hierarchies. Topics: cache innovations (Sections B.1-B.3, 2.1)

Lecture 11: SMT and Caching Basics. Today: SMT, cache access basics (Sections 3.5, 5.1)

Lecture: Large Caches, Virtual Memory. Topics: cache innovations (Sections 2.4, B.4, B.5)

Advanced Computer Architecture

Lecture: Large Caches, Virtual Memory. Topics: cache innovations (Sections 2.4, B.4, B.5)

Introduction to OpenMP. Lecture 10: Caches

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

Cray XE6 Performance Workshop

Computer Systems Architecture I. CSE 560M Lecture 17 Guest Lecturer: Shakir James

Page 1. Multilevel Memories (Improving performance using a little cash )

Q3: Block Replacement. Replacement Algorithms. ECE473 Computer Architecture and Organization. Memory Hierarchy: Set Associative Cache

Caching Basics. Memory Hierarchies

EITF20: Computer Architecture Part 5.1.1: Virtual Memory

Lecture 7 - Memory Hierarchy-II

Memory Hierarchy. Slides contents from:

Agenda. EE 260: Introduction to Digital Design Memory. Naive Register File. Agenda. Memory Arrays: SRAM. Memory Arrays: Register File

6 th Lecture :: The Cache - Part Three

Memory Hierarchy. Slides contents from:

Portland State University ECE 587/687. Caches and Memory-Level Parallelism

Locality and Data Accesses video is wrong one notes when video is correct

Lecture: SMT, Cache Hierarchies. Topics: SMT processors, cache access basics and innovations (Sections B.1-B.3, 2.1)

EITF20: Computer Architecture Part 5.1.1: Virtual Memory

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

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

Memory Hierarchy Recall the von Neumann bottleneck - single, relatively slow path between the CPU and main memory.

Cache Memory COE 403. Computer Architecture Prof. Muhamed Mudawar. Computer Engineering Department King Fahd University of Petroleum and Minerals

The levels of a memory hierarchy. Main. Memory. 500 By 1MB 4GB 500GB 0.25 ns 1ns 20ns 5ms

ECE 571 Advanced Microprocessor-Based Design Lecture 10

CSC 631: High-Performance Computer Architecture

COSC 6385 Computer Architecture - Memory Hierarchy Design (III)

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

Solutions for Chapter 7 Exercises

data block 0, word 0 block 0, word 1 block 1, word 0 block 1, word 1 block 2, word 0 block 2, word 1 block 3, word 0 block 3, word 1 Word index cache

Lecture-18 (Cache Optimizations) CS422-Spring

Lecture 17: Virtual Memory, Large Caches. Today: virtual memory, shared/pvt caches, NUCA caches

Announcements. ! Previous lecture. Caches. Inf3 Computer Architecture

Lecture 24: Memory, VM, Multiproc

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

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

Topics. Computer Organization CS Improving Performance. Opportunity for (Easy) Points. Three Generic Data Hazards

Computer Architecture Spring 2016

Memory Hierarchy. Maurizio Palesi. Maurizio Palesi 1

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

CS152 Computer Architecture and Engineering

Lecture: SMT, Cache Hierarchies. Topics: memory dependence wrap-up, SMT processors, cache access basics and innovations (Sections B.1-B.3, 2.

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

Lecture 18: Coherence Protocols. Topics: coherence protocols for symmetric and distributed shared-memory multiprocessors (Sections

CS152 Computer Architecture and Engineering CS252 Graduate Computer Architecture Spring Caches and the Memory Hierarchy

CS 136: Advanced Architecture. Review of Caches

Lecture: Large Caches, Virtual Memory. Topics: cache innovations (Sections 2.4, B.4, B.5)

Memory Hierarchies 2009 DAT105

12 Cache-Organization 1

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

COSC 6385 Computer Architecture. - Memory Hierarchies (II)

MEMORY HIERARCHY BASICS. B649 Parallel Architectures and Programming

Lecture: SMT, Cache Hierarchies. Topics: memory dependence wrap-up, SMT processors, cache access basics and innovations (Sections B.1-B.3, 2.

Page 1. Memory Hierarchies (Part 2)

Topics. Digital Systems Architecture EECE EECE Need More Cache?

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

EITF20: Computer Architecture Part4.1.1: Cache - 2

1/19/2009. Data Locality. Exploiting Locality: Caches

Improving Cache Performance and Memory Management: From Absolute Addresses to Demand Paging. Highly-Associative Caches

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

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

Computer Architecture Spring 2016

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

CACHE OPTIMIZATION. Mahdi Nazm Bojnordi. CS/ECE 6810: Computer Architecture. Assistant Professor School of Computing University of Utah

EC 513 Computer Architecture

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

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

MIPS) ( MUX

Lec 11 How to improve cache performance

Course Administration

Computer Systems Architecture

COMP 3221: Microprocessors and Embedded Systems

211: Computer Architecture Summer 2016

Memory hierarchy review. ECE 154B Dmitri Strukov

Memory Hierarchy. Maurizio Palesi. Maurizio Palesi 1

COSC4201. Chapter 4 Cache. Prof. Mokhtar Aboelaze York University Based on Notes By Prof. L. Bhuyan UCR And Prof. M. Shaaban RIT

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

Mo Money, No Problems: Caches #2...

Pollard s Attempt to Explain Cache Memory

Portland State University ECE 587/687. Caches and Memory-Level Parallelism

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 2

ECE331: Hardware Organization and Design

Memory hier ar hier ch ar y ch rev re i v e i w e ECE 154B Dmitri Struko Struk v o

Spring 2018 :: CSE 502. Cache Design Basics. Nima Honarmand

A Cache Hierarchy in a Computer System

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

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 1

EE 4683/5683: COMPUTER ARCHITECTURE

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

Assignment 1 due Mon (Feb 4pm

Advanced Memory Organizations

Chapter 2: Memory Hierarchy Design Part 2

UCB CS61C : Machine Structures

Show Me the $... Performance And Caches

2 Improved Direct-Mapped Cache Performance by the Addition of a Small Fully-Associative Cache and Prefetch Buffers [1]

COSC 6385 Computer Architecture - Memory Hierarchies (I)

Transcription:

Lecture 13: Cache Hierarchies Today: cache access basics and innovations (Sections 5.1-5.2) 1

The Cache Hierarchy Core L1 L2 L3 Off-chip memory 2

Accessing the Cache Byte address 101000 Offset 8-byte words 8 words: 3 index bits Direct-mapped cache: each address maps to a unique address Data array Sets 3

The Tag Array Byte address 101000 Tag 8-byte words Compare Direct-mapped cache: each address maps to a unique address Tag array Data array 4

Increasing Line Size Byte address 10100000 Tag Offset A large cache line size smaller tag array, fewer misses because of spatial locality 32-byte cache line size or block size Tag array Data array 5

Associativity Byte address 10100000 Set associativity fewer conflicts; wasted power because multiple data and tags are read Tag Way-1 Way-2 Tag array Compare Data array 6

Example 32 KB 4-way set-associative data cache array with 32 byte line sizes How many sets? How many index bits, offset bits, tag bits? How large is the tag array? 7

Types of Cache Misses Compulsory misses: happens the first time a memory word is accessed the misses for an infinite cache Capacity misses: happens because the program touched many other words before re-touching the same word the misses for a fully-associative cache Conflict misses: happens because two words map to the same location in the cache the misses generated while moving from a fully-associative to a direct-mapped cache Sidenote: can a fully-associative cache have more misses than a direct-mapped cache of the same size? 8

What Influences Cache Misses? Compulsory Capacity Conflict Increasing cache capacity Increasing number of sets Increasing block size Increasing associativity 9

Reducing Miss Rate Large block size reduces compulsory misses, reduces miss penalty in case of spatial locality increases traffic between different levels, space wastage, and conflict misses Large caches reduces capacity/conflict misses access time penalty High associativity reduces conflict misses rule of thumb: 2-way cache of capacity N/2 has the same miss rate as 1-way cache of capacity N more energy Way prediction by predicting the way, the access time is effectively like a direct-mapped cache can also reduce power consumption 10

Cache Misses On a write miss, you may either choose to bring the block into the cache (write-allocate) or not (write-no-allocate) On a read miss, you always bring the block in (spatial and temporal locality) but which block do you replace? no choice for a direct-mapped cache randomly pick one of the ways to replace replace the way that was least-recently used (LRU) FIFO replacement (round-robin) 11

Writes When you write into a block, do you also update the copy in L2? write-through: every write to L1 write to L2 write-back: mark the block as dirty, when the block gets replaced from L1, write it to L2 Writeback coalesces multiple writes to an L1 block into one L2 write Writethrough simplifies coherency protocols in a multiprocessor system as the L2 always has a current copy of data 12

Reducing Cache Miss Penalty Multi-level caches Critical word first Priority for reads Victim caches 13

Multi-Level Caches The L2 and L3 have properties that are different from L1 access time is not as critical for L2 as it is for L1 (every load/store/instruction accesses the L1) the L2 is much larger and can consume more power per access Hence, they can adopt alternative design choices serial tag and data access high associativity 14

Read/Write Priority For writeback/thru caches, writes to lower levels are placed in write buffers When we have a read miss, we must look up the write buffer before checking the lower level When we have a write miss, the write can merge with another entry in the write buffer or it creates a new entry Reads are more urgent than writes (probability of an instr waiting for the result of a read is 100%, while probability of an instr waiting for the result of a write is much smaller) hence, reads get priority unless the write buffer is full 15

Victim Caches A direct-mapped cache suffers from misses because multiple pieces of data map to the same location The processor often tries to access data that it recently discarded all discards are placed in a small victim cache (4 or 8 entries) the victim cache is checked before going to L2 Can be viewed as additional associativity for a few sets that tend to have the most conflicts 16

Tolerating Miss Penalty Out of order execution: can do other useful work while waiting for the miss can have multiple cache misses -- cache controller has to keep track of multiple outstanding misses (non-blocking cache) Hardware and software prefetching into prefetch buffers aggressive prefetching can increase contention for buses 17

Title Bullet 18