execute1: Ease timing on redirect_nia
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 10 Jul 2020 09:07:47 +0000 (19:07 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 14 Jul 2020 23:45:14 +0000 (09:45 +1000)
This eliminates a dependency of r.f.redirect_nia on the carry out
from the main adder in the case of a conditional trap instruction.
We can set r.f.redirect_nia unconditionally, even if no interrupt
is generated.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
execute1.vhdl

index 3b2007ad6ec4f2c8d2afb982a2462ccf0d21212b..fb760d1231f33829f02a534437639907c5ad4609 100644 (file)
@@ -619,12 +619,12 @@ begin
                         end loop;
                     else
                         -- trap instructions (tw, twi, td, tdi)
+                        v.f.redirect_nia := std_logic_vector(to_unsigned(16#700#, 64));
+                        -- set bit 46 to say trap occurred
+                        ctrl_tmp.srr1(63 - 46) <= '1';
                         if or (trapval and insn_to(e_in.insn)) = '1' then
                             -- generate trap-type program interrupt
                             exception := '1';
-                            v.f.redirect_nia := std_logic_vector(to_unsigned(16#700#, 64));
-                            -- set bit 46 to say trap occurred
-                            ctrl_tmp.srr1(63 - 46) <= '1';
                             report "trap";
                         end if;
                     end if;