From 1dff9aff8a31f7f8cbdb25236464044eb656329c Mon Sep 17 00:00:00 2001 From: Charles Papon Date: Mon, 1 Apr 2019 10:47:54 +0200 Subject: [PATCH] #60 Fix interrupt causing fetch privilege issues --- src/main/scala/vexriscv/plugin/CsrPlugin.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/scala/vexriscv/plugin/CsrPlugin.scala b/src/main/scala/vexriscv/plugin/CsrPlugin.scala index b904f6b..a7eb19e 100644 --- a/src/main/scala/vexriscv/plugin/CsrPlugin.scala +++ b/src/main/scala/vexriscv/plugin/CsrPlugin.scala @@ -767,6 +767,8 @@ class CsrPlugin(config: CsrPluginConfig) extends Plugin[VexRiscv] with Exception } when(hadException || interruptJump){ + fetcher.haltIt() //Avoid having the fetch confused by the incomming privilege switch + jumpInterface.valid := True jumpInterface.payload := (if(!xtvecModeGen) xtvec.base @@ "00" else (xtvec.mode === 0 || hadException) ? (xtvec.base @@ "00") | ((xtvec.base + trapCause) @@ "00") ) beforeLastStage.arbitration.flushAll := True @@ -800,10 +802,6 @@ class CsrPlugin(config: CsrPluginConfig) extends Plugin[VexRiscv] with Exception } } - //Avoid having the fetch confused by the incomming privilege switch - when(hadException){ - fetcher.haltIt() - } lastStage plug new Area{ import lastStage._