-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtb_RAM.vhd
75 lines (58 loc) · 1.43 KB
/
tb_RAM.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
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--USE ieee.numeric_std.ALL;
ENTITY tb_RAM IS
END tb_RAM;
ARCHITECTURE behavior OF tb_RAM IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT RAM
PORT(
ADR_IN : IN std_logic_vector(3 downto 0);
CS_BAR : IN std_logic;
WR_BAR : IN std_logic;
RD_BAR : IN std_logic;
D : INOUT std_logic_vector(3 downto 0)
);
END COMPONENT;
--Inputs
signal ADR_IN : std_logic_vector(3 downto 0) := (others => '0');
signal CS_BAR : std_logic := '1';
signal WR_BAR : std_logic := '1';
signal RD_BAR : std_logic := '1';
--BiDirs
signal D : std_logic_vector(3 downto 0);
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: RAM PORT MAP (
ADR_IN => ADR_IN,
CS_BAR => CS_BAR,
WR_BAR => WR_BAR,
RD_BAR => RD_BAR,
D => D
);
process begin
wait for 50ns;
CS_BAR <= '0';
ADR_IN <= "0000";
D <= "1000";
wait for 5ns;
WR_BAR <= '0';
wait for 50ns;
WR_BAR <= '1';
wait for 5ns;
CS_BAR <= '1';
D <= "ZZZZ";
wait for 50ns;
CS_BAR <= '0';
ADR_IN <= "0000";
wait for 5ns;
RD_BAR <= '0';
wait for 50ns;
RD_BAR <= '1';
wait for 5ns;
CS_BAR <= '1';
wait;
end process;
END;