rongcuid / riscv-megaproject

A series of (practise) projects of RISC-V cores. All cores will support at least the I instruction set. Expect bugs/limitations for earlier ones
BSD 3-Clause "New" or "Revised" License
30 stars 2 forks source link

Known Issue: mret returns to MEPC+4 #2

Closed rongcuid closed 5 years ago

rongcuid commented 6 years ago

In current implementation, mret jumps back to mepc+4. This is incorrect behavior: mret should jump back to mpec instead. The addition should be performed by exception handler.

This can be fixed by changing PC_UPDATE, though I am unlikely to do that anytime soon.

rongcuid commented 5 years ago

Solved in new implementation.