diff --git a/lib/CPUs/MIPS/src/core/mips_cop.vhd b/lib/CPUs/MIPS/src/core/mips_cop.vhd index 7ccaff5..0f55f73 100644 --- a/lib/CPUs/MIPS/src/core/mips_cop.vhd +++ b/lib/CPUs/MIPS/src/core/mips_cop.vhd @@ -68,6 +68,7 @@ architecture Behavioral of cop is signal code_reg_we : STD_LOGIC; signal ip_reg_we : STD_LOGIC; signal bd : STD_LOGIC; + signal sw_int : unsigned(1 downto 0); signal ip : unsigned(7 downto 0); signal im : unsigned(7 downto 0); signal status_save : STD_LOGIC; @@ -330,13 +331,13 @@ cop_ip_reg_write: begin if rising_edge(clk) then if rst = '1' then - ip(1 downto 0) <= (others => '0'); + sw_int <= (others => '0'); elsif ctrl_in.sdu.WB_nop = '0' then if ip_reg_we = '1' then - ip(1 downto 0) <= din(9 downto 8) and im(1 downto 0); + sw_int <= din(9 downto 8); end if; end if; - ip(7 downto 2) <= int and im(7 downto 2); + ip <= (int & sw_int) and im; end if; end process; @@ -420,9 +421,9 @@ cop_we_gen: case cop_pipe_EX.reg_ptr is when "01100" => - stat_reg_we <= not status(1) or status(28); + stat_reg_we <= '1'; -- not status(1) or status(28); when "01101" => - ip_reg_we <= not status(1) or status(28); + ip_reg_we <= '1'; -- not status(1) or status(28); when "11111" => test_reg_we <= '1'; -- not status(1) or status(28); when others => null; @@ -464,7 +465,7 @@ 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; + status <= din; end if; end if; end if;