-
Notifications
You must be signed in to change notification settings - Fork 2
/
char_rom.vhd
77 lines (67 loc) · 1.8 KB
/
char_rom.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
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE IEEE.STD_LOGIC_ARITH.all;
USE IEEE.STD_LOGIC_UNSIGNED.all;
LIBRARY altera_mf;
USE altera_mf.all;
ENTITY char_rom IS
PORT
(
character_address : IN STD_LOGIC_VECTOR (5 DOWNTO 0);
font_row, font_col : IN STD_LOGIC_VECTOR (2 DOWNTO 0);
clock : IN STD_LOGIC ;
rom_mux_output : OUT STD_LOGIC
);
END char_rom;
ARCHITECTURE SYN OF char_rom IS
SIGNAL rom_data : STD_LOGIC_VECTOR (7 DOWNTO 0);
SIGNAL rom_address : STD_LOGIC_VECTOR (8 DOWNTO 0);
COMPONENT altsyncram
GENERIC (
address_aclr_a : STRING;
clock_enable_input_a : STRING;
clock_enable_output_a : STRING;
init_file : STRING;
intended_device_family : STRING;
lpm_hint : STRING;
lpm_type : STRING;
numwords_a : NATURAL;
operation_mode : STRING;
outdata_aclr_a : STRING;
outdata_reg_a : STRING;
widthad_a : NATURAL;
width_a : NATURAL;
width_byteena_a : NATURAL
);
PORT (
clock0 : IN STD_LOGIC ;
address_a : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
q_a : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)
);
END COMPONENT;
BEGIN
altsyncram_component : altsyncram
GENERIC MAP (
address_aclr_a => "NONE",
clock_enable_input_a => "BYPASS",
clock_enable_output_a => "BYPASS",
init_file => "tcgrom.mif",
intended_device_family => "Cyclone III",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 512,
operation_mode => "ROM",
outdata_aclr_a => "NONE",
outdata_reg_a => "UNREGISTERED",
widthad_a => 9,
width_a => 8,
width_byteena_a => 1
)
PORT MAP (
clock0 => clock,
address_a => rom_address,
q_a => rom_data
);
rom_address <= character_address & font_row;
rom_mux_output <= rom_data (CONV_INTEGER(NOT font_col(2 DOWNTO 0)));
END SYN;