Morgan Kaufmann Publishers

Slides:



Advertisements
Similar presentations
1 Parallel Scientific Computing: Algorithms and Tools Lecture #2 APMA 2821A, Spring 2008 Instructors: George Em Karniadakis Leopold Grinberg.
Advertisements

Practical Caches COMP25212 cache 3. Learning Objectives To understand: –Additional Control Bits in Cache Lines –Cache Line Size Tradeoffs –Separate I&D.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
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  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
1  2004 Morgan Kaufmann Publishers Chapter Seven.
Lecture 32: Chapter 5 Today’s topic –Cache performance assessment –Associative caches Reminder –HW8 due next Friday 11/21/2014 –HW9 due Wednesday 12/03/2014.
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy (Part II)
Lecture 31: Chapter 5 Today’s topic –Direct mapped cache Reminder –HW8 due 11/21/
CMPE 421 Parallel Computer Architecture
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
The Memory Hierarchy 21/05/2009Lecture 32_CA&O_Engr Umbreen Sabir.
1  1998 Morgan Kaufmann Publishers Recap: Memory Hierarchy of a Modern Computer System By taking advantage of the principle of locality: –Present the.
B. Ramamurthy.  12 stage pipeline  At peak speed, the processor can request both an instruction and a data word on every clock.  We cannot afford pipeline.
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.
DECStation 3100 Block Instruction Data Effective Program Size Miss Rate Miss Rate Miss Rate 1 6.1% 2.1% 5.4% 4 2.0% 1.7% 1.9% 1 1.2% 1.3% 1.2% 4 0.3%
1  2004 Morgan Kaufmann Publishers Chapter Seven Memory Hierarchy-3 by 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.
1  1998 Morgan Kaufmann Publishers Chapter Seven.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
Memory Hierarchy and Caches. Who Cares about Memory Hierarchy? Processor Only Thus Far in Course CPU-DRAM Gap 1980: no cache in µproc; level cache,
Lecture 20 Last lecture: Today’s lecture: Types of memory
Computer Organization CS224 Fall 2012 Lessons 39 & 40.
Caches 1 Computer Organization II © McQuain Memory Technology Static RAM (SRAM) – 0.5ns – 2.5ns, $2000 – $5000 per GB Dynamic RAM (DRAM)
Chapter 5 Large and Fast: Exploiting Memory Hierarchy.
The Memory Hierarchy Cache, Main Memory, and Virtual Memory Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Cache Memory.
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.
Cache Issues Computer Organization II 1 Main Memory Supporting Caches Use DRAMs for main memory – Fixed width (e.g., 1 word) – Connected by fixed-width.
CSCI206 - Computer Organization & Programming
CS161 – Design and Architecture of Computer
CMSC 611: Advanced Computer Architecture
Soner Onder Michigan Technological University
COSC3330 Computer Architecture
Cache Memory and Performance
Memory COMPUTER ARCHITECTURE
CS161 – Design and Architecture of Computer
Morgan Kaufmann Publishers Large and Fast: Exploiting Memory Hierarchy
ENG3380 Computer Organization and Architecture “Cache Memory Part III”
CSC 4250 Computer Architectures
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers Large and Fast: Exploiting Memory Hierarchy
Memory Hierarchy Virtual Memory, Address Translation
Morgan Kaufmann Publishers
Consider a Direct Mapped Cache with 4 word blocks
Morgan Kaufmann Publishers Memory & Cache
Morgan Kaufmann Publishers Large and Fast: Exploiting Memory Hierarchy
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers
ECE 445 – Computer Organization
Exploiting Memory Hierarchy Chapter 7
FIGURE 12-1 Memory Hierarchy
Systems Architecture II
Lecture 08: Memory Hierarchy Cache Performance
ECE 445 – Computer Organization
Set-Associative Cache
Lecture 22: Cache Hierarchies, Memory
CPE 631 Lecture 05: Cache Design
Chapter 5 Exploiting Memory Hierarchy : Cache Memory in CMP
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Morgan Kaufmann Publishers Memory Hierarchy: Cache Basics
CS 704 Advanced Computer Architecture
If a DRAM has 512 rows and its refresh time is 9ms, what should be the frequency of row refresh operation on the average?
Chapter Five Large and Fast: Exploiting Memory Hierarchy
Cache - Optimization.
Memory Hierarchy Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Sarah Diesburg Operating Systems CS 3430
Sarah Diesburg Operating Systems COP 4610
Presentation transcript:

Morgan Kaufmann Publishers 12 September, 2018 Chapter 5 The Memory Hierarchy On a write hit, one thing we could do it always write the result back to memory. What is this called (write-through) What’s the alternative? (write-back, which only writes back to memory when a block is kicked out of memory) It’s a waste to write back to memory if we haven’t changed the block since it came into cache. How do we handle this? (dirty bit) Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 1 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

