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

Subversion Repositories cpu6502_true_cycle

[/] [cpu6502_true_cycle/] [branches/] [avendor/] [rtl/] [vhdl/] [core.vhd] - Blame information for rev 18

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 fpga_is_fu
-- VHDL Entity R6502_TC.Core.symbol
2
--
3
-- Created:
4 8 fpga_is_fu
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
5
--          at - 22:43:05 04.01.2009
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 8 fpga_is_fu
entity Core is
14
   port(
15
      clk_clk_i   : in     std_logic;
16
      d_i         : in     std_logic_vector (7 downto 0);
17
      irq_n_i     : in     std_logic;
18
      nmi_n_i     : in     std_logic;
19
      rdy_i       : in     std_logic;
20
      rst_rst_n_i : in     std_logic;
21
      so_n_i      : in     std_logic;
22
      a_o         : out    std_logic_vector (15 downto 0);
23
      d_o         : out    std_logic_vector (7 downto 0);
24
      rd_o        : out    std_logic;
25
      sync_o      : out    std_logic;
26
      wr_n_o      : out    std_logic;
27
      wr_o        : out    std_logic
28 2 fpga_is_fu
   );
29
 
30
-- Declarations
31
 
32 8 fpga_is_fu
end Core ;
33 2 fpga_is_fu
 
34
-- Jens-D. Gutschmidt     Project:  R6502_TC  
35
-- scantara2003@yahoo.de                      
36
-- COPYRIGHT (C) 2008 by Jens Gutschmidt and OPENCORES.ORG                                                                                                                                  
37
--                                                                                                                                                                                          
38
-- 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   
39
-- 3 of the License, or any later version.                                                                                                                                                  
40
--                                                                                                                                                                                          
41
-- 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                          
42
-- PARTICULAR PURPOSE.  See the GNU General Public License for more details.                                                                                                                
43
--                                                                                                                                                                                          
44
-- You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.                                                  
45
--                                                                                                                                                                                          
46
-- CVS Revisins History                                                                                                                                                                     
47
--                                                                                                                                                                                          
48 6 fpga_is_fu
-- $Log: not supported by cvs2svn $                                                                                                                                                                      
49
--   <<-- more -->>                                                                                                                                                                         
50
-- Title:  Core  
51 2 fpga_is_fu
-- Path:  R6502_TC/Core/struct  
52 6 fpga_is_fu
-- Edited:  by eda on 04 Jan 2009  
53 2 fpga_is_fu
--
54
-- VHDL Architecture R6502_TC.Core.struct
55
--
56
-- Created:
57 8 fpga_is_fu
--          by - eda.UNKNOWN (ENTWICKL4-XP-PR)
58
--          at - 22:43:06 04.01.2009
59 2 fpga_is_fu
--
60
-- Generated by Mentor Graphics' HDL Designer(TM) 2007.1a (Build 13)
61
--
62
LIBRARY ieee;
63
USE ieee.std_logic_1164.all;
64
USE ieee.std_logic_arith.all;
65
 
66 8 fpga_is_fu
library R6502_TC;
67 2 fpga_is_fu
 
68 8 fpga_is_fu
architecture struct of Core is
69 2 fpga_is_fu
 
70
   -- Architecture declarations
71
 
72
   -- Internal signal declarations
73 8 fpga_is_fu
   signal adr_nxt_pc_o_i : std_logic_vector(15 downto 0);
74
   signal adr_o_i        : std_logic_vector(15 downto 0);
75
   signal adr_pc_o_i     : std_logic_vector(15 downto 0);
76
   signal adr_sp_o_i     : std_logic_vector(15 downto 0);
77
   signal ch_a_o_i       : std_logic_vector(7 downto 0);
78
   signal ch_b_o_i       : std_logic_vector(7 downto 0);
79
   signal d_alu_n_o_i    : std_logic;
80
   signal d_alu_o_i      : std_logic_vector(7 downto 0);
81
   signal d_alu_or_o_i   : std_logic;
