c9e3aa20fa28b1f9cf2412737e66eddbdb7e9771
[calu.git] / cpu / src / alu.vhd
1 --   `Deep Thought', a softcore CPU implemented on a FPGA\r
2 --\r
3 --  Copyright (C) 2010 Markus Hofstaetter <markus.manrow@gmx.at>\r
4 --  Copyright (C) 2010 Martin Perner <e0725782@student.tuwien.ac.at>\r
5 --  Copyright (C) 2010 Stefan Rebernig <stefan.rebernig@gmail.com>\r
6 --  Copyright (C) 2010 Manfred Schwarz <e0725898@student.tuwien.ac.at>\r
7 --  Copyright (C) 2010 Bernhard Urban <lewurm@gmail.com>\r
8 --\r
9 --  This program is free software: you can redistribute it and/or modify\r
10 --  it under the terms of the GNU General Public License as published by\r
11 --  the Free Software Foundation, either version 3 of the License, or\r
12 --  (at your option) any later version.\r
13 --\r
14 --  This program is distributed in the hope that it will be useful,\r
15 --  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16 --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17 --  GNU General Public License for more details.\r
18 --\r
19 --  You should have received a copy of the GNU General Public License\r
20 --  along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
21 \r
22 library IEEE;\r
23 use IEEE.std_logic_1164.all;\r
24 use IEEE.numeric_std.all;\r
25 \r
26 use work.common_pkg.all;\r
27 use work.alu_pkg.all;\r
28 use work.extension_pkg.all;\r
29 \r
30 entity alu is\r
31         --some modules won't need all inputs\r
32         port(\r
33         --System inputs\r
34         \r
35                         clk : in std_logic;\r
36                         reset : in std_logic;\r
37         --operation inputs\r
38                         cond : in condition_t;\r
39                         op_group : in op_info_t;\r
40                         left_operand : in gp_register_t;\r
41                         right_operand : in gp_register_t;\r
42                         \r
43             displacement : in gp_register_t;\r
44                         prog_cnt    : in instr_addr_t;\r
45                         brpr        : in std_logic;\r
46                         \r
47                         op_detail : in op_opt_t;\r
48                         \r
49                         alu_state  : in alu_result_rec;\r
50                         pval            : in gp_register_t;\r
51                         pval_nxt    : in gp_register_t;\r
52                         \r
53                         alu_result : out alu_result_rec;\r
54             addr : out word_t; --memaddr\r
55             data : out gp_register_t; --mem data --ureg\r
56                         \r
57                         pinc : out std_logic;\r
58                         pwr_en : out std_logic;\r
59                         paddr : out paddr_t\r
60                 );\r
61                 \r
62 end alu;\r
63 \r