Measuring Cache Performance Morgan Kaufmann Publishers 12 September, 2018 Measuring Cache Performance Components of CPU time Program execution cycles Includes cache hit time Memory stall cycles Mainly from cache misses With simplifying assumptions: §5.4 Measuring and Improving Cache Performance Now let’s dig a little deeper into cache performance. In particular, we assume that our write buffer never gets too full, or if it does it’s too infrequent to matter. Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 2 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

Morgan Kaufmann Publishers 12 September, 2018 Associative Caches Fully associative Allow a given block to go in any cache entry Requires all entries to be searched at once Comparator per entry (expensive) n-way set associative Each set contains n entries Block number determines which set (Block number) modulo (#Sets in cache) Search all entries in a given set at once n comparators (less expensive) Fully associative is actually the scheme Abhi suggested, though it’s faster than I implied, since we can do all the searches in parallel. Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 3 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

Associative Cache Example Morgan Kaufmann Publishers 12 September, 2018 Associative Cache Example Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 4 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

Spectrum of Associativity Morgan Kaufmann Publishers 12 September, 2018 Spectrum of Associativity For a cache with 8 entries Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 5 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

Associativity Example Morgan Kaufmann Publishers 12 September, 2018 Associativity Example Compare 4-block caches Direct mapped, 2-way set associative, fully associative Block access sequence: 0, 8, 0, 6, 8 Direct mapped Block address Cache index Hit/miss Cache content after access 1 2 3 8 6 What does it look like (contents, misses) | Block address | Cache index | Hit/miss | 0 | 1 | 2 | 3 | |---------------+-------------+----------+--------+---+--------+---| | 0 | 0 | miss | Mem[0] | | | | | 8 | 0 | miss | Mem[8] | | | | | 6 | 2 | miss | Mem[0] | | Mem[6] | | | 8 | 0 | miss | Mem[8] | | Mem[6] | | Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 6 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

Associativity Example Morgan Kaufmann Publishers 12 September, 2018 Associativity Example Compare 4-block caches Direct mapped, 2-way set associative, fully associative Block access sequence: 0, 8, 0, 6, 8 Direct mapped Block address Cache index Hit/miss Cache content after access 1 2 3 miss Mem[0] 8 Mem[8] 6 Mem[6] Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 7 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

Associativity Example Morgan Kaufmann Publishers 12 September, 2018 Associativity Example 2-way set associative Block address Cache index Hit/miss Cache content after access Set 0 Set 1 8 6 Fully associative Block address Cache index Hit/miss Cache content after access 8 6 Now what do these look like? In particular, how many misses? | Block address | Cache index | Hit/miss | 0      | 1      | 2 | 3 | |---------------+-------------+----------+--------+--------+---+---| |             0 |           0 | miss     | Mem[0] |        |   |   | |             8 |           0 | miss     | Mem[0] | Mem[8] |   |   | |             0 |           0 | hit      | Mem[0] | Mem[8] |   |   | |             6 |           0 | miss     | Mem[0] | Mem[6] |   |   | |             8 |           0 | miss     | Mem[8] | Mem[6] |   |   | | Block address | Cache index | Hit/miss | 0      | 1      | 2      | 3 | |---------------+-------------+----------+--------+--------+--------+---| |             0 |             | miss     | Mem[0] |        |        |   | |             8 |             | miss     | Mem[0] | Mem[8] |        |   | |             0 |             | hit      | Mem[0] | Mem[8] |        |   | |             6 |             | miss     | Mem[0] | Mem[8] | Mem[6] |   | |             8 |             | hit      | Mem[0] | Mem[8] | Mem[6] |   | Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 8 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

Associativity Example Morgan Kaufmann Publishers 12 September, 2018 Associativity Example 2-way set associative Block address Cache index Hit/miss Cache content after access Set 0 Set 1 miss Mem[0] 8 Mem[8] hit 6 Mem[6] Fully associative Block address Hit/miss Cache content after access miss Mem[0] 8 Mem[8] hit 6 Mem[6] Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 9 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy

How Much Associativity Morgan Kaufmann Publishers 12 September, 2018 How Much Associativity Increased associativity decreases miss rate But with diminishing returns Simulation of a system with 64KB D-cache, 16-word blocks, SPEC2000 1-way: 10.3% 2-way: 8.6% 4-way: 8.3% 8-way: 8.1% Chapter 5 — Large and Fast: Exploiting Memory Hierarchy — 10 Chapter 5 — Large and Fast: Exploiting Memory Hierarchy