--
-- Component : hazard_unit
--
-- Generated by System Architect version v8.5_2.2 by ja-wells on Mar 20, 97

-- Controls branch squashing 

ARCHITECTURE spec OF hazard_unit IS
BEGIN
   -------------------------------------------------------------------
   vhdl_hazard_unit : PROCESS (Op, Func, Eq)
   -------------------------------------------------------------------
	variable R_Flush  : std_logic;
	variable R_PCmode : mips_mux_2;
   BEGIN
	R_PCmode := "00";
	if (Op = oJ  OR Op = oJAL) then
		R_PCmode := "01";
	elsif (Op = oBEQ AND Eq = '1') then
		R_PCmode := "10";
	elsif (Op = oBNE AND Eq = '0') then
		R_PCmode := "10";
	elsif (Op = rType AND Func = cJR) then
		R_PCmode := "11";
	end if;
		
	R_Flush := '0';
	if (R_PCmode /= "00") then
		R_Flush := '1';
	end if;

	PCmode <= R_PCmode after 2 ns;
	Flush <= R_Flush after 2 ns;

   END PROCESS vhdl_hazard_unit;
END spec;