Permalink
Browse files

Fixed error with branch instructions where REGA was set.

  • Loading branch information...
1 parent 8e32110 commit f9b7ef08dde338b3c58b85650b31b60218cd2f27 @isuru-c-p committed Apr 23, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 rtl/vhdl/dcpu16_control_unit.vhd
@@ -462,8 +462,13 @@ begin
pc_in_sel <= PC_IN_PC;
alu_start <= '0';
- sp_in_sel <= SP_IN_SP;
- rega_write <= rega_write_ex;
+ sp_in_sel <= SP_IN_SP;
+
+ if branch_instr = '0' then
+ rega_write <= rega_write_ex;
+ else
+ rega_write <= '0';
+ end if;
if mem_operand(0) = '1' and branch_instr = '0' then
mem_sel_wr <= MEM_SEL_ADDRESS_A;

0 comments on commit f9b7ef0

Please sign in to comment.