From: Paul Mackerras Date: Wed, 6 May 2020 04:15:22 +0000 (+1000) Subject: Merge remote-tracking branch 'remotes/origin/master' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=102b304db74066c0349c698ea644a24dee56aafb;p=microwatt.git Merge remote-tracking branch 'remotes/origin/master' --- 102b304db74066c0349c698ea644a24dee56aafb diff --cc execute1.vhdl index abd4a18,e32285d..1846488 --- a/execute1.vhdl +++ b/execute1.vhdl @@@ -403,9 -372,16 +405,16 @@@ begi ctrl_tmp.dec <= std_ulogic_vector(unsigned(ctrl.dec) - 1); irq_valid := '0'; - if ctrl.msr(MSR_EE) = '1' and ctrl.dec(63) = '1' then - report "IRQ valid"; - irq_valid := '1'; - if ctrl.msr(63 - 48) = '1' then ++ if ctrl.msr(MSR_EE) = '1' then + if ctrl.dec(63) = '1' then + ctrl_tmp.irq_nia <= std_logic_vector(to_unsigned(16#900#, 64)); + report "IRQ valid: DEC"; + irq_valid := '1'; + elsif i_in.irq = '1' then + ctrl_tmp.irq_nia <= std_logic_vector(to_unsigned(16#500#, 64)); + report "IRQ valid: External"; + irq_valid := '1'; + end if; end if; terminate_out <= '0'; @@@ -451,21 -421,12 +460,22 @@@ -- Don't deliver the interrupt until we have a valid instruction -- coming in, so we have a valid NIA to put in SRR0. exception := e_in.valid; - ctrl_tmp.irq_nia <= std_logic_vector(to_unsigned(16#900#, 64)); ctrl_tmp.srr1 <= msr_copy(ctrl.msr); - elsif e_in.valid = '1' then + elsif e_in.valid = '1' and ctrl.msr(MSR_PR) = '1' and + instr_is_privileged(e_in.insn_type, e_in.insn) then + -- generate a program interrupt + exception := '1'; + ctrl_tmp.irq_nia <= std_logic_vector(to_unsigned(16#700#, 64)); + ctrl_tmp.srr1 <= msr_copy(ctrl.msr); + -- set bit 45 to indicate privileged instruction type interrupt + ctrl_tmp.srr1(63 - 45) <= '1'; + report "privileged instruction"; + + elsif e_in.valid = '1' and e_in.unit = ALU then + report "execute nia " & to_hstring(e_in.nia); + v.e.valid := '1'; v.e.write_reg := e_in.write_reg; v.slow_op_dest := gspr_to_gpr(e_in.write_reg); diff --cc tests/update_console_tests index bd012d9,11306bb..94e74d1 --- a/tests/update_console_tests +++ b/tests/update_console_tests @@@ -3,7 -3,7 +3,7 @@@ # Script to update console related tests from source # - for i in sc illegal decrementer privileged ; do -for i in sc illegal decrementer xics ; do ++for i in sc illegal decrementer xics privileged ; do cd $i make cd -