rvcpp: fix handling of CSR instructions which both read and write

This commit is contained in:
Luke Wren 2024-04-27 13:30:34 +01:00
parent a313493371
commit 117c52e7b1
1 changed files with 1 additions and 1 deletions

View File

@ -545,7 +545,7 @@ void RVCore::step(bool trace) {
exception_cause = XCAUSE_INSTR_ILLEGAL;
}
}
else if (write_op == RVCSR::WRITE || regnum_rs1 != 0) {
if (write_op == RVCSR::WRITE || regnum_rs1 != 0) {
if (!csr.write(csr_addr, rs1, write_op)) {
exception_cause = XCAUSE_INSTR_ILLEGAL;
}