复旦大学:《计算机原理 Computer System》课程PPT课件_Cache Memory(• General concepts • 3 ways to organize cache memory • Issues with writes • Write cache friendly codes • Cache mountain)

Cache Memory
1 Cache Memory

Outline General concepts 3 ways to organize cache memory Issues with writes Write cache friendly codes Cache mountain Suggested Reading: 6.4, 6.5, 6.6
2 Outline • General concepts • 3 ways to organize cache memory • Issues with writes • Write cache friendly codes • Cache mountain • Suggested Reading: 6.4, 6.5, 6.6

6.4 Cache Memories
3 6.4 Cache Memories

Cache Memory History At very beginning 3 levels Registers, main memory, disk storage 10 years later, 4 levels Register, SRAM cache, main DRAM memory, disk storage Modern processor, 4-5 levels Registers, SRAM L1, L2(, L3)cache, main DRAM memory, disk storage Cache memories are small fast SRAM-based memories are managed by hardware automatically can be on-chip, on-die, off-chi
4 Cache Memory • History – At very beginning, 3 levels • Registers, main memory, disk storage – 10 years later, 4 levels • Register, SRAM cache, main DRAM memory, disk storage – Modern processor, 4~5 levels • Registers, SRAM L1, L2(,L3) cache, main DRAM memory, disk storage – Cache memories • are small, fast SRAM-based memories • are managed by hardware automatically • can be on-chip, on-die, off-chip

Cache Memory Figure 6.24 P488 CPU chip register Tile L1 ALU cache 三 cache bus system bus memory bus main L2 cache bus interface bridge memory
5 Cache Memory Figure 6.24 P488 main memory I/O bridge L2 cache bus interface ALU register file CPU chip cache bus system bus memory bus L1 cache

Cache Memory L1 cache is on-chip L2 cache is off-chip several years ago L3 cache can be off-chip or on-chi CPU looks first for data in L1, then in l2 then In main memory Hold frequently accessed blocks of main memory are in caches
6 Cache Memory • L1 cache is on-chip • L2 cache is off-chip several years ago • L3 cache can be off-chip or on-chip • CPU looks first for data in L1, then in L2, then in main memory – Hold frequently accessed blocks of main memory are in caches

Inserting an L1 cache between the CPU and main memory The tiny, very fast CPU register file has room for four 4-byte words The transfer unit between the CPU register file and the cache is a 4-byte block line o The small fast L1 cache has room line 1 for two 4-word blocks The transfer unit between the cache and main memory is a 4-word block (16 bytes) block 10 a b cd The big slow main memory block 21pqrs has room for many 4-word blocks block 30wxyz
7 Inserting an L1 cache between the CPU and main memory block 10 a b c d block 21 p q r s ... ... block 30 w x y z ... The big slow main memory has room for many 4-word blocks. The small fast L1 cache has room for two 4-word blocks. The tiny, very fast CPU register file has room for four 4-byte words. The transfer unit between the cache and main memory is a 4-word block (16 bytes). The transfer unit between the CPU register file and the cache is a 4-byte block. line 0 line 1

