OpenCores
URL https://opencores.org/ocsvn/cpu65c02_true_cycle/cpu65c02_true_cycle/trunk

Subversion Repositories cpu65c02_true_cycle

[/] [cpu65c02_true_cycle/] [branches/] [avendor/] [rtl/] [vhdl/] [alu.vhd] - Blame information for rev 15

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 fpga_is_fu
-- VHDL Entity R65C02_TC.ALU.symbol
2
--
3
-- Created:
4
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
5 4 fpga_is_fu
--          at - 20:01:56 12.08.2008
6 2 fpga_is_fu
--
7
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
8
--
9
LIBRARY ieee;
10
USE ieee.std_logic_1164.all;
11
USE ieee.std_logic_arith.all;
12
 
13
entity ALU is
14
   port(
15 4 fpga_is_fu
      ch_a_i           : in     std_logic_vector (7 downto 0);
16
      ch_b_i           : in     std_logic_vector (7 downto 0);
17
      reg_0flag_core_i : in     std_logic;
18
      reg_3flag_core_i : in     std_logic;
19
      reg_7flag_core_i : in     std_logic;
20
      sel_alu_as_i     : in     std_logic;
21
      sel_alu_out_i    : in     std_logic_vector (2 downto 0);
22
      d_alu_o          : out    std_logic_vector (7 downto 0);
23
      reg_0flag_o      : out    std_logic;
24
      reg_1flag_o      : out    std_logic;
25
      reg_6flag_o      : out    std_logic;
26
      reg_7flag_o      : out    std_logic
27 2 fpga_is_fu
   );
28
 
29
-- Declarations
30
 
31
end ALU ;
32
 
33
-- Jens-D. Gutschmidt     Project:  R65C02_TC  
34
-- scantara2003@yahoo.de                       
35
-- COPYRIGHT (C) 2008 by Jens Gutschmidt and OPENCORES.ORG                                                                                     
36
--                                                                                                                                             
37
-- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by   
38
-- the Free Software Foundation, either version 3 of the License, or any later version.                                                        
39
--                                                                                                                                             
40
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of              
41
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.                                  
42
--                                                                                                                                             
43
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.     
44
--                                                                                                                                             
45
-- CVS Revisins History                                                                                                                        
46
--                                                                                                                                             
47
-- $Log: not supported by cvs2svn $                                                                                                                                       
48
--                                                                                                                                             
49
-- Title:  ALU  
50
-- Path:  R65C02_TC/ALU/struct  
51 4 fpga_is_fu
-- Edited:  by eda on 11 Aug 2008  
52 2 fpga_is_fu
--
53
-- VHDL Architecture R65C02_TC.ALU.struct
54
--
55
-- Created:
56
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
57 4 fpga_is_fu
--          at - 20:01:57 12.08.2008
58 2 fpga_is_fu
--
59
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
60
--
61
LIBRARY ieee;
62
USE ieee.std_logic_1164.all;
63
USE ieee.std_logic_arith.all;
64
 
65
library R65C02_TC;
66
 
67
architecture struct of ALU is
68
 
69
   -- Architecture declarations
70
 
71
   -- Internal signal declarations
72 4 fpga_is_fu
   signal decode_neg_o_i : std_logic_vector(7 downto 0);
73
   signal decode_o_i     : std_logic_vector(7 downto 0);
74
   signal din0_o_i       : std_logic;
75
   signal din1_o_i       : std_logic;
76
   signal din2_o_i       : std_logic;
77
   signal din3_o_i       : std_logic;
78
   signal din_o_i        : std_logic;
79
   signal dout_o_i       : std_logic;
80
   signal q_a_o_i        : std_logic_vector(7 downto 0);
81
   signal q_and_o_i      : std_logic_vector(7 downto 0);
82
   signal q_or_o_i       : std_logic_vector(7 downto 0);
83
   signal q_xor_o_i      : std_logic_vector(7 downto 0);
84
   signal sel_o_i        : std_logic_vector(1 downto 0);
85
   signal val_one        : std_logic_vector(7 downto 0);
86
   signal val_two        : std_logic_vector(7 downto 0);
