iT邦幫忙

2026 iThome 鐵人賽

DAY 26
0

這次就是實作 Exception
但是在 support 的同時也從 RV32IM 擴展成 RV32IM_zicsr 了
因為需要有一些 register 來提供相對應的控制
總共新增 CSRRW, CSRRS, CSRRC 和對應的 immediate 版本
還有 I 指令集裡的 ECALL 、 EBREAK
以及為了能讓 interrupt handler 運作的 MRET

還有對應的 CSR:

  • mstatus: 0x300
  • misa: 0x301
  • mie: 0x304
  • mtvec: 0x305
  • mscratch: 0x340
  • mepc: 0x341
  • mcause: 0x342
  • mtval: 0x343
  • mip: 0x344
  • mhartid: 0xF14

git link with tag: https://github.com/hsufit/TINY5_OOO/tree/ithome2026_D27


上一篇
Out of Order + Rename Recovery CPU 的大勝利
下一篇
嵌入式系統三大不可思議: Interrupt, Exception, Trap
系列文
猴子都寫得出來的 RISC-V OoO CPU 共 28 篇
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言