Simplify fetch1
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 24 Sep 2019 02:17:42 +0000 (12:17 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 30 Sep 2019 01:34:33 +0000 (11:34 +1000)
Do the +4 in a single place. This shouldn't cause any difference
in behaviour as these are sequential variable assignments.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
fetch1.vhdl

index 29ff71f2ca652a2fde11d3337a19f2042659d48b..643e8c88a8fc35d6ad9de9cd73cf3c11ad132331 100644 (file)
@@ -49,19 +49,18 @@ begin
 
        if stall_in = '0' then
            v.nia := r_int.nia_next;
-           v_int.nia_next := std_logic_vector(unsigned(r_int.nia_next) + 4);
        end if;
 
        if e_in.redirect = '1' then
            v.nia := e_in.redirect_nia;
-           v_int.nia_next := std_logic_vector(unsigned(e_in.redirect_nia) + 4);
        end if;
 
        if rst = '1' then
            v.nia := RESET_ADDRESS;
-           v_int.nia_next := std_logic_vector(unsigned(RESET_ADDRESS) + 4);
        end if;
 
+       v_int.nia_next := std_logic_vector(unsigned(v.nia) + 4);
+
        -- Update registers
        rin <= v;
        rin_int <= v_int;