87
   signal val_zero       : std_logic_vector(7 downto 0);
88 2 fpga_is_fu
 
89
   -- Implicit buffer signal declarations
90 4 fpga_is_fu
   signal d_alu_o_internal : std_logic_vector (7 downto 0);
91 2 fpga_is_fu
 
92
 
93
   -- Component Declarations
94
   component ADD_SUB
95
   port (
96
      d_in      : in     std_logic_vector ( 7 downto 0 ) := X"00";
97
      reg_0F_in : in     std_logic                       := '0';
98
      reg_7F_in : in     std_logic                       := '0';
99
      reg_a_in  : in     std_logic_vector ( 7 downto 0 ) := X"00";
100
      sel       : in     std_logic_vector ( 1 downto 0 ) := "00";
101
      reg_0F    : out    std_logic                       := '0';
102
      reg_6F    : out    std_logic                       := '0';
103
      reg_a     : out    std_logic_vector ( 7 downto 0 ) := X"00";
104
      zw_alu    : inout  std_logic_vector ( 8 downto 0 ) := '0' & X"00";
105
      zw_alu1   : inout  std_logic_vector ( 8 downto 0 ) := '0' & X"00";
106
      zw_alu2   : inout  std_logic_vector ( 8 downto 0 ) := '0' & X"00";
107
      zw_alu3   : inout  std_logic_vector ( 8 downto 0 ) := '0' & X"00";
108
      zw_alu4   : inout  std_logic_vector ( 8 downto 0 ) := '0' & X"00"
109
   );
110
   end component;
111
 
112
   -- Optional embedded configurations
113
   -- pragma synthesis_off
114
   for all : ADD_SUB use entity R65C02_TC.ADD_SUB;
115
   -- pragma synthesis_on
116
 
117
 
118
begin
119
   -- Architecture concurrent statements
120
   -- HDL Embedded Text Block 3 eb3
121
   -- eb1 1
122
   val_zero (7 downto 0) <= X"00";
123
   val_one (7 downto 0) <= X"01";
124
   val_two (7 downto 0) <= X"02";
125 4 fpga_is_fu
   sel_o_i(0) <= reg_3flag_core_i AND sel_alu_out_i(0);
126
   sel_o_i(1) <= sel_alu_as_i;
127 2 fpga_is_fu
 
128
 
129
 
130
   -- ModuleWare code(v1.9) for instance 'U_15' of 'decoder1'
131 4 fpga_is_fu
   u_15combo_proc: process (ch_a_i(2 DOWNTO 0))
132 2 fpga_is_fu
   begin
133 4 fpga_is_fu
      decode_o_i <= (others => '0');
134
      case ch_a_i(2 DOWNTO 0) is
135
         when "000" => decode_o_i(0) <= '1';
136
         when "001" => decode_o_i(1) <= '1';
137
         when "010" => decode_o_i(2) <= '1';
138
         when "011" => decode_o_i(3) <= '1';
139
         when "100" => decode_o_i(4) <= '1';
140
         when "101" => decode_o_i(5) <= '1';
141
         when "110" => decode_o_i(6) <= '1';
142
         when "111" => decode_o_i(7) <= '1';
143
         when others => decode_o_i <= (others => '0');
144 2 fpga_is_fu
      end case;
145
   end process u_15combo_proc;
146
 
147
   -- ModuleWare code(v1.9) for instance 'U_4' of 'inv'
148 4 fpga_is_fu
   decode_neg_o_i <= not(decode_o_i);
149 2 fpga_is_fu
 
150
   -- ModuleWare code(v1.9) for instance 'U_8' of 'inv'
151 4 fpga_is_fu
   reg_1flag_o <= not(din_o_i);
152 2 fpga_is_fu
 
153
   -- ModuleWare code(v1.9) for instance 'U_9' of 'inv'
154 4 fpga_is_fu
   reg_7flag_o <= not(din1_o_i);
155 2 fpga_is_fu
 
156
   -- ModuleWare code(v1.9) for instance 'U_10' of 'inv'
157 4 fpga_is_fu
   din1_o_i <= not(d_alu_o_internal(7));
