MSHR(Miss Status Handling Register)

reference:
※https://baike.baidu.com/item/MSHR/5968221?fr=aladdin
※https://blog.csdn.net/dark5669/article/details/53895775
※Li C, Song S L, Dai H, et al. Locality-Driven Dynamic GPU Cache Bypassing[J]. 2015.
※超标量处理器设计,姚永斌,p314,要支持非阻塞cache,在处理器中就需要将那些已经产生D-Cache缺失的load/store指令信息保存起来,这个部件称为MSHR
※GPU体系结构-the miss status holding register(MSHR)原理简介

  MSHR是一个计算机体系结构用语,Miss-status Handling Registers 的缩写,用来记录每一项未完成的事务,记录的信息包括失效地址、关键字信息以及重命名寄存器信息。
  一旦存储控制器返回失效访存所需要的数据,这些信息就用于重新执行。MSHR还用于合并对同一行的多个请求,防止将同一个请求发送多次。

Miss Status Handling Registers
缺失状态保持寄存器
作用:
keep track of outstanding misses
就是保存 misses 状态的轨迹信息的一个表

  Each MSHR contains enough state to handle one or more accesses of any type to single memory line。
每个MSHR包含足够的状态来处理对单个内存行的任何类型的一次或多次访问。
  A memory request that misses in the cache is added to the MSHR table and a fill request is generated if there is no pending request for that cache line.
一个在缓存中未命中的内存请求被添加到MSHR表中,如果该缓存行没有挂起的请求,则生成一个填充请求。
  When a fill response to the fill request is received at the cache, the cache line is inserted into the cache and the corresponding MSHR entry is marked as filled.
当缓存接收到对填充请求的填充响应时,缓存线被插入到缓存中,相应的MSHR条目被标记为填充。
  Responses for filled MSHR entries are generated at one request per cycle.
Once all the requests waiting at the filled MSHR entry have been responded to and serviced, the MSHR entry is freed.
每个周期在一个请求时生成对已填满的MSHR条目的响应。
一旦所有等待填充的MSHR条目的请求都得到响应和服务,MSHR条目就会被释放。
MSHR的作用:
  On a cache hit, a request will be served by sending data to the register file immediately. On a cache miss, the miss handling logic will first check the miss status holding register (MSHR) to see if the same request is currently pending from prior ones. If so, this request will be merged into the same entry and no new data request needs to be issued. Otherwise, a new MSHR entry and cache line will be reserved for this data request. A cache status handler may fail on resource unavailability events such as when there are no free MSHR entries, all cache blocks in that set have been reserved but still haven’t been filled, the miss queue is full, etc.
在缓存命中时,请求将通过立即向寄存器文件发送数据来处理。在缓存未命中时,未命中处理逻辑将首先检查未命中状态保持寄存器(MSHR),以查看与先前请求当前是否挂起相同的请求。如果是,这个请求将被合并到同一个条目中,并且不需要发出新的数据请求。否则,将为这个数据请求保留一个新的MSHR条目和缓存线。缓存状态处理程序可能会在资源不可用时失败,比如没有空闲的MSHR条目,该集合中的所有缓存块都被保留了但仍然没有被填满,miss队列已满,等等。
在这里插入图片描述

  在上面的微架构模型中,当系统有访存请求的时候,在①处的access type选择语句,有两条路径:bypass是绕过cache,这儿不考虑。我们关注的是L1-D-Path的路径,通过匹配tag,如果cache hit的话,那么就可以直接送往register files。如果cache miss,会先检查MSHR,看是否已经有相同的数据请求已经发出过(只是数据还没有被传回到cache中),如果确实发出过相同的数据请求的话,就将当前请求合并到之前的相同的数据请中。如果MSHR中没有(M)相同请求的话,就传递数据请求到下一级cache。

  当从下一级cache中拿到数据,放到return queue中,数据接下来的流向也有两条路径:如果数据请求是经过cache->MSHR->下一级cache这条路径的,那么需要把数据放到先前预留的cache line中,并且MSHR中对应的entry设置为filled(Fill Path 1);如果数据请求是通过bypass path这条路径的,那么直接把return queue中的数据传给register files(Fill Path 2)。

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值