-
Notifications
You must be signed in to change notification settings - Fork 10
/
CartridgeROM_Coregen.vhd
96 lines (81 loc) · 1.95 KB
/
CartridgeROM_Coregen.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
88
89
90
91
92
93
94
--------------------------------------------------------------------------------
-- Entity: CartridgeROM
-- Date:2011-10-25
-- Author: jonathansieber
--
-- Description ${cursor}
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library std;
use std.textio.all;
Library UNISIM;
use UNISIM.vcomponents.all;
entity CartridgeROM is
port (
clk : in std_logic; -- input clock, xx MHz.
rstn : in std_logic;
PRG_Address : in std_logic_vector(14 downto 0);
PRG_Data : out std_logic_vector(7 downto 0);
CHR_Address : in unsigned(13 downto 0);
CHR_Data : out std_logic_vector(7 downto 0)
);
end CartridgeROM;
architecture arch of CartridgeROM is
COMPONENT prg_rom_NESStress
PORT (
clka : IN STD_LOGIC;
addra : IN STD_LOGIC_VECTOR(14 DOWNTO 0);
douta : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END COMPONENT;
COMPONENT chr_rom_NEStress
PORT (
clka : IN STD_LOGIC;
addra : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
douta : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END COMPONENT;
COMPONENT prg_rom_smb
PORT (
clka : IN STD_LOGIC;
addra : IN STD_LOGIC_VECTOR(14 DOWNTO 0);
douta : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END COMPONENT;
COMPONENT chr_rom_smb
PORT (
clka : IN STD_LOGIC;
addra : IN STD_LOGIC_VECTOR(12 DOWNTO 0);
douta : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END COMPONENT;
begin
--
--prg : prg_rom_NESStress
-- PORT MAP (
-- clka => clk,
-- addra => PRG_Address,
-- douta => PRG_Data
-- );
--
--chr : chr_rom_NEStress
-- PORT MAP (
-- clka => clk,
-- addra => std_logic_vector(CHR_Address(12 downto 0)),
-- douta => CHR_Data
-- );
prg : prg_rom_smb
PORT MAP (
clka => clk,
addra => PRG_Address,
douta => PRG_Data
);
chr : chr_rom_smb
PORT MAP (
clka => clk,
addra => std_logic_vector(CHR_Address(12 downto 0)),
douta => CHR_Data
);
end arch;