Line 1... |
Line 1... |
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- The Arithmetic Logic Unit (ALU).
|
-- The Arithmetic Logic Unit (ALU).
|
-- It contains the accumulator and the C flag.
|
-- It contains the accumulator and the C flag.
|
--
|
--
|
-- $Id: t400_alu.vhd,v 1.1.1.1 2006-05-06 01:56:44 arniml Exp $
|
-- $Id: t400_alu.vhd,v 1.2 2006-05-21 21:47:40 arniml Exp $
|
--
|
--
|
-- Copyright (c) 2006 Arnim Laeuger (arniml@opencores.org)
|
-- Copyright (c) 2006 Arnim Laeuger (arniml@opencores.org)
|
--
|
--
|
-- All rights reserved
|
-- All rights reserved
|
--
|
--
|
Line 46... |
Line 46... |
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
|
|
use work.t400_pack.all;
|
use work.t400_pack.all;
|
|
use work.t400_opt_pack.all;
|
|
|
entity t400_alu is
|
entity t400_alu is
|
|
|
|
generic (
|
|
opt_cko_g : integer := t400_opt_cko_crystal_c
|
|
);
|
port (
|
port (
|
-- System Interface -------------------------------------------------------
|
-- System Interface -------------------------------------------------------
|
ck_i : in std_logic;
|
ck_i : in std_logic;
|
ck_en_i : in boolean;
|
ck_en_i : in boolean;
|
por_i : in boolean;
|
por_i : in boolean;
|
res_i : in boolean;
|
res_i : in boolean;
|
|
cko_i : in std_logic;
|
-- Control Interface ------------------------------------------------------
|
-- Control Interface ------------------------------------------------------
|
op_i : in alu_op_t;
|
op_i : in alu_op_t;
|
-- Data Interface ---------------------------------------------------------
|
-- Data Interface ---------------------------------------------------------
|
m_i : in dw_t;
|
m_i : in dw_t;
|
dec_data_i : in dec_data_t;
|
dec_data_i : in dec_data_t;
|
Line 127... |
Line 132... |
when ALU_LOAD_G =>
|
when ALU_LOAD_G =>
|
a_q <= g_i;
|
a_q <= g_i;
|
when ALU_LOAD_IN =>
|
when ALU_LOAD_IN =>
|
a_q <= in_i;
|
a_q <= in_i;
|
when ALU_LOAD_IL =>
|
when ALU_LOAD_IL =>
|
a_q <= il_i(3) & "10" & il_i(0);
|
a_q(3) <= il_i(3);
|
|
if opt_cko_g = t400_opt_cko_gpi_c then
|
|
a_q(2) <= cko_i;
|
|
else
|
|
a_q(2) <= '1';
|
|
end if;
|
|
a_q(1) <= '0';
|
|
a_q(0) <= il_i(0);
|
when ALU_LOAD_BR =>
|
when ALU_LOAD_BR =>
|
a_q(3 downto 2) <= (others => '0');
|
a_q(3 downto 2) <= (others => '0');
|
a_q(1 downto 0) <= b_i(br_range_t);
|
a_q(1 downto 0) <= b_i(br_range_t);
|
when ALU_LOAD_BD =>
|
when ALU_LOAD_BD =>
|
a_q <= b_i(bd_range_t);
|
a_q <= b_i(bd_range_t);
|
Line 241... |
Line 253... |
|
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- File History:
|
-- File History:
|
--
|
--
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.1.1.1 2006/05/06 01:56:44 arniml
|
|
-- import from local CVS repository, LOC_CVS_0_1
|
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
No newline at end of file
|
No newline at end of file
|