82
   signal d_regs_in_o_i  : std_logic_vector(7 downto 0);
83
   signal d_regs_out_o_i : std_logic_vector(7 downto 0);
84
   signal fetch_o_i      : std_logic;
85
   signal ld_o_i         : std_logic_vector(1 downto 0);
86
   signal ld_pc_o_i      : std_logic;
87
   signal ld_sp_o_i      : std_logic;
88
   signal load_regs_o_i  : std_logic;
89
   signal nmi_o_i        : std_logic;
90
   signal offset_o_i     : std_logic_vector(15 downto 0);
91
   signal q_a_o_i        : std_logic_vector(7 downto 0);
92
   signal q_x_o_i        : std_logic_vector(7 downto 0);
93
   signal q_y_o_i        : std_logic_vector(7 downto 0);
94
   signal reg_0flag_o_i  : std_logic;
95
   signal reg_1flag_o_i  : std_logic;
96
   signal reg_7flag_o_i  : std_logic;
97
   signal sel_pc_as_o_i  : std_logic;
98
   signal sel_pc_in_o_i  : std_logic;
99
   signal sel_pc_val_o_i : std_logic_vector(1 downto 0);
100
   signal sel_rb_in_o_i  : std_logic_vector(1 downto 0);
101
   signal sel_rb_out_o_i : std_logic_vector(1 downto 0);
102
   signal sel_reg_o_i    : std_logic_vector(1 downto 0);
103
   signal sel_sp_as_o_i  : std_logic;
104
   signal sel_sp_in_o_i  : std_logic;
105 2 fpga_is_fu
 
106
 
107 8 fpga_is_fu
   -- ModuleWare signal declarations(v1.9) for instance 'U_11' of 'add'
108
   signal mw_U_11temp_din0 : std_logic_vector(8 downto 0);
109
   signal mw_U_11temp_din1 : std_logic_vector(8 downto 0);
110
   signal mw_U_11sum : unsigned(8 downto 0);
111
 
112 2 fpga_is_fu
   -- Component Declarations
113 8 fpga_is_fu
   component FSM_Execution_Unit
114
   port (
115
      adr_nxt_pc_i : in     std_logic_vector (15 downto 0);
116
      adr_pc_i     : in     std_logic_vector (15 downto 0);
117
      adr_sp_i     : in     std_logic_vector (15 downto 0);
118
      clk_clk_i    : in     std_logic ;
119
      d_alu_i      : in     std_logic_vector ( 7 downto 0 );
120
      d_i          : in     std_logic_vector ( 7 downto 0 );
121
      d_regs_out_i : in     std_logic_vector ( 7 downto 0 );
122
      irq_n_i      : in     std_logic ;
123
      nmi_i        : in     std_logic ;
124
      q_a_i        : in     std_logic_vector ( 7 downto 0 );
125
      q_x_i        : in     std_logic_vector ( 7 downto 0 );
126
      q_y_i        : in     std_logic_vector ( 7 downto 0 );
127
      rdy_i        : in     std_logic ;
128
      reg_0flag_i  : in     std_logic ;
129
      reg_1flag_i  : in     std_logic ;
130
      reg_7flag_i  : in     std_logic ;
131
      rst_rst_n_i  : in     std_logic ;
132
      so_n_i       : in     std_logic ;
133
      a_o          : out    std_logic_vector (15 downto 0);
134
      adr_o        : out    std_logic_vector (15 downto 0);
135
      ch_a_o       : out    std_logic_vector ( 7 downto 0 );
136
      ch_b_o       : out    std_logic_vector ( 7 downto 0 );
137
      d_o          : out    std_logic_vector ( 7 downto 0 );
138
      d_regs_in_o  : out    std_logic_vector ( 7 downto 0 );
139
      fetch_o      : out    std_logic ;
140
      ld_o         : out    std_logic_vector ( 1 downto 0 );
141
      ld_pc_o      : out    std_logic ;
142
      ld_sp_o      : out    std_logic ;
143
      load_regs_o  : out    std_logic ;
144
      offset_o     : out    std_logic_vector ( 15 downto 0 );
145
      rd_o         : out    std_logic ;
146
      sel_pc_as_o  : out    std_logic ;
147
      sel_pc_in_o  : out    std_logic ;
148
      sel_pc_val_o : out    std_logic_vector ( 1 downto 0 );
149
      sel_rb_in_o  : out    std_logic_vector ( 1 downto 0 );
150
      sel_rb_out_o : out    std_logic_vector ( 1 downto 0 );
151
      sel_reg_o    : out    std_logic_vector ( 1 downto 0 );
152
      sel_sp_as_o  : out    std_logic ;
153
      sel_sp_in_o  : out    std_logic ;
154
      sync_o       : out    std_logic ;
155
      wr_n_o       : out    std_logic ;
156
      wr_o         : out    std_logic
157 2 fpga_is_fu
   );
