1 |
24 |
fpga_is_fu |
-- VHDL Entity R6502_TC.RegBank_AXY.symbol
|
2 |
|
|
--
|
3 |
|
|
-- Created:
|
4 |
|
|
-- by - eda.UNKNOWN (ENTW1)
|
5 |
|
|
-- at - 18:39:49 08.02.2010
|
6 |
|
|
--
|
7 |
|
|
-- Generated by Mentor Graphics' HDL Designer(TM) 2009.1 (Build 12)
|
8 |
|
|
--
|
9 |
|
|
LIBRARY ieee;
|
10 |
|
|
USE ieee.std_logic_1164.all;
|
11 |
|
|
USE ieee.std_logic_arith.all;
|
12 |
|
|
|
13 |
|
|
ENTITY RegBank_AXY IS
|
14 |
|
|
PORT(
|
15 |
|
|
clk_clk_i : IN std_logic;
|
16 |
|
|
d_regs_in_i : IN std_logic_vector (7 DOWNTO 0);
|
17 |
|
|
load_regs_i : IN std_logic;
|
18 |
|
|
rst_rst_n_i : IN std_logic;
|
19 |
|
|
sel_rb_in_i : IN std_logic_vector (1 DOWNTO 0);
|
20 |
|
|
sel_rb_out_i : IN std_logic_vector (1 DOWNTO 0);
|
21 |
|
|
sel_reg_i : IN std_logic_vector (1 DOWNTO 0);
|
22 |
|
|
d_regs_out_o : OUT std_logic_vector (7 DOWNTO 0);
|
23 |
|
|
q_a_o : OUT std_logic_vector (7 DOWNTO 0);
|
24 |
|
|
q_x_o : OUT std_logic_vector (7 DOWNTO 0);
|
25 |
|
|
q_y_o : OUT std_logic_vector (7 DOWNTO 0)
|
26 |
|
|
);
|
27 |
|
|
|
28 |
|
|
-- Declarations
|
29 |
|
|
|
30 |
|
|
END RegBank_AXY ;
|
31 |
|
|
|
32 |
|
|
-- Jens-D. Gutschmidt Project: R6502_TC
|
33 |
|
|
-- scantara2003@yahoo.de
|
34 |
|
|
-- COPYRIGHT (C) 2008-2010 by Jens Gutschmidt and OPENCORES.ORG
|
35 |
|
|
--
|
36 |
|
|
-- 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
|
37 |
|
|
-- the Free Software Foundation, either version 3 of the License, or any later version.
|
38 |
|
|
--
|
39 |
|
|
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
40 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
41 |
|
|
--
|
42 |
|
|
-- You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
43 |
|
|
--
|
44 |
|
|
-- CVS Revisins History
|
45 |
|
|
--
|
46 |
|
|
-- $Log: struct.bd,v $
|
47 |
|
|
-- <<-- more -->>
|
48 |
|
|
-- Title: Register Bank for register A, X and Y
|
49 |
|
|
-- Path: R6502_TC/RegBank_AXY/struct
|
50 |
|
|
-- Edited: by eda on 08 Feb 2010
|
51 |
|
|
--
|
52 |
|
|
-- VHDL Architecture R6502_TC.RegBank_AXY.struct
|
53 |
|
|
--
|
54 |
|
|
-- Created:
|
55 |
|
|
-- by - eda.UNKNOWN (ENTW1)
|
56 |
|
|
-- at - 18:39:49 08.02.2010
|
57 |
|
|
--
|
58 |
|
|
-- Generated by Mentor Graphics' HDL Designer(TM) 2009.1 (Build 12)
|
59 |
|
|
--
|
60 |
|
|
LIBRARY ieee;
|
61 |
|
|
USE ieee.std_logic_1164.all;
|
62 |
|
|
USE ieee.std_logic_arith.all;
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
ARCHITECTURE struct OF RegBank_AXY IS
|
66 |
|
|
|
67 |
|
|
-- Architecture declarations
|
68 |
|
|
|
69 |
|
|
-- Internal signal declarations
|
70 |
|
|
SIGNAL ld : std_logic_vector(2 DOWNTO 0);
|
71 |
|
|
SIGNAL load1_o_i : std_logic;
|
72 |
|
|
SIGNAL load2_o_i : std_logic;
|
73 |
|
|
SIGNAL load_o_i : std_logic;
|
74 |
|
|
SIGNAL q_mux_o_i : std_logic_vector(7 DOWNTO 0);
|
75 |
|
|
SIGNAL val_zero : std_logic_vector(7 DOWNTO 0);
|
76 |
|
|
|
77 |
|
|
-- Implicit buffer signal declarations
|
78 |
|
|
SIGNAL q_a_o_internal : std_logic_vector (7 DOWNTO 0);
|
79 |
|
|
SIGNAL q_x_o_internal : std_logic_vector (7 DOWNTO 0);
|
80 |
|
|
SIGNAL q_y_o_internal : std_logic_vector (7 DOWNTO 0);
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
-- ModuleWare signal declarations(v1.9) for instance 'U_0' of 'adff'
|
84 |
|
|
SIGNAL mw_U_0reg_cval : std_logic_vector(7 DOWNTO 0);
|
85 |
|
|
|
86 |
|
|
-- ModuleWare signal declarations(v1.9) for instance 'U_4' of 'adff'
|
87 |
|
|
SIGNAL mw_U_4reg_cval : std_logic_vector(7 DOWNTO 0);
|
88 |
|
|
|
89 |
|
|
-- ModuleWare signal declarations(v1.9) for instance 'U_5' of 'adff'
|
90 |
|
|
SIGNAL mw_U_5reg_cval : std_logic_vector(7 DOWNTO 0);
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
BEGIN
|
94 |
|
|
|
95 |
|
|
-- ModuleWare code(v1.9) for instance 'U_0' of 'adff'
|
96 |
|
|
q_a_o_internal <= mw_U_0reg_cval;
|
97 |
|
|
u_0seq_proc: PROCESS (clk_clk_i, rst_rst_n_i)
|
98 |
|
|
BEGIN
|
99 |
|
|
IF (rst_rst_n_i = '0') THEN
|
100 |
|
|
mw_U_0reg_cval <= "00000000";
|
101 |
|
|
ELSIF (clk_clk_i'EVENT AND clk_clk_i='1') THEN
|
102 |
|
|
IF (load_o_i = '1') THEN
|
103 |
|
|
mw_U_0reg_cval <= q_mux_o_i;
|
104 |
|
|
END IF;
|
105 |
|
|
END IF;
|
106 |
|
|
END PROCESS u_0seq_proc;
|
107 |
|
|
|
108 |
|
|
-- ModuleWare code(v1.9) for instance 'U_4' of 'adff'
|
109 |
|
|
q_x_o_internal <= mw_U_4reg_cval;
|
110 |
|
|
u_4seq_proc: PROCESS (clk_clk_i, rst_rst_n_i)
|
111 |
|
|
BEGIN
|
112 |
|
|
IF (rst_rst_n_i = '0') THEN
|
113 |
|
|
mw_U_4reg_cval <= "00000000";
|
114 |
|
|
ELSIF (clk_clk_i'EVENT AND clk_clk_i='1') THEN
|
115 |
|
|
IF (load1_o_i = '1') THEN
|
116 |
|
|
mw_U_4reg_cval <= q_mux_o_i;
|
117 |
|
|
END IF;
|
118 |
|
|
END IF;
|
119 |
|
|
END PROCESS u_4seq_proc;
|
120 |
|
|
|
121 |
|
|
-- ModuleWare code(v1.9) for instance 'U_5' of 'adff'
|
122 |
|
|
q_y_o_internal <= mw_U_5reg_cval;
|
123 |
|
|
u_5seq_proc: PROCESS (clk_clk_i, rst_rst_n_i)
|
124 |
|
|
BEGIN
|
125 |
|
|
IF (rst_rst_n_i = '0') THEN
|
126 |
|
|
mw_U_5reg_cval <= "00000000";
|
127 |
|
|
ELSIF (clk_clk_i'EVENT AND clk_clk_i='1') THEN
|
128 |
|
|
IF (load2_o_i = '1') THEN
|
129 |
|
|
mw_U_5reg_cval <= q_mux_o_i;
|
130 |
|
|
END IF;
|
131 |
|
|
END IF;
|
132 |
|
|
END PROCESS u_5seq_proc;
|
133 |
|
|
|
134 |
|
|
-- ModuleWare code(v1.9) for instance 'U_6' of 'and'
|
135 |
|
|
load_o_i <= load_regs_i AND ld(0);
|
136 |
|
|
|
137 |
|
|
-- ModuleWare code(v1.9) for instance 'U_7' of 'and'
|
138 |
|
|
load1_o_i <= load_regs_i AND ld(1);
|
139 |
|
|
|
140 |
|
|
-- ModuleWare code(v1.9) for instance 'U_8' of 'and'
|
141 |
|
|
load2_o_i <= load_regs_i AND ld(2);
|
142 |
|
|
|
143 |
|
|
-- ModuleWare code(v1.9) for instance 'U_11' of 'constval'
|
144 |
|
|
val_zero <= "00000000";
|
145 |
|
|
|
146 |
|
|
-- ModuleWare code(v1.9) for instance 'U_1' of 'decoder1'
|
147 |
|
|
u_1combo_proc: PROCESS (sel_reg_i)
|
148 |
|
|
BEGIN
|
149 |
|
|
ld <= (OTHERS => '0');
|
150 |
|
|
CASE sel_reg_i IS
|
151 |
|
|
WHEN "00" => ld(0) <= '1';
|
152 |
|
|
WHEN "01" => ld(1) <= '1';
|
153 |
|
|
WHEN "10" => ld(2) <= '1';
|
154 |
|
|
WHEN OTHERS => ld <= (OTHERS => '0');
|
155 |
|
|
END CASE;
|
156 |
|
|
END PROCESS u_1combo_proc;
|
157 |
|
|
|
158 |
|
|
-- ModuleWare code(v1.9) for instance 'U_2' of 'mux'
|
159 |
|
|
u_2combo_proc: PROCESS(q_a_o_internal, q_x_o_internal, q_y_o_internal,
|
160 |
|
|
val_zero, sel_rb_out_i)
|
161 |
|
|
BEGIN
|
162 |
|
|
CASE sel_rb_out_i IS
|
163 |
|
|
WHEN "00" => d_regs_out_o <= q_a_o_internal;
|
164 |
|
|
WHEN "01" => d_regs_out_o <= q_x_o_internal;
|
165 |
|
|
WHEN "10" => d_regs_out_o <= q_y_o_internal;
|
166 |
|
|
WHEN "11" => d_regs_out_o <= val_zero;
|
167 |
|
|
WHEN OTHERS => d_regs_out_o <= (OTHERS => 'X');
|
168 |
|
|
END CASE;
|
169 |
|
|
END PROCESS u_2combo_proc;
|
170 |
|
|
|
171 |
|
|
-- ModuleWare code(v1.9) for instance 'U_3' of 'mux'
|
172 |
|
|
u_3combo_proc: PROCESS(q_a_o_internal, q_y_o_internal, q_x_o_internal,
|
173 |
|
|
d_regs_in_i, sel_rb_in_i)
|
174 |
|
|
BEGIN
|
175 |
|
|
CASE sel_rb_in_i IS
|
176 |
|
|
WHEN "00" => q_mux_o_i <= q_a_o_internal;
|
177 |
|
|
WHEN "01" => q_mux_o_i <= q_y_o_internal;
|
178 |
|
|
WHEN "10" => q_mux_o_i <= q_x_o_internal;
|
179 |
|
|
WHEN "11" => q_mux_o_i <= d_regs_in_i;
|
180 |
|
|
WHEN OTHERS => q_mux_o_i <= (OTHERS => 'X');
|
181 |
|
|
END CASE;
|
182 |
|
|
END PROCESS u_3combo_proc;
|
183 |
|
|
|
184 |
|
|
-- Instance port mappings.
|
185 |
|
|
|
186 |
|
|
-- Implicit buffered output assignments
|
187 |
|
|
q_a_o <= q_a_o_internal;
|
188 |
|
|
q_x_o <= q_x_o_internal;
|
189 |
|
|
q_y_o <= q_y_o_internal;
|
190 |
|
|
|
191 |
|
|
END struct;
|