diff --git a/lib/CPUs/MIPS/src/core/mips_cop.vhd b/lib/CPUs/MIPS/src/core/mips_cop.vhd index 0f55f73..8517910 100644 --- a/lib/CPUs/MIPS/src/core/mips_cop.vhd +++ b/lib/CPUs/MIPS/src/core/mips_cop.vhd @@ -126,7 +126,6 @@ begin cop_pipe_ID.RFE <= cop_pipe_ID.cs when (cop_pipe_ID.CO = '1' and cop_pipe_ID.func = "010000") else '0'; ctrl_out.EB <= EB_reg xor (status(25) and status(1)); ctrl_out.user_mode <= status(1); - ctrl_out.int <= eval_int(ip) and status(0); cop_pipe_ID.reg_ptr <= cop_pipe_ID.rd when cop_pipe_ID.opc = "010000" else cop_pipe_ID.rt; @@ -328,6 +327,7 @@ cop_cache_op: cop_ip_reg_write: process(clk) + variable ip_v : unsigned(7 downto 0); begin if rising_edge(clk) then if rst = '1' then @@ -337,7 +337,9 @@ cop_ip_reg_write: sw_int <= din(9 downto 8); end if; end if; - ip <= (int & sw_int) and im; + ip_v := (int & sw_int) and im; + ip <= ip_v; + ctrl_out.int <= eval_int(ip_v) and status(0); end if; end process; @@ -465,7 +467,10 @@ cop_status_reg_write: status(3 downto 2) <= status(5 downto 4); elsif ctrl_in.sdu.WB_nop = '0' then if stat_reg_we = '1' then - status <= din; + if status(1) = '0' then + status(7 downto 0) <= din(7 downto 0); + end if; + status(31 downto 8) <= din(31 downto 8); end if; end if; end if;