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

Subversion Repositories cpu65c02_true_cycle

[/] [cpu65c02_true_cycle/] [trunk/] [released/] [rtl/] [v2_00/] [vhdl/] [regbank_axy.vhd] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 fpga_is_fu
LIBRARY ieee;
2
USE ieee.std_logic_1164.all;
3
USE ieee.std_logic_arith.all;
4
 
5
entity regbank_axy is
6
   port(
7
      clk_clk_i    : in     std_logic;
8
      d_regs_in_i  : in     std_logic_vector (7 downto 0);
9
      load_regs_i  : in     std_logic;
10
      rst_rst_n_i  : in     std_logic;
11
      sel_rb_in_i  : in     std_logic_vector (1 downto 0);
12
      sel_rb_out_i : in     std_logic_vector (1 downto 0);
13
      sel_reg_i    : in     std_logic_vector (1 downto 0);
14
      d_regs_out_o : out    std_logic_vector (7 downto 0);
15
      q_a_o        : out    std_logic_vector (7 downto 0);
16
      q_x_o        : out    std_logic_vector (7 downto 0);
17
      q_y_o        : out    std_logic_vector (7 downto 0)
18
   );
19
 
20
-- Declarations
21
 
22
end regbank_axy ;
23
-- (C) 2008 - 2021 Jens Gutschmidt
24
-- (email: opencores@vivare-services.com)
25
-- 
26
-- Versions:
27
-- Revision 1.7  2013/07/21 11:11:00  jens
28
-- - Changing the title block and internal revision history
29
-- 
30
-- Revision 1.6  2009/01/04 10:20:47  eda
31
-- Changes for cosmetic issues only
32
-- 
33
-- Revision 1.5  2009/01/04 09:23:10  eda
34
-- - Delete unused nets and blocks (same as R6502_TC)
35
-- - Rename blocks
36
-- 
37
-- Revision 1.4  2009/01/03 16:53:02  eda
38
-- - Unused nets and blocks deleted
39
-- - Renamed blocks
40
-- 
41
-- Revision 1.3  2009/01/03 16:42:02  eda
42
-- - Unused nets and blocks deleted
43
-- - Renamed blocks
44
-- 
45
-- Revision 1.2  2008/12/31 19:31:24  eda
46
-- Production Release
47
--  
48
-- 
49
--
50
-- r65c02_tc.regbank_axy.struct
51
--
52
-- Date:    06.01.2021
53
-- Time:    22:58:44
54
-- By:        VIVARE GmbH, Switzerland
55
--
56
-- COPYRIGHT (C) 2008 - 2021 by Jens Gutschmidt
57
-- 
58
-- 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 the Free Software Foundation, either version 3 of the License, or any later version.
59
-- 
60
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
61
-- 
62
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
63
-- 
64
-- 
65
LIBRARY ieee;
66
USE ieee.std_logic_1164.all;
67
USE ieee.std_logic_arith.all;
68
 
69
 
70
architecture struct of regbank_axy is
71
 
72
   -- Architecture declarations
73
 
74
   -- Internal signal declarations
75
   signal ld        : std_logic_vector(2 downto 0);
76
   signal load1_o_i : std_logic;
77
   signal load2_o_i : std_logic;
78
   signal load_o_i  : std_logic;
79
   signal q_mux_o_i : std_logic_vector(7 downto 0);
80
   signal val_zero  : std_logic_vector(7 downto 0);
81
 
82
   -- Implicit buffer signal declarations
83
   signal q_a_o_internal : std_logic_vector (7 downto 0);
84
   signal q_x_o_internal : std_logic_vector (7 downto 0);
85
   signal q_y_o_internal : std_logic_vector (7 downto 0);
86
 
87
 
88
   -- ModuleWare signal declarations(v1.12) for instance 'U_0' of 'adff'
89
   signal mw_U_0reg_cval : std_logic_vector(7 downto 0);
90
 
91
   -- ModuleWare signal declarations(v1.12) for instance 'U_4' of 'adff'
92
   signal mw_U_4reg_cval : std_logic_vector(7 downto 0);
93
 
94
   -- ModuleWare signal declarations(v1.12) for instance 'U_5' of 'adff'
95
   signal mw_U_5reg_cval : std_logic_vector(7 downto 0);
96
 
97
 
98
begin
99
 
100
   -- ModuleWare code(v1.12) for instance 'U_0' of 'adff'
101
   q_a_o_internal <= mw_U_0reg_cval;
