Fix WFI. Not sensitive anymore to global interrupt enables, delegation and privilege
This commit is contained in:
parent
64e8919e89
commit
56f7c27d18
|
@ -879,9 +879,10 @@ class CsrPlugin(val config: CsrPluginConfig) extends Plugin[VexRiscv] with Excep
|
||||||
import execute._
|
import execute._
|
||||||
//Manage WFI instructions
|
//Manage WFI instructions
|
||||||
val inWfi = False.addTag(Verilator.public)
|
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){
|
if(wfiGenAsWait) when(arbitration.isValid && input(ENV_CTRL) === EnvCtrlEnum.WFI){
|
||||||
inWfi := True
|
inWfi := True
|
||||||
when(!interrupt){
|
when(!wfiWake){
|
||||||
arbitration.haltItself := True
|
arbitration.haltItself := True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue