-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrom1b_blue_racetrack_1.vhd
85 lines (71 loc) · 2.8 KB
/
rom1b_blue_racetrack_1.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
------- ROM creada automaticamente por ppm2rom -----------
------- Felipe Machado -----------------------------------
------- Departamento de Tecnologia Electronica -----------
------- Universidad Rey Juan Carlos ----------------------
------- http://gtebim.es ---------------------------------
----------------------------------------------------------
--------Datos de la imagen -------------------------------
--- Fichero original : racetrack_1.ppm
--- Filas : 30
--- Columnas : 32
--- Color : Blanco y negro. 2 niveles (1 bit)
------ Puertos -------------------------------------------
-- Entradas ----------------------------------------------
-- clk : senal de reloj
-- addr : direccion de la memoria
-- Salidas ----------------------------------------------
-- dout : dato de 32 bits de la direccion addr (un ciclo despues)
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity ROM1b_1f_blue_racetrack_1 is
port (
clk : in std_logic; -- reloj
addr : in std_logic_vector(5-1 downto 0);
dout : out std_logic_vector(32-1 downto 0)
);
end ROM1b_1f_blue_racetrack_1;
architecture BEHAVIORAL of ROM1b_1f_blue_racetrack_1 is
signal addr_int : natural range 0 to 2**5-1;
type memostruct is array (natural range<>) of std_logic_vector(32-1 downto 0);
constant filaimg : memostruct := (
"00000000000000000000000000000000",
"00000000000000000000000000000000",
"00000011111111110000000000000000",
"00001111111111111000000000000000",
"00011111111111111100000000000000",
"00111111111111111110000000000000",
"00111111111000111111111111100000",
"00111111100000011111111111110000",
"00111111000000001111111111111000",
"00111111000000000000000011111000",
"00111110000000000000000001111100",
"00111110000000000000000011111100",
"00111110000000000000111111111100",
"00111110000000000001111111111000",
"00111111000000000001111111100000",
"00111111110000000001110000000000",
"00111111111000000001110000000000",
"00011111111100000001111111100000",
"00001111111110000001111111110000",
"00000111111111000000111111111000",
"00000000111111000000000011111100",
"00000000011111000000000011111100",
"00000000011111000000000011111100",
"00000000011111111111111111111100",
"00000000011111111111111111111100",
"00000000011111111111111111111100",
"00000000001111111111111111111000",
"00000000000111111111111111110000",
"00000000000000000000000000000000",
"00000000000000000000000000000000"
);
begin
addr_int <= TO_INTEGER(unsigned(addr));
P_ROM: process (clk)
begin
if clk'event and clk='1' then
dout <= filaimg(addr_int);
end if;
end process;
end BEHAVIORAL;