102
   u_0seq_proc: process (clk_clk_i, rst_rst_n_i)
103
   begin
104
      if (rst_rst_n_i = '0') then
105
         mw_U_0reg_cval <= "00000000";
106
      elsif (clk_clk_i'event and clk_clk_i='1') then
107
         if (load_o_i = '1') then
108
            mw_U_0reg_cval <= q_mux_o_i;
109
         end if;
110
      end if;
111
   end process u_0seq_proc;
112
 
113
   -- ModuleWare code(v1.12) for instance 'U_4' of 'adff'
114
   q_x_o_internal <= mw_U_4reg_cval;
115
   u_4seq_proc: process (clk_clk_i, rst_rst_n_i)
116
   begin
117
      if (rst_rst_n_i = '0') then
118
         mw_U_4reg_cval <= "00000000";
119
      elsif (clk_clk_i'event and clk_clk_i='1') then
120
         if (load1_o_i = '1') then
121
            mw_U_4reg_cval <= q_mux_o_i;
122
         end if;
123
      end if;
124
   end process u_4seq_proc;
125
 
126
   -- ModuleWare code(v1.12) for instance 'U_5' of 'adff'
127
   q_y_o_internal <= mw_U_5reg_cval;
128
   u_5seq_proc: process (clk_clk_i, rst_rst_n_i)
129
   begin
130
      if (rst_rst_n_i = '0') then
131
         mw_U_5reg_cval <= "00000000";
132
      elsif (clk_clk_i'event and clk_clk_i='1') then
133
         if (load2_o_i = '1') then
134
            mw_U_5reg_cval <= q_mux_o_i;
135
         end if;
136
      end if;
137
   end process u_5seq_proc;
138
 
139
   -- ModuleWare code(v1.12) for instance 'U_6' of 'and'
140
   load_o_i <= load_regs_i and ld(0);
141
 
142
   -- ModuleWare code(v1.12) for instance 'U_7' of 'and'
143
   load1_o_i <= load_regs_i and ld(1);
144
 
145
   -- ModuleWare code(v1.12) for instance 'U_8' of 'and'
146
   load2_o_i <= load_regs_i and ld(2);
147
 
148
   -- ModuleWare code(v1.12) for instance 'U_11' of 'constval'
149
   val_zero <= "00000000";
150
 
151
   -- ModuleWare code(v1.12) for instance 'U_1' of 'decoder1'
152
   u_1combo_proc: process (sel_reg_i)
153
   begin
154
      ld <= (others => '0');
155
      case sel_reg_i is
156
         when "00" => ld(0) <= '1';
157
         when "01" => ld(1) <= '1';
158
         when "10" => ld(2) <= '1';
159
         when others => ld <= (others => '0');
160
      end case;
161
   end process u_1combo_proc;
162
 
163
   -- ModuleWare code(v1.12) for instance 'U_2' of 'mux'
164
   u_2combo_proc: process(q_a_o_internal, q_x_o_internal, q_y_o_internal,
165
                          val_zero, sel_rb_out_i)
166
   begin
167
      case sel_rb_out_i is
168
      when "00" => d_regs_out_o <= q_a_o_internal;
169
      when "01" => d_regs_out_o <= q_x_o_internal;
170
      when "10" => d_regs_out_o <= q_y_o_internal;
171
      when "11" => d_regs_out_o <= val_zero;
172
      when others => d_regs_out_o <= (others => 'X');
173
      end case;
174
   end process u_2combo_proc;
175
 
176
   -- ModuleWare code(v1.12) for instance 'U_3' of 'mux'
177
   u_3combo_proc: process(q_a_o_internal, q_y_o_internal, q_x_o_internal,
178
                          d_regs_in_i, sel_rb_in_i)
179
   begin
180
      case sel_rb_in_i is
181
      when "00" => q_mux_o_i <= q_a_o_internal;
182
      when "01" => q_mux_o_i <= q_y_o_internal;
183
      when "10" => q_mux_o_i <= q_x_o_internal;
184
      when "11" => q_mux_o_i <= d_regs_in_i;
185
      when others => q_mux_o_i <= (others => 'X');
186
      end case;
187
   end process u_3combo_proc;
188
 
189
   -- Instance port mappings.
190
 
191
   -- Implicit buffered output assignments
192
   q_a_o <= q_a_o_internal;
193
   q_x_o <= q_x_o_internal;
194
   q_y_o <= q_y_o_internal;
195
 
196
end struct;

powered by: WebSVN 2.1.0

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