MSHR(Miss Status and Handling Register)

来源:互联网 发布:正弦波用stm32怎么编程 编辑:程序博客网 时间:2024/06/09 18:48

MSHR(Miss Status and Handling Register)


    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.

翻译过来就是说,在一次cache hit中,数据很快就会从L1数据缓存中发送到寄存器中。但在一次cache miss中,miss handling logic都会首先检查MSHR中是否有相同的请求。如果有,这个请求就会被舍弃,没有新的数据请求加入。如果没有,则会将这个请求加入到MSHR中,将这个请求放入miss队列中,排队向下一层缓存发送数据请求。如果MSHR没有多余的entries,或者请求数据应该存放的缓存块全部处于reserved状态,再或者miss队列满了,那么返回“资源不可获取”事件。

自己的理解:对于有multi-layer的cache,CPU对L1发出数据请求,如果cache hit,则将数据送入CPU。如果L1中没有数据(发生了cache miss),将数据请求加入到MSHR中,排队向下一级cache进行请求数据。如果下一级cache将数据发送回来了,则MSHR就会将队列中对应的请求删除。如果MSHR没有多余的entires,或者请求数据应该存放的缓存块全部处于reserved状态,或者miss队列满了,那么只能返回“资源不可获取”事件。

总结:MSHR可以看作一个有一定大小的队列,先入先出,用来存放数据请求miss的事件,当数据请求返回时,删除队列中的请求。

1 0