Anshul Kumar, CSE IITD CSL718 : Memory Hierarchy Cache Memories - continued 13th Feb, 2006.

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

Anshul Kumar, CSE IITD CSL718 : Memory Hierarchy Cache Performance Improvement 23rd Feb, 2006.
Cache Here we focus on cache improvements to support at least 1 instruction fetch and at least 1 data access per cycle – With a superscalar, we might need.
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
CSCI 232© 2005 JW Ryder1 Cache Memory Systems Introduced by M.V. Wilkes (“Slave Store”) Appeared in IBM S360/85 first commercially.
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011 Computer Science Cornell University P & H Chapter
Spring 2003CSE P5481 Introduction Why memory subsystem design is important CPU speeds increase 55% per year DRAM speeds increase 3% per year rate of increase.
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.
Associative Cache Mapping A main memory block can load into any line of cache Memory address is interpreted as tag and word (or sub-address in line) Tag.
Translation Buffers (TLB’s)
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Mem. Hier. CSE 471 Aut 011 Evolution in Memory Management Techniques In early days, single program run on the whole machine –Used all the memory available.
Cache intro CSE 471 Autumn 011 Principle of Locality: Memory Hierarchies Text and data are not accessed randomly Temporal locality –Recently accessed items.
An Intelligent Cache System with Hardware Prefetching for High Performance Jung-Hoon Lee; Seh-woong Jeong; Shin-Dug Kim; Weems, C.C. IEEE Transactions.
Maninder Kaur CACHE MEMORY 24-Nov
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 19: Cache Operation & Design Spring 2009.
CMPE 421 Parallel Computer Architecture
Anshul Kumar, CSE IITD CSL718 : Main Memory CPU-Cache-Main Memory Performance 9th Mar, 2006.
CSL718 : Memory Hierarchy Cache Memories 6th Feb, 2006
Chapter Twelve Memory Organization
Computer Architecture Lecture 8: Memory hierarchy. Cache memory Piotr Bilski.
Computer Architecture Memory organization. Types of Memory Cache Memory Serves as a buffer for frequently accessed data Small  High Cost RAM (Main Memory)
2007 Sept. 14SYSC 2001* - Fall SYSC2001-Ch4.ppt1 Chapter 4 Cache Memory 4.1 Memory system 4.2 Cache principles 4.3 Cache design 4.4 Examples.
CSE 241 Computer Engineering (1) هندسة الحاسبات (1) Lecture #3 Ch. 6 Memory System Design Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Additional Slides By Professor Mary Jane Irwin Pennsylvania State University Group 3.
M E M O R Y. Computer Performance It depends in large measure on the interface between processor and memory. CPI (or IPC) is affected CPI = Cycles per.
CS.305 Computer Architecture Memory: Caches Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made available.
Cache Memory Chapter 17 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S. Dandamudi.
11 Intro to cache memory Kosarev Nikolay MIPT Nov, 2009.
EEC4133 Computer Organization & Architecture Chapter 7: Memory by Muhazam Mustapha, April 2014.
Cache Small amount of fast memory Sits between normal main memory and CPU May be located on CPU chip or module.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
Characteristics Location Capacity Unit of transfer Access method Performance Physical type Physical characteristics Organisation.
Cache Memory.
CSL718 : Superscalar Processors
Associativity in Caches Lecture 25
Computer Architecture
Multilevel Memories (Improving performance using alittle “cash”)
Lecture: Cache Hierarchies
Cache Memory Presentation I
Lecture: Cache Hierarchies
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2011
Evolution in Memory Management Techniques
Cache Coherence Protocols 15th April, 2006
Chapter 5 Memory CSE 820.
ECE 445 – Computer Organization
Virtual Memory فصل هشتم.
Chapter 6 Memory System Design
Chap. 12 Memory Organization
Adapted from slides by Sally McKee Cornell University
Chapter 5 Exploiting Memory Hierarchy : Cache Memory in CMP
Translation Buffers (TLB’s)
Virtual Memory Overcoming main memory size limitation
Translation Buffers (TLB’s)
CSE 471 Autumn 1998 Virtual memory
Update : about 8~16% are writes
Lecture 9: Caching and Demand-Paged Virtual Memory
Principle of Locality: Memory Hierarchies
Translation Buffers (TLBs)
Review What are the advantages/disadvantages of pages versus segments?
10/18: Lecture Topics Using spatial locality
Overview Problem Solution CPU vs Memory performance imbalance
Presentation transcript:

Anshul Kumar, CSE IITD CSL718 : Memory Hierarchy Cache Memories - continued 13th Feb, 2006

Anshul Kumar, CSE IITD slide 2 Cache Policies Placement/Mapping –Direct, Associative, Set associative, Sector mapped Read –Sequential / Concurrent, Simple / Forward Load –Block load / Load forward / Wrap around Fetch –Demand fetch, Software pre-fetch, Hardware pre-fetch Replacement –LRU / LFU / FIFO / Random

