Skip to content

Commit

Permalink
Fixed error with branch instructions where REGA was set.
Browse files Browse the repository at this point in the history
  • Loading branch information
isuru-c-p committed Apr 23, 2012
1 parent 8e32110 commit f9b7ef0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rtl/vhdl/dcpu16_control_unit.vhd
Expand Up @@ -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;
Expand Down

0 comments on commit f9b7ef0

Please sign in to comment.