From 4209dc27929da0c55f9e8dcdae2ca27269c0745a Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Wed, 28 Oct 2020 12:57:20 +0100 Subject: [PATCH] Fix CsrPlugin privilege crossing --- src/main/scala/vexriscv/plugin/CsrPlugin.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/scala/vexriscv/plugin/CsrPlugin.scala b/src/main/scala/vexriscv/plugin/CsrPlugin.scala index 668f1b7..0cb6a79 100644 --- a/src/main/scala/vexriscv/plugin/CsrPlugin.scala +++ b/src/main/scala/vexriscv/plugin/CsrPlugin.scala @@ -1136,7 +1136,11 @@ class CsrPlugin(val config: CsrPluginConfig) extends Plugin[VexRiscv] with Excep } } - illegalAccess setWhen(privilege < csrAddress(9 downto 8).asUInt) + when(privilege < csrAddress(9 downto 8).asUInt){ + illegalAccess := True + readInstruction := False + writeInstruction := False + } illegalAccess clearWhen(!arbitration.isValid || !input(IS_CSR)) } }