158 8 fpga_is_fu
   end component;
159
   component FSM_NMI
160
   port (
161
      clk_clk_i   : in     std_logic ;
162
      fetch_i     : in     std_logic ;
163
      nmi_n_i     : in     std_logic ;
164
      rst_rst_n_i : in     std_logic ;
165
      nmi_o       : out    std_logic
166 2 fpga_is_fu
   );
167 8 fpga_is_fu
   end component;
168
   component RegBank_AXY
169
   port (
170
      clk_clk_i    : in     std_logic ;
171
      d_regs_in_i  : in     std_logic_vector (7 downto 0);
172
      load_regs_i  : in     std_logic ;
173
      rst_rst_n_i  : in     std_logic ;
174
      sel_rb_in_i  : in     std_logic_vector (1 downto 0);
175
      sel_rb_out_i : in     std_logic_vector (1 downto 0);
176
      sel_reg_i    : in     std_logic_vector (1 downto 0);
177
      d_regs_out_o : out    std_logic_vector (7 downto 0);
178
      q_a_o        : out    std_logic_vector (7 downto 0);
179
      q_x_o        : out    std_logic_vector (7 downto 0);
180
      q_y_o        : out    std_logic_vector (7 downto 0)
181 2 fpga_is_fu
   );
182 8 fpga_is_fu
   end component;
183
   component Reg_PC
184
   port (
185
      adr_i        : in     std_logic_vector (15 downto 0);
186
      clk_clk_i    : in     std_logic ;
187
      ld_i         : in     std_logic_vector (1 downto 0);
188
      ld_pc_i      : in     std_logic ;
189
      offset_i     : in     std_logic_vector (15 downto 0);
190
      rst_rst_n_i  : in     std_logic ;
191
      sel_pc_as_i  : in     std_logic ;
192
      sel_pc_in_i  : in     std_logic ;
193
      sel_pc_val_i : in     std_logic_vector (1 downto 0);
194
      adr_nxt_pc_o : out    std_logic_vector (15 downto 0);
195
      adr_pc_o     : out    std_logic_vector (15 downto 0)
196 2 fpga_is_fu
   );
197 8 fpga_is_fu
   end component;
198
   component Reg_SP
199
   port (
200
      adr_low_i   : in     std_logic_vector (7 downto 0);
201
      clk_clk_i   : in     std_logic ;
202
      ld_low_i    : in     std_logic ;
203
      ld_sp_i     : in     std_logic ;
204
      rst_rst_n_i : in     std_logic ;
205
      sel_sp_as_i : in     std_logic ;
206
      sel_sp_in_i : in     std_logic ;
207
      adr_sp_o    : out    std_logic_vector (15 downto 0)
208 2 fpga_is_fu
   );
209 8 fpga_is_fu
   end component;
210 2 fpga_is_fu
 
211
   -- Optional embedded configurations
212
   -- pragma synthesis_off
213 8 fpga_is_fu
   for all : FSM_Execution_Unit use entity R6502_TC.FSM_Execution_Unit;
