-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_memory.vhd
More file actions
55 lines (51 loc) · 1009 Bytes
/
data_memory.vhd
File metadata and controls
55 lines (51 loc) · 1009 Bytes
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
library ieee;
use ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.all;
entity data_memory is
port(
addr: in std_logic_vector(7 downto 0);
write_en: in std_logic;
rd_en: in std_logic;
clock: in std_logic := '1';
rd_data: out std_logic_vector(7 downto 0);
wr_data: in std_logic_vector(7 downto 0)
);
end entity;
architecture structural of data_memory is
component altsyncram
generic
(
init_file: string;
operation_mode: string;
widthad_a: natural;
width_a: natural
);
port(
wren_a: in std_logic;
rden_a: in std_logic;
clock0: in std_logic;
address_a: in std_logic_vector(7 downto 0);
q_a: out std_logic_vector(7 downto 0);
data_a: in std_logic_vector(7 downto 0)
);
end component;
begin
altsyncram_component: altsyncram
generic map
(
init_file => "dmemory.mif",
operation_mode => "SINGLE_PORT",
widthad_a => 8,
width_a => 8
)
port map
(
wren_a => write_en,
rden_a => rd_en,
clock0 => clock,
address_a => addr,
q_a => rd_data,
data_a => wr_data
);
end structural;