--
-- Component : alu_control
--
-- Generated by System Architect version v8.5_2.2 by ja-wells on Apr 03, 97
--
-- sensitivity_attr :: 'transaction

-- Determines the ALU operation based on the instruction

ARCHITECTURE spec OF alu_control IS
BEGIN
   -------------------------------------------------------------------
   vhdl_alu_control : PROCESS (Func, Op)
   -------------------------------------------------------------------
	variable result : mips_alu;
   BEGIN
	if (Op = rType) then
		case Func is
		when cADD =>
			result := alu_ADD;
		when cAND =>
			result := alu_AND;
		when cOR =>
			result := alu_OR;
		when cSLL =>
			result := alu_SLL;
		when cSLT =>
			result := alu_SLT;
		when cSRL =>
			result := alu_SRL;
		when cSUB =>
			result := alu_SUB;
		when others =>
			result := (OTHERS => 'X');
		end case;
	else
		case Op is
		when oADDI =>
			result := alu_ADD;
		when oANDI =>
			result := alu_AND;
		when oLUI =>
			result := alu_LUI;
		when oLW =>
			result := alu_ADD;
		when oORI =>
			result := alu_OR;
		when oSLTI =>
			result := alu_SLT;
		when oSW =>
			result := alu_ADD;
		when others =>
			result := (OTHERS => 'X');
		end case;
	end if;

	ALUOp <= result after 2 ns;

   END PROCESS vhdl_alu_control ;
END spec ;