-
Notifications
You must be signed in to change notification settings - Fork 1
/
sysmem_device.vhd
61 lines (49 loc) · 1013 Bytes
/
sysmem_device.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
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.mm_device_util.all;
entity sysmem_device is
port (
clk: in std_logic;
i: in mm_iface_in;
o: out mm_iface_out := mm_iface_out_default
);
end entity;
architecture rtl of sysmem_device is
signal regce: std_logic := '0';
begin
read_signal_ctrl: block
signal rdy: std_logic_vector(0 to 1) := "00";
begin
regce_ctrl_proc: process (clk, i.en, i.we, rdy) is
begin
if rising_edge(clk) then
rdy(0) <= i.en and (not i.we);
rdy(1) <= rdy(0);
end if;
end process;
regce <= rdy(0);
o.ready <= rdy(1);
end block;
ramb64x8_inst: entity work.ramb64x8(structural)
port map (
CLKA => clk,
ADDRA => i.addr,
DIA => i.d,
DOA => o.d,
ENA => i.en,
REGCEA => regce,
RSTRAMA => '0',
RSTREGA => '0',
WEA => i.we,
CLKB => clk,
ADDRB => X"0000",
DIB => X"00",
DOB => open,
ENB => '0',
REGCEB => '0',
RSTRAMB => '0',
RSTREGB => '0',
WEB => '0'
);
end architecture;