From 39b2803914c0677ff2ebdc32ba3bf8f00111f4df Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Wed, 20 Mar 2019 20:27:47 +0100 Subject: [PATCH] Fix some CsrPlugin flags issues --- src/main/scala/vexriscv/plugin/CsrPlugin.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/vexriscv/plugin/CsrPlugin.scala b/src/main/scala/vexriscv/plugin/CsrPlugin.scala index 285360f..ac60675 100644 --- a/src/main/scala/vexriscv/plugin/CsrPlugin.scala +++ b/src/main/scala/vexriscv/plugin/CsrPlugin.scala @@ -803,12 +803,14 @@ class CsrPlugin(config: CsrPluginConfig) extends Plugin[VexRiscv] with Exception is(3){ mstatus.MPP := U"00" mstatus.MIE := mstatus.MPIE + mstatus.MPIE := True privilege := mstatus.MPP jumpInterface.payload := mepc } if(supervisorGen) is(1){ sstatus.SPP := U"0" sstatus.SIE := sstatus.SPIE + sstatus.SPIE := True privilege := U"0" @@ sstatus.SPP jumpInterface.payload := sepc } @@ -864,7 +866,7 @@ class CsrPlugin(config: CsrPluginConfig) extends Plugin[VexRiscv] with Exception //Manage MRET / SRET instructions when(arbitration.isValid && input(ENV_CTRL) === EnvCtrlEnum.XRET) { //TODO check MPP value too - when(input(INSTRUCTION)(29 downto 28).asUInt =/= privilege) { + when(input(INSTRUCTION)(29 downto 28).asUInt > privilege) { illegalInstruction := True } }