天天看點

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隊列已滿,等等。

MSHR(Miss Status Handling Register)

  在上面的微架構模型中,當系統有訪存請求的時候,在①處的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)。

繼續閱讀