From: Luke Kenneth Casson Leighton Date: Mon, 26 Nov 2018 11:12:54 +0000 (+0000) Subject: whoops missed out branch_taken logic from fetch_action X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b9590fb047497743ba888c12b73617fec767712;p=rv32.git whoops missed out branch_taken logic from fetch_action --- diff --git a/cpu.py b/cpu.py index 7150968..5206b34 100644 --- a/cpu.py +++ b/cpu.py @@ -224,11 +224,15 @@ class Fetch: # branch -> misaligned=error, otherwise jump i = i.Elif((dc.act & DA.branch) != 0, - If(misaligned_jump_target, - self.action.eq(FA.error_trap) - ).Else( - self.action.eq(FA.jump) - ) + If(branch_taken, + If(misaligned_jump_target, + self.action.eq(FA.error_trap) + ).Else( + self.action.eq(FA.jump) + ) + ).Else( + self.action.eq(FA.default) + ) ) # jal/jalr -> misaligned=error, otherwise jump