-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpu65xx_e.vhd
87 lines (79 loc) · 2.13 KB
/
cpu65xx_e.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
-- -----------------------------------------------------------------------
--
-- FPGA 64
--
-- A fully functional commodore 64 implementation in a single FPGA
--
-- -----------------------------------------------------------------------
-- Copyright 2005-2008 by Peter Wendrich ([email protected])
-- http://www.syntiac.com/fpga64.html
-- -----------------------------------------------------------------------
--
-- Interface to 6502/6510 core
--
-- -----------------------------------------------------------------------
library IEEE;
use ieee.std_logic_1164.ALL;
use ieee.numeric_std.ALL;
-- -----------------------------------------------------------------------
entity cpu65xx is
generic (
pipelineOpcode : boolean;
pipelineAluMux : boolean;
pipelineAluOut : boolean
);
port (
clk : in std_logic;
enable : in std_logic;
reset : in std_logic;
nmi_n : in std_logic;
irq_n : in std_logic;
so_n : in std_logic := '1';
di : in unsigned(7 downto 0);
do : out unsigned(7 downto 0);
addr : out unsigned(15 downto 0);
we : out std_logic;
debugOpcode : out unsigned(7 downto 0);
debugPc : out unsigned(15 downto 0);
debugA : out unsigned(7 downto 0);
debugX : out unsigned(7 downto 0);
debugY : out unsigned(7 downto 0);
debugS : out unsigned(7 downto 0)
);
end cpu65xx;
library IEEE;
use ieee.std_logic_1164.ALL;
use ieee.numeric_std.ALL;
entity cpu6502 is
port(
clk : in std_logic;
ce : in std_logic;
reset : in std_logic;
nmi : in std_logic;
irq : in std_logic;
din : in unsigned(7 downto 0);
dout : out unsigned(7 downto 0);
addr : out unsigned(15 downto 0);
we : out std_logic
);
end cpu6502;
architecture cpu6502 of cpu6502 is
begin
cpuInstance: entity work.cpu65xx(fast)
generic map (
pipelineOpcode => false,
pipelineAluMux => false,
pipelineAluOut => false
)
port map (
clk => clk,
enable=> ce,
reset => reset,
nmi_n => not nmi,
irq_n => not irq,
di => din,
do => dout,
addr => addr,
we => we
);
end architecture;