CSR: sie=mie, sip=mip

This commit is contained in:
vhaudiquet 2023-10-24 00:36:39 +02:00
parent 6330104873
commit d6af840ed1

View File

@ -9,6 +9,10 @@ uint32_t csr_read(struct RV32_CPU* cpu, uint32_t csr)
return cpu->sim_ticks_done;
case CSR_SSTATUS:
return csr_read(cpu, CSR_MSTATUS);
case CSR_SIE:
return csr_read(cpu, CSR_MIE);
case CSR_SIP:
return csr_read(cpu, CSR_MIP);
default:
break;
}
@ -23,6 +27,12 @@ void csr_write(struct RV32_CPU* cpu, uint32_t csr, uint32_t value)
case CSR_SSTATUS:
csr_write(cpu, CSR_MSTATUS, value);
return;
case CSR_SIE:
csr_write(cpu, CSR_MIE, value);
return;
case CSR_SIP:
csr_write(cpu, CSR_MIP, value);
return;
default:
break;
}