From 9b3c6c50afd73593508f59b83ea3ec5d23906736 Mon Sep 17 00:00:00 2001 From: Martin Meloun Date: Thu, 19 Sep 2013 21:17:48 +0200 Subject: [PATCH] When branching, do not execute the instruction behind the branch Note: To effectively use this feature, gcc requires patching --- hw/core_ctrl.vhd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/core_ctrl.vhd b/hw/core_ctrl.vhd index da5752b..5e9d5a4 100644 --- a/hw/core_ctrl.vhd +++ b/hw/core_ctrl.vhd @@ -257,7 +257,11 @@ regd_proc: lp_rst_ID2EX_REG; ELSIF (clken_pipe_s = '1') THEN setup_int_r <= '0'; - ID2EX_REG_r <= ID2EX_REG_i; + if (EX2IF_REG_i.take_branch = '1') THEN + lp_rst_ID2EX_REG; + ELSE + ID2EX_REG_r <= ID2EX_REG_i; + END IF; delayBit_r <= ID2CTRL_i.delayBit; END IF; -- exeq-to-mem unit registers -- 2.39.2