From 21ec368927b8ccf81d5ddd2a2aa9a1d9dae6ad9c Mon Sep 17 00:00:00 2001 From: Charles Papon Date: Tue, 11 Jun 2019 19:56:33 +0200 Subject: [PATCH] Fix DYNAMIC_TARGET by fixing decode PC updates --- src/main/scala/vexriscv/plugin/BranchPlugin.scala | 2 +- src/main/scala/vexriscv/plugin/Fetcher.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/vexriscv/plugin/BranchPlugin.scala b/src/main/scala/vexriscv/plugin/BranchPlugin.scala index cf740ca..281063b 100644 --- a/src/main/scala/vexriscv/plugin/BranchPlugin.scala +++ b/src/main/scala/vexriscv/plugin/BranchPlugin.scala @@ -345,7 +345,7 @@ class BranchPlugin(earlyBranch : Boolean, val branchAdder = branch_src1 + branch_src2 insert(BRANCH_CALC) := branchAdder(31 downto 1) @@ "0" insert(NEXT_PC) := input(PC) + (if(pipeline(RVC_GEN)) ((input(IS_RVC)) ? U(2) | U(4)) else 4) - insert(TARGET_MISSMATCH) := input(PC) =/= input(BRANCH_CALC) + insert(TARGET_MISSMATCH) := decode.input(PC) =/= input(BRANCH_CALC) } //Apply branchs (JAL,JALR, Bxx) diff --git a/src/main/scala/vexriscv/plugin/Fetcher.scala b/src/main/scala/vexriscv/plugin/Fetcher.scala index 26e91c1..a7ab268 100644 --- a/src/main/scala/vexriscv/plugin/Fetcher.scala +++ b/src/main/scala/vexriscv/plugin/Fetcher.scala @@ -185,7 +185,7 @@ abstract class IBusFetcherImpl(val resetVector : BigInt, } //application of the selected jump request - when(jump.pcLoad.valid && (!decode.arbitration.isValid || !decode.arbitration.isStuck || decode.arbitration.isRemoved)) { + when(jump.pcLoad.valid && (!decode.arbitration.isStuck || decode.arbitration.isRemoved)) { pcReg := jump.pcLoad.payload } })