From: Martin Meloun Date: Thu, 19 Sep 2013 19:17:48 +0000 (+0200) Subject: When branching, do not execute the instruction behind the branch X-Git-Url: http://rtime.felk.cvut.cz/gitweb/fpga/lx-cpu1/tumbl.git/commitdiff_plain/9b3c6c50afd73593508f59b83ea3ec5d23906736 When branching, do not execute the instruction behind the branch Note: To effectively use this feature, gcc requires patching --- 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