iT邦幫忙

2026 iThome 鐵人賽

DAY 9
0
Software Development

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

In Order CPU Pipeline Flow

  • 分享至 

  • xImage
  •  

透過 waveform 觀察每個 cyele 的行為
我們可以把實際走過的 pipeline 重建回來:
IF, FIFO, ID, DISP, ISSU, ALU/MUL/DIV, WB, COMP, RETIRE

在這邊 CPU 的設計不單純是一個 in order CPU
而是為了擴展多加了一些 stage
從 waveform 我們就可以看出來每個 stage 的變化
例如 register update 就是在 RETIRE 的同一個 cycle 發生的

下面是 ADD 指令走過每一級的 waveform:
from mem to dispatch:
https://ithelp.ithome.com.tw/upload/images/20260923/20140342IEqUYcFOw5.png

from issue to complete
https://ithelp.ithome.com.tw/upload/images/20260923/20140342HptjA7DnEu.png

from alu to retire:
https://ithelp.ithome.com.tw/upload/images/20260923/20140342Pw3h8bRI26.png

題外話:
觀察 waveform 的時候可以發現每個 output 都在一開始就完成了
像 Verilator 這種 RTL simulation 工具,主要是在看每個 cycle 的行為
不會包含 FPGA 或 ASIC 實際的 cell delay、routing delay、clock skew 這些 physical timing 模擬
我們在 simulatin 下看到的 waveform 都是理想狀態下的結果
換句話來說,有些 setup/hold 或 CDC 相關的問題在 RTL simulation 裡可能會看不到


上一篇
In Order CPU 的接縫(seam)
下一篇
In Order CPU Model Implementation in SystemC
系列文
猴子都寫得出來的 RISC-V OoO CPU 共 17 篇
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言