Anshul Kumar, CSE IITD slide 3 Fetch Policies Demand fetching –fetch only when required (miss) Hardware prefetching –automatically prefetch next block Software prefetching –programmer decides to prefetch questions: –how much ahead (prefetch distance) –how often

Anshul Kumar, CSE IITD slide 4 Software Control of Cache Software visible cache –mode selection (WT, WB etc) –block flush –block invalidate –block prefetch

Anshul Kumar, CSE IITD slide 5 Replacement Policies Least Recently Used (LRU) Least Frequently Used (LFU) First In First Out (FIFO) Random

Anshul Kumar, CSE IITD slide 6 Write Policies Write Hit –Write Back –Write Through Write Miss –Write Back –Write Through With Write Allocate With No Write Allocate

Anshul Kumar, CSE IITD slide 7 Write Policies Write Back (WB) Write Through (WT) Write into memory later No consistence Higher block traffic No word traffic Better for larger cache/ low miss rate Write into memory now Consistence maintained Reduced block traffic Word traffic introduced Better for smaller cache/ higher miss rate

Anshul Kumar, CSE IITD slide 8 Looking deeper : Write Hit Write Through (WT) Write in cache+mem Write Back (WB) Write in cache only Write in mem only Does not make sense

Anshul Kumar, CSE IITD slide 9 Looking deeper : Write Miss Write Back (WB) Does not make sense Allocate missing block and write in cache Write in mem yesno yes Write Through Write Allocate (WTWA) Write Through No Write Allocate (WTNWA)

Anshul Kumar, CSE IITD slide 10 Write Policies : Common combinations     Write Miss Write Hit WBWTWA WT WB WTNWA

Anshul Kumar, CSE IITD slide 11 Write Policies: Timings Timings as seen on the bus –depends on the amount of data transferred (number of blocks and/or words) Timings as seen by the CPU –can be minimized by using a buffer

Anshul Kumar, CSE IITD slide 12 Write Policies : Bus times in Write Hit TwTw 0 TwTw 00 TwTw Write Miss Write Hit WBWTWA WT WB WTNWA

Anshul Kumar, CSE IITD slide 13 Write Policies : Bus times in Read Miss T b (1-P c ) TbTb TbTb Write Miss Write Hit WBWTWA WT WB WTNWA T b +

Anshul Kumar, CSE IITD slide 14 Write Policies : Bus times in Write Miss T b (1-P c ) T b + T b (1-P c ) Write Miss Write Hit WBWTWA WT WB WTNWA T b + TwTw TwTw TwTw TwTw

Analyzing Write Policies:CPU time Hit:WB, Miss: WB1T b + i11 Hit:WB, Miss: WTWA1T b + i11 Hit:WB, Miss: WTNWA1T b + i11 Hit:WT, Miss: WB1T b + i11 Hit:WT, Miss: WTWA1T b + i11 Hit:WT, Miss: WTNWA1T b + i11 PolicyReadReadWriteWrite hitmisshitmiss i depends on read policy

Anshul Kumar, CSE IITD slide 16 Analyzing Write Policies:Bus time Hit:WB, Miss: WB0T b (2-Pc)0 T b (2-Pc) Hit:WB, Miss: WTWA0T b (2-Pc) 0 T b (2-Pc)+T w Hit:WB, Miss: WTNWA0T b (2-Pc) 0 T w Hit:WT, Miss: WB0T b (2-Pc) T w T b (2-Pc) Hit:WT, Miss: WTWA0T b T w T b +T w Hit:WT, Miss: WTNWA0T b T w T w PolicyReadReadWriteWrite hitmisshitmiss

Anshul Kumar, CSE IITD slide 17 More Choices for Write Miss-WT Fetch on Write Write Around Does not make sense Fetch on Write Write Allocate yesno yes Write Validate T b + T w  T w

Anshul Kumar, CSE IITD slide 18 More Choices for Write Miss-WT Fetch on Write Write Around Does not make sense Fetch on Write Write Allocate yesno yes Write Validate Write before hit no yes no yes Rewrite (cache) Write invalidate Direct mapped cache

Anshul Kumar, CSE IITD slide 19 Write Miss-WT Choices (no write before hit) Allocate a block in cache Fetch contents from mem Write word in cache Write word in mem Write Allocate, Fetch on Write Write word in mem only No Write Allocate, No Fetch on Write Allocate a block in cache, mark all invalid Write word in cache, mark it valid Write word in mem Write Allocate, No Fetch on Write

Anshul Kumar, CSE IITD slide 20 Write Miss-WT Choices (write before hit) Allocate a block in cache Fetch contents from mem Re-write word in cache Write word in mem Write Allocate, Fetch on Write Invalidate word in cache, write in mem No Write Allocate, No Fetch on Write Allocate a block in cache, mark all invalid Re-write word in cache, mark it valid Write word in mem Write Allocate, No Fetch on Write