From 56f7c27d18589f10d143e9e615eb4fc06f10376d Mon Sep 17 00:00:00 2001 From: Charles Papon Date: Wed, 5 Jun 2019 00:32:38 +0200 Subject: [PATCH] Fix WFI. Not sensitive anymore to global interrupt enables, delegation and privilege --- src/main/scala/vexriscv/plugin/CsrPlugin.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/vexriscv/plugin/CsrPlugin.scala b/src/main/scala/vexriscv/plugin/CsrPlugin.scala index 467dc76..5f81f6f 100644 --- a/src/main/scala/vexriscv/plugin/CsrPlugin.scala +++ b/src/main/scala/vexriscv/plugin/CsrPlugin.scala @@ -879,9 +879,10 @@ class CsrPlugin(val config: CsrPluginConfig) extends Plugin[VexRiscv] with Excep import execute._ //Manage WFI instructions val inWfi = False.addTag(Verilator.public) + val wfiWake = RegNext(interruptSpecs.map(_.cond).orR) init(False) if(wfiGenAsWait) when(arbitration.isValid && input(ENV_CTRL) === EnvCtrlEnum.WFI){ inWfi := True - when(!interrupt){ + when(!wfiWake){ arbitration.haltItself := True } }