Line 78... |
Line 78... |
|
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
-- Pipeline stage 0
|
-- Pipeline stage 0
|
|
|
signal p0_pc_reg : t_pc;
|
signal p0_pc_reg : t_pc;
|
|
signal p0_pc_restart : t_pc;
|
signal p0_pc_incremented : t_pc;
|
signal p0_pc_incremented : t_pc;
|
signal p0_pc_jump : t_pc;
|
signal p0_pc_jump : t_pc;
|
signal p0_pc_branch : t_pc;
|
signal p0_pc_branch : t_pc;
|
signal p0_pc_target : t_pc;
|
signal p0_pc_target : t_pc;
|
signal p0_pc_next : t_pc;
|
signal p0_pc_next : t_pc;
|
Line 392... |
Line 393... |
-- reset to 0xffffffff so that 1st fetch addr is 0x00000000
|
-- reset to 0xffffffff so that 1st fetch addr is 0x00000000
|
p0_pc_reg <= (others => '1');
|
p0_pc_reg <= (others => '1');
|
else
|
else
|
-- p0_pc_reg holds the same value as external sync ram addr register
|
-- p0_pc_reg holds the same value as external sync ram addr register
|
p0_pc_reg <= p0_pc_next;
|
p0_pc_reg <= p0_pc_next;
|
|
-- p0_pc_restart = addr saved to EPC on interrupts (@note2)
|
|
-- It's the addr of the instruction triggering the exception
|
|
-- FIXME handle delay slot case
|
|
if (p1_jump_type="00" or p0_jump_cond_value='0') then
|
|
p0_pc_restart <= p0_pc_reg;
|
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process pc_register;
|
end process pc_register;
|
|
|
-- p0_pc_reg holds the same addr as the addr register of the external synchronous
|
-- p0_pc_reg holds the same addr as the addr register of the external synchronous
|
Line 779... |
Line 786... |
if p1_set_cp0='1' then
|
if p1_set_cp0='1' then
|
-- FIXME check for CP0 reg index
|
-- FIXME check for CP0 reg index
|
cp0_status <= p1_rs(cp0_status'high downto 0);
|
cp0_status <= p1_rs(cp0_status'high downto 0);
|
end if;
|
end if;
|
if p1_exception='1' then
|
if p1_exception='1' then
|
cp0_epc <= p0_pc_reg;
|
cp0_epc <= p0_pc_restart;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process;
|
end process;
|
|
|