214
   for all : FSM_NMI use entity R6502_TC.FSM_NMI;
215
   for all : RegBank_AXY use entity R6502_TC.RegBank_AXY;
216
   for all : Reg_PC use entity R6502_TC.Reg_PC;
217
   for all : Reg_SP use entity R6502_TC.Reg_SP;
218 2 fpga_is_fu
   -- pragma synthesis_on
219
 
220
 
221 8 fpga_is_fu
begin
222 2 fpga_is_fu
 
223 6 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_11' of 'add'
224 8 fpga_is_fu
   mw_U_11temp_din0 <= '0' & ch_a_o_i;
225
   mw_U_11temp_din1 <= '0' & ch_b_o_i;
226
   u_11combo_proc: process (mw_U_11temp_din0, mw_U_11temp_din1)
227
   variable temp_carry : std_logic;
228
   begin
229 6 fpga_is_fu
      temp_carry := '0';
230 8 fpga_is_fu
      mw_U_11sum <= unsigned(mw_U_11temp_din0) + unsigned(mw_U_11temp_din1) + temp_carry;
231
   end process u_11combo_proc;
232
   d_alu_o_i <= conv_std_logic_vector(mw_U_11sum(7 downto 0),8);
233
   reg_0flag_o_i <= mw_U_11sum(8) ;
234 2 fpga_is_fu
 
235 6 fpga_is_fu
   -- ModuleWare code(v1.9) for instance 'U_8' of 'inv'
236 8 fpga_is_fu
   reg_1flag_o_i <= not(d_alu_or_o_i);
237 6 fpga_is_fu
 
238
   -- ModuleWare code(v1.9) for instance 'U_9' of 'inv'
239 8 fpga_is_fu
   reg_7flag_o_i <= not(d_alu_n_o_i);
240 6 fpga_is_fu
 
241
   -- ModuleWare code(v1.9) for instance 'U_10' of 'inv'
242 8 fpga_is_fu
   d_alu_n_o_i <= not(d_alu_o_i(7));
243 6 fpga_is_fu
 
244
   -- ModuleWare code(v1.9) for instance 'U_7' of 'por'
245 8 fpga_is_fu
   d_alu_or_o_i <= d_alu_o_i(0) or  d_alu_o_i(1) or  d_alu_o_i(2) or  d_alu_o_i(3) or  d_alu_o_i(4) or  d_alu_o_i(5) or  d_alu_o_i(6) or  d_alu_o_i(7);
246 6 fpga_is_fu
 
247 2 fpga_is_fu
   -- Instance port mappings.
248 6 fpga_is_fu
   U_4 : FSM_Execution_Unit
249 8 fpga_is_fu
      port map (
250 6 fpga_is_fu
         adr_nxt_pc_i => adr_nxt_pc_o_i,
251
         adr_pc_i     => adr_pc_o_i,
252
         adr_sp_i     => adr_sp_o_i,
253
         clk_clk_i    => clk_clk_i,
254
         d_alu_i      => d_alu_o_i,
255
         d_i          => d_i,
256
         d_regs_out_i => d_regs_out_o_i,
257
         irq_n_i      => irq_n_i,
258
         nmi_i        => nmi_o_i,
259
         q_a_i        => q_a_o_i,
260
         q_x_i        => q_x_o_i,
261
         q_y_i        => q_y_o_i,
262
         rdy_i        => rdy_i,
263
         reg_0flag_i  => reg_0flag_o_i,
264
         reg_1flag_i  => reg_1flag_o_i,
265
         reg_7flag_i  => reg_7flag_o_i,
266
         rst_rst_n_i  => rst_rst_n_i,
267
         so_n_i       => so_n_i,
268
         a_o          => a_o,
269
         adr_o        => adr_o_i,
270
         ch_a_o       => ch_a_o_i,
271
         ch_b_o       => ch_b_o_i,
272
         d_o          => d_o,
273
         d_regs_in_o  => d_regs_in_o_i,
274
         fetch_o      => fetch_o_i,
275
         ld_o         => ld_o_i,
276
         ld_pc_o      => ld_pc_o_i,
277
         ld_sp_o      => ld_sp_o_i,
278
         load_regs_o  => load_regs_o_i,
279
         offset_o     => offset_o_i,
280
         rd_o         => rd_o,
281
         sel_pc_as_o  => sel_pc_as_o_i,
282
         sel_pc_in_o  => sel_pc_in_o_i,
283
         sel_pc_val_o => sel_pc_val_o_i,
284
         sel_rb_in_o  => sel_rb_in_o_i,
285
         sel_rb_out_o => sel_rb_out_o_i,
286
         sel_reg_o    => sel_reg_o_i,
287
         sel_sp_as_o  => sel_sp_as_o_i,
288
         sel_sp_in_o  => sel_sp_in_o_i,
289
         sync_o       => sync_o,
290
         wr_n_o       => wr_n_o,
291
         wr_o         => wr_o
292 2 fpga_is_fu
      );
