[Bug Report] Incorrect *tval for ecall/ebreak #898
Labels
Component:RTL
For issues in the RTL (e.g. for files in the rtl directory)
Status:In Progress
Work on this issue has started, but is not complete.
Type:Bug
For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Our co-simulation framework found that the
*tvalofecall/ebreakis incorrect.In cva6, after
ecall/ebreak, *tval will set to the machine code of theecall/ebreakinstruction.In the following test case, after calling
ebreakin s-mode, the value ofmtvalregister is written to0x100073, which is the machine code ofebreakinstruction.riscv-priviledged P41 :If
mtvalis written with a nonzero value when a breakpoint, address-misaligned, access-fault, or page-fault exception occurs on an instruction fetch, load, or store, then mtval will contain the faulting virtual address.According to specifications,
mtvalshould be the faulting address (or zero).Issue 448 tests the value in
stvalofecallfrom user mode, our verification framework further discovered thatebreakalso has the same bug, and both of them could be triggered under any privilege modes.ebreak testcase: cva6-1.zip
ecall testcase: cva6-2.zip
The text was updated successfully, but these errors were encountered: