From e78c0546a0aaf61cbf6183b1a2f92def219c4323 Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Tue, 4 May 2021 21:09:42 +0200 Subject: [PATCH] fix #178 --- src/main/scala/vexriscv/plugin/CsrPlugin.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/vexriscv/plugin/CsrPlugin.scala b/src/main/scala/vexriscv/plugin/CsrPlugin.scala index 71f3c8a..c2d795c 100644 --- a/src/main/scala/vexriscv/plugin/CsrPlugin.scala +++ b/src/main/scala/vexriscv/plugin/CsrPlugin.scala @@ -956,9 +956,9 @@ class CsrPlugin(val config: CsrPluginConfig) extends Plugin[VexRiscv] with Excep targetPrivilege := exceptionPortCtrl.exceptionTargetPrivilege } - val trapCause = CombInit(interrupt.code) + val trapCause = CombInit(interrupt.code.resize(trapCodeWidth)) if(exceptionPortCtrl != null) when( hadException){ - trapCause := exceptionPortCtrl.exceptionContext.code + trapCause := exceptionPortCtrl.exceptionContext.code.resized } val xtvec = Xtvec().assignDontCare()