1. 1、本文档共35页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
第12讲Cache

* * 计算机组成原理 Principles of Computer Organization 广义双语教学课程 09/skyclass25/ 青岛理工大学 校级精品课程 /ec/C84/ 第 4 章 存 储 器 (4) Chapter 4 Storage A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations. As long as most memory accesses are cached memory locations, the average latency of memory accesses will be closer to the cache latency than to the latency of main memory. Cache-主存层次工作原理 Cache 是位于CPU与主存之间的一个高速小容量的存储器。 Cache一般采用和CPU相同的半导体工艺制成,在物理位置上尽量靠近CPU,而不在主存模块中,最好在处理器芯片内。 其速度与CPU的速度相匹配,即能够在一个最短的存储周期内完成一次读/写,约比主存速度高数倍~数十倍以上。 §4.3 高速缓冲存储器 (Cache) Cache的管理全部用硬件实现。 Once the data is stored in the cache, future use can be made by accessing the cached copy rather than re-fetching the original data, so that the average access time is shorter. Small memories on or close to the CPU chip can be made faster than the much larger main memory. Most CPUs since the 1980s have used one or more caches. Cache和主存都分成若干块(Block,Line,Slot),每块有若干字(Word)或字节组成。 (一)Cache-主存层次的基本结构 装入 Cache 直接通路 1个字 Cache地址 主存地址 块 号 块内地址 主存- Cache 地址映射变换机构 块 号 块内地址 Cache 主存 Cache 替换策略 Address Mapping From Processor 地址总线 数据总线 To Processor Miss Hit 1行 已装不进 This is accomplished by comparing the address of the memory location to all tags in the cache that might contain that address. If the processor finds that the memory location is in the cache, we say that a cache hit has occurred; When the processor needs to read or write a location in main memory, it first checks whether that memory location is in the cache. 装入 Cache 直接通路 1个字 Cache地址 主存地址 块 号 块内地址 主存- Cache 地址映射变换机构 块 号 块内地址 Cache 主存 Cache 替换策略 Address Mapping From Processor 地址总线 数据总线 To Processor Miss Hit 1行 已装不进 otherwise, we speak of a cache miss. 如果在Cache中,称为命中Hit,则访问Cache。 如果不在Cache中,称为不命中Miss(块失效),则访问主存。同时,将包含该字的块装入Cache。 若Cache已满,则按照某种替换策略把该行替换进Cache。

文档评论(0)

liudao + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档