diff --git a/src/main/scala/vexriscv/plugin/FpuPlugin.scala b/src/main/scala/vexriscv/plugin/FpuPlugin.scala index 8ea478e..6989753 100644 --- a/src/main/scala/vexriscv/plugin/FpuPlugin.scala +++ b/src/main/scala/vexriscv/plugin/FpuPlugin.scala @@ -229,13 +229,15 @@ class FpuPlugin(externalFpu : Boolean = false, service.r(CSR.SSTATUS, 31, sd) service.r(CSR.MSTATUS, 31, sd) - when(fs === 0) { - for (csr <- List(CSR.FRM, CSR.FCSR, CSR.FFLAGS)) { - service.during(csr) { - service.forceFailCsr() - } + val accessFpuCsr = False + for (csr <- List(CSR.FRM, CSR.FCSR, CSR.FFLAGS)) { + service.during(csr) { + accessFpuCsr := True } } + when(accessFpuCsr && fs === 0) { + service.forceFailCsr() + } } decode plug new Area{