From 173f5dba9d4ff10ac8d1ece7ecf732919f10ba63 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 25 Jun 2022 20:07:43 +0100 Subject: [PATCH] Fix jump target being unstable during a CIR-locked branch-to-self on a partial predicted branch match, due to the addr_is_regoffs decode not being tied off. --- hdl/hazard3_decode.v | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hdl/hazard3_decode.v b/hdl/hazard3_decode.v index fc08c43..8fe249f 100644 --- a/hdl/hazard3_decode.v +++ b/hdl/hazard3_decode.v @@ -347,16 +347,17 @@ always @ (*) begin else if (d_invalid && !d_starved) d_except = EXCEPT_INSTR_ILLEGAL; end - if (cir_lock_prev) begin - d_branchcond = BCOND_NEVER; - end else if (partial_predicted_branch) begin + if (partial_predicted_branch) begin d_addr_is_regoffs = 1'b0; d_branchcond = BCOND_ALWAYS; end + if (cir_lock_prev) begin + d_branchcond = BCOND_NEVER; + end end endmodule `ifndef YOSYS `default_nettype wire -`endif \ No newline at end of file +`endif