iT邦幫忙

2026 iThome 鐵人賽

DAY 21
0
Software Development

猴子都寫得出來的 RISC-V OoO CPU系列 第 21 篇

Out of Order CPU Renaming Breakdown

  • 分享至 

  • xImage
  •  

在這個 Out of Order CPU 設計中
rename 是發生在 dispatch 階段
同時會 allocate 一個專屬這道指令的流水號
就是我們之前看過的的 tag
如果真的在 pipeline 發生問題就可以從這個 tag 回推到底發生什麼事
(順帶一提,ld/st pipeline 通常是用 address 來找,雖然這邊沒有

之前提過 rename 的做法是分成抽象的 architectural register 和 physical register
rename 簡單來說是指定一個空的 physical register 給 rd
在這個實作中有 phy 有 x0~x63,總共 64 個 physical register
每次 reset 時會把 arch x0~x31 照順序指到 phy 0x~031
剩下的就是空的可以使用的位置
(這段講得比較簡單,實際上要有多少 physical register 要特別設計)

pipeline 大概會長下面這樣子
大家可以看到 ROB 實際上跨了很多 pipeline stage
所以界線比較模糊,有些團隊會拆出來叫 middle end
https://ithelp.ithome.com.tw/upload/images/20261005/20140342ovK6ohrGSC.png

我們也可以從 waveform 看到 tag 和 rename 的過程
(candidate_map -> speculative_map -> commiteted_map,但是因為太長了沒有包到這張圖裡)
https://ithelp.ithome.com.tw/upload/images/20261005/201403424E5oF7UTja.png

順帶一提,這邊還會有 redirect 的需求,要做 rename map recovery
只是因為 branch 都還沒做所以目前沒有


上一篇
Out of Order CPU Rename
下一篇
Branch Instruction Implementation
系列文
猴子都寫得出來的 RISC-V OoO CPU 共 22 篇
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言