158 2 fpga_is_fu
 
159
   -- ModuleWare code(v1.9) for instance 'U_14' of 'inv'
160 4 fpga_is_fu
   din3_o_i <= not(sel_alu_out_i(0));
161 2 fpga_is_fu
 
162
   -- ModuleWare code(v1.9) for instance 'U_5' of 'mux'
163 4 fpga_is_fu
   u_5combo_proc: process(q_and_o_i, q_or_o_i, q_xor_o_i, decode_o_i,
164
                          decode_neg_o_i, q_a_o_i, val_zero,
165
                          sel_alu_out_i)
166 2 fpga_is_fu
   begin
167 4 fpga_is_fu
      case sel_alu_out_i is
168
      when "000" => d_alu_o_internal <= q_and_o_i;
169
      when "001" => d_alu_o_internal <= q_or_o_i;
170
      when "010" => d_alu_o_internal <= q_xor_o_i;
171
      when "011" => d_alu_o_internal <= decode_o_i;
172
      when "100" => d_alu_o_internal <= decode_neg_o_i;
173
      when "101" => d_alu_o_internal <= q_a_o_i;
174
      when "110" => d_alu_o_internal <= q_a_o_i;
175
      when "111" => d_alu_o_internal <= val_zero;
176
      when others => d_alu_o_internal <= (others => 'X');
177 2 fpga_is_fu
      end case;
178
   end process u_5combo_proc;
179
 
180
   -- ModuleWare code(v1.9) for instance 'U_7' of 'por'
181 4 fpga_is_fu
   din_o_i <= d_alu_o_internal(0) or  d_alu_o_internal(1) or  d_alu_o_internal(2) or  d_alu_o_internal(3) or  d_alu_o_internal(4) or  d_alu_o_internal(5) or  d_alu_o_internal(6) or  d_alu_o_internal(7);
182 2 fpga_is_fu
 
183
   -- ModuleWare code(v1.9) for instance 'U_0' of 'sand'
184 4 fpga_is_fu
   q_and_o_i <= ch_a_i and ch_b_i;
185 2 fpga_is_fu
 
186
   -- ModuleWare code(v1.9) for instance 'U_11' of 'sand'
187 4 fpga_is_fu
   din0_o_i <= sel_alu_out_i(0) and reg_0flag_core_i;
188 2 fpga_is_fu
 
189
   -- ModuleWare code(v1.9) for instance 'U_13' of 'sand'
190 4 fpga_is_fu
   din2_o_i <= din3_o_i and sel_alu_as_i;
191 2 fpga_is_fu
 
192
   -- ModuleWare code(v1.9) for instance 'U_1' of 'sor'
193 4 fpga_is_fu
   q_or_o_i <= ch_a_i or ch_b_i;
194 2 fpga_is_fu
 
195
   -- ModuleWare code(v1.9) for instance 'U_12' of 'sor'
196 4 fpga_is_fu
   dout_o_i <= din0_o_i or din2_o_i;
197 2 fpga_is_fu
 
198
   -- ModuleWare code(v1.9) for instance 'U_2' of 'sxor'
199 4 fpga_is_fu
   q_xor_o_i <= ch_a_i xor ch_b_i;
200 2 fpga_is_fu
 
201
   -- Instance port mappings.
202
   U_6 : ADD_SUB
203
      port map (
204 4 fpga_is_fu
         d_in      => ch_b_i,
205
         reg_0F_in => dout_o_i,
206
         reg_7F_in => reg_7flag_core_i,
207
         reg_a_in  => ch_a_i,
208
         sel       => sel_o_i,
209
         reg_0F    => reg_0flag_o,
210
         reg_6F    => reg_6flag_o,
211
         reg_a     => q_a_o_i,
212 2 fpga_is_fu
         zw_alu    => open,
213
         zw_alu1   => open,
214
         zw_alu2   => open,
215
         zw_alu3   => open,
216
         zw_alu4   => open
217
      );
218
 
219
   -- Implicit buffered output assignments
220 4 fpga_is_fu
   d_alu_o <= d_alu_o_internal;
221 2 fpga_is_fu
 
222
end struct;

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.