Fpu now set csr status fs on FPU csr write

This commit is contained in:
Dolu1990 2022-10-06 11:13:57 +02:00
parent fda7da00c2
commit 959e48a353
2 changed files with 6 additions and 3 deletions

View File

@ -219,6 +219,9 @@ class FpuPlugin(externalFpu : Boolean = false,
when(stages.last.arbitration.isFiring && stages.last.input(FPU_ENABLE) && stages.last.input(FPU_OPCODE) =/= FpuOpcode.STORE){
fs := 3 //DIRTY
}
when(List(CSR.FRM, CSR.FCSR, CSR.FFLAGS).map(id => service.isWriting(id)).orR){
fs := 3
}
service.rw(CSR.SSTATUS, 13, fs)
service.rw(CSR.MSTATUS, 13, fs)

View File

@ -668,9 +668,9 @@ public:
case SATP: satp.raw = value; break;
#ifdef RVF
case FCSR: fcsr.raw = value & 0x7F; break;
case FRM: fcsr.frm = value; break;
case FFLAGS: fcsr.flags = value; break;
case FCSR: fcsr.raw = value & 0x7F; status.fs = 3; break;
case FRM: fcsr.frm = value; status.fs = 3; break;
case FFLAGS: fcsr.flags = value; status.fs = 3; break;
#endif
default: ilegalInstruction(); return true; break;