293 6 fpga_is_fu
   U_6 : FSM_NMI
294 8 fpga_is_fu
      port map (
295 6 fpga_is_fu
         clk_clk_i   => clk_clk_i,
296
         fetch_i     => fetch_o_i,
297
         nmi_n_i     => nmi_n_i,
298
         rst_rst_n_i => rst_rst_n_i,
299
         nmi_o       => nmi_o_i
300
      );
301 2 fpga_is_fu
   U_2 : RegBank_AXY
302 8 fpga_is_fu
      port map (
303 2 fpga_is_fu
         clk_clk_i    => clk_clk_i,
304
         d_regs_in_i  => d_regs_in_o_i,
305
         load_regs_i  => load_regs_o_i,
306 6 fpga_is_fu
         rst_rst_n_i  => rst_rst_n_i,
307 2 fpga_is_fu
         sel_rb_in_i  => sel_rb_in_o_i,
308 6 fpga_is_fu
         sel_rb_out_i => sel_rb_out_o_i,
309 2 fpga_is_fu
         sel_reg_i    => sel_reg_o_i,
310
         d_regs_out_o => d_regs_out_o_i,
311
         q_a_o        => q_a_o_i,
312
         q_x_o        => q_x_o_i,
313
         q_y_o        => q_y_o_i
314
      );
315
   U_0 : Reg_PC
316 8 fpga_is_fu
      port map (
317 2 fpga_is_fu
         adr_i        => adr_o_i,
318
         clk_clk_i    => clk_clk_i,
319
         ld_i         => ld_o_i,
320
         ld_pc_i      => ld_pc_o_i,
321
         offset_i     => offset_o_i,
322 6 fpga_is_fu
         rst_rst_n_i  => rst_rst_n_i,
323 2 fpga_is_fu
         sel_pc_as_i  => sel_pc_as_o_i,
324 6 fpga_is_fu
         sel_pc_in_i  => sel_pc_in_o_i,
325 2 fpga_is_fu
         sel_pc_val_i => sel_pc_val_o_i,
326
         adr_nxt_pc_o => adr_nxt_pc_o_i,
327 6 fpga_is_fu
         adr_pc_o     => adr_pc_o_i
328 2 fpga_is_fu
      );
329
   U_1 : Reg_SP
330 8 fpga_is_fu
      port map (
331 6 fpga_is_fu
         adr_low_i   => adr_o_i(7 DOWNTO 0),
332
         clk_clk_i   => clk_clk_i,
333
         ld_low_i    => ld_o_i(0),
334
         ld_sp_i     => ld_sp_o_i,
335
         rst_rst_n_i => rst_rst_n_i,
336
         sel_sp_as_i => sel_sp_as_o_i,
337
         sel_sp_in_i => sel_sp_in_o_i,
338
         adr_sp_o    => adr_sp_o_i
339 2 fpga_is_fu
      );
340
 
341 8 fpga_is_fu
end struct;

powered by: WebSVN 2.1.0

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