6.4.1 Generic Cache Memory Organization Figure 6.25 P488 1 valid bit t tag bits B=2b bytes Cache is an array per line per line per cache block of sets va tag 0 ···B Each set contains E lines set 0: one or more lines valida[01· per set ···B Each line holds a block of data valid[tago1|…|B B-1 set 1: S〓2 s sets valid[tag[o1|· ···B valid tad 01…B-1 set S-1 valid tag 0 B pp488
8 6.4.1 Generic Cache Memory Organization Figure 6.25 P488 0 1 • • • B–1 0 1 • • • B–1 valid valid tag tag set 0: B = 2b bytes per cache block E lines per set S = 2s sets t tag bits per line 1 valid bit per line • • • 0 1 • • • B–1 0 1 • • • B–1 valid valid tag tag set 1: • • • 0 1 • • • B–1 0 1 • • • B–1 valid valid tag tag set S-1: • • • • • • Cache is an array of sets. Each set contains one or more lines. Each line holds a block of data. pp.488

Addressing caches Figure 6.25 P488 Address a t bits s bits b bits ][tag[011…B-1 set 0: 01 √][tag[o1…l-1 set 1: √囫g[01…-1 The word at address a is in the cache if the tag bits in one of the lines in [tag[01…1 set <set indexs match <tag. set s-1 vtag 01.B-The word contents begin at offset <block offset bytes from the beginning of the block
9 Addressing caches Figure 6.25 P488 t bits s bits b bits m-1 0 Address A: 0 1 • • • B–1 0 1 • • • B–1 v v tag tag set 0: • • • 0 1 • • • B–1 0 1 • • • B–1 v v tag tag set 1: • • • 0 1 • • • B–1 0 1 • • • B–1 v v tag tag set S-1: • • • • • • The word at address A is in the cache if the tag bits in one of the lines in set match . The word contents begin at offset bytes from the beginning of the block

Cache Memory Fundamental parameters Parameters Descriptions s=25 Number of sets E Number of lines per set B=2b Block size(bytes) m=log2(M)Number of physical(main memory) address bits
10 Cache Memory Fundamental parameters Parameters Descriptions S = 2s E B=2b m=log2 (M) Number of sets Number of lines per set Block size(bytes) Number of physical(main memory) address bits
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Memory Hierarchy(• Random-Access Memory(RAM)• Nonvolatile Memory • Disk Storage • Locality • Memory hierarchy).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Hardware Organization.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_13 Code Optimization(• Optimizing Blockers • Understanding Modern Processor • More Code Optimization techniques • Performance Tuning).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_12b Code Optimization(• Machine-Independent Optimization – Code motion – Memory optimization • Suggested reading).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Pipelined Implementation Part II.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Pipelined Implementation Part I.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_09、10 Sequential CPU Implementation.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Processor Architecture.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Heterogeneous Data Structures & Alignment; Putting it Together; Floating Point.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Procedure Call and Array.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Machine-Level Representation of Programs Ⅱ.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Machine-Level Representation of Programs I.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Integer Operations; Floating Points.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Integer Representations.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Introduction to Computer Systems; Information is Bits+Context; Information Storage.ppt
- 复旦大学:《计算机原理 Computer System》课程资源_2006年期中考试题目.doc
- 复旦大学:《计算机原理 Computer System》课程资源_2006年期中考试答案.doc
- 复旦大学:《计算机原理 Computer System》课程资源_教学大纲.pdf
- 复旦大学:《计算机图形学》课后习题答案_7.docx
- 复旦大学:《计算机图形学》课后习题答案_6.docx
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Cache Memory(• Cache mountain • Matrix multiplication).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Virtual Memory(• Virtual Space• Address translation • Accelerating translation• Different points of view).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Virtual Memory(• Multilevel page tables • Different points of view • Pentium/Linux Memory System • Memory Mapping).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Dynamic Memory Allocation(• Implementation of a simple allocator • Explicit Free List • Segregated Free List).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Linking II(• Static linking • Symbols & Symbol Table • Relocation • Executable Object Files • Loading).ppt
- 复旦大学:《计算机原理 Computer System》习题PPT课件_chapter2.pptx
- 复旦大学:《计算机原理 Computer System》习题PPT课件_Chapter 3 Machine-Level Representation of Programs.pptx
- 复旦大学:《计算机原理 Computer System》习题PPT课件_Chapter 3 Machine-Level Representation of Programs.pptx
- 复旦大学:《计算机原理 Computer System》习题PPT课件_Chapter 3 Machine-Level(2)Representation of Programs.ppt
- 复旦大学:《计算机原理 Computer System》习题PPT课件_chapter4 Processor Architecture.pptx
- 复旦大学:《计算机原理 Computer System》习题PPT课件_chapter5 Optimizing Program Performance.pptx
- 复旦大学:《计算机原理 Computer System》习题PPT课件_chapter6 The Memory Hierarchy.ppt
- 复旦大学:《计算机网络与网页制作》课程教学大纲 Computer Network and Webpage Design.pdf
- 《当代教育理论与实践》论文:大学计算机基础教学实践与思考(复旦大学:肖川、张向东).pdf
- 复旦大学:《计算机网络与网页制作》课程PPT教学课件(讲稿)01 计算机网络基础.pptx
- 复旦大学:《计算机网络与网页制作》课程PPT教学课件(讲稿)02 两类基本网络(局域网、无线局域网).pptx
- 复旦大学:《计算机网络与网页制作》课程PPT教学课件(讲稿)03 因特网基础知识.pptx
- 复旦大学:《计算机网络与网页制作》课程PPT教学课件(讲稿)04 传统的Internet服务.pptx
- 复旦大学:《计算机网络与网页制作》课程PPT教学课件(讲稿)05 新型的Internet应用.pptx
- 复旦大学:《计算机网络与网页制作》课程PPT教学课件(讲稿)06 Internet安全.pptx