CSR: SSTATUS=MSTATUS

This commit is contained in:
vhaudiquet 2023-10-24 00:22:33 +02:00
parent 2d33e50074
commit 6330104873

View File

@ -7,7 +7,8 @@ uint32_t csr_read(struct RV32_CPU* cpu, uint32_t csr)
{
case CSR_CYCLE:
return cpu->sim_ticks_done;
break;
case CSR_SSTATUS:
return csr_read(cpu, CSR_MSTATUS);
default:
break;
}
@ -17,5 +18,13 @@ uint32_t csr_read(struct RV32_CPU* cpu, uint32_t csr)
void csr_write(struct RV32_CPU* cpu, uint32_t csr, uint32_t value)
{
switch(csr)
{
case CSR_SSTATUS:
csr_write(cpu, CSR_MSTATUS, value);
return;
default:
break;
}
cpu->csr[csr] = value;
}