Reads and writes to illegal CSRs should raise an Illegal Instruction exception. Since the commit ca2b76e, reads to illegal (or unimplemented) CSRs return 0, and writes do nothing. Before that commit, accesses to illegal CSRs caused a fromJust runtime error in Haskell.
I added the behavior in ca2b76e to get riscv-tests to work for now. If we fix this issue, we will break riscv-tests support until we implement all the CSRs used in those tests (e.g. satp, mideleg, medeleg, etc.).
Reads and writes to illegal CSRs should raise an Illegal Instruction exception. Since the commit ca2b76e, reads to illegal (or unimplemented) CSRs return 0, and writes do nothing. Before that commit, accesses to illegal CSRs caused a fromJust runtime error in Haskell.
I added the behavior in ca2b76e to get riscv-tests to work for now. If we fix this issue, we will break riscv-tests support until we implement all the CSRs used in those tests (e.g. satp, mideleg, medeleg, etc.).