Fix fpu csr access on fs===0 now also trap

This commit is contained in:
Dolu1990 2023-02-08 14:44:04 +01:00
parent cbc89093b3
commit 3ae51cdeb8
1 changed files with 7 additions and 5 deletions

View File

@ -229,13 +229,15 @@ class FpuPlugin(externalFpu : Boolean = false,
service.r(CSR.SSTATUS, 31, sd) service.r(CSR.SSTATUS, 31, sd)
service.r(CSR.MSTATUS, 31, sd) service.r(CSR.MSTATUS, 31, sd)
when(fs === 0) { val accessFpuCsr = False
for (csr <- List(CSR.FRM, CSR.FCSR, CSR.FFLAGS)) { for (csr <- List(CSR.FRM, CSR.FCSR, CSR.FFLAGS)) {
service.during(csr) { service.during(csr) {
service.forceFailCsr() accessFpuCsr := True
}
} }
} }
when(accessFpuCsr && fs === 0) {
service.forceFailCsr()
}
} }
decode plug new Area{ decode plug new Area{