diff --git a/lib/CPUs/MIPS/src/core/mips_cop.vhd b/lib/CPUs/MIPS/src/core/mips_cop.vhd index d37de20..d1c5e66 100644 --- a/lib/CPUs/MIPS/src/core/mips_cop.vhd +++ b/lib/CPUs/MIPS/src/core/mips_cop.vhd @@ -82,12 +82,12 @@ architecture Behavioral of cop is signal cop_pipe_ID : cop_pipe_t; signal cop_pipe_EX : cop_pipe_t; - function eval_int(ip, im : unsigned) return STD_LOGIC is + function eval_int(ip : unsigned) return STD_LOGIC is variable result : STD_LOGIC; begin result := '0'; for i in ip'range loop - result := result or (ip(i) and im(i)); + result := result or ip(i); end loop; return result; @@ -128,7 +128,7 @@ begin eflags.Sys <= events.syscall; eflags.Bp <= events.break; eflags.RI <= events.illegal; - eflags.Int <= eval_int(ip, im) and status(0); + eflags.Int <= eval_int(ip) and status(0); exception <= eflags.Ov or eflags.Sys or eflags.Bp or eflags.RI or eflags.IAdEL or eflags.IAdEK or eflags.DAdEL or eflags.DAdES or eflags.Int after 1 ns; @@ -280,9 +280,9 @@ cop_ip_reg_write: if rst = '1' then ip(1 downto 0) <= (others => '0'); elsif ip_reg_we = '1' then - ip(1 downto 0) <= cop_pipe_EX.din(9 downto 8); + ip(1 downto 0) <= cop_pipe_EX.din(9 downto 8) and im(1 downto 0); end if; - ip(7 downto 2) <= events.Int; + ip(7 downto 2) <= events.Int and im(7 downto 2); end if; end process;