-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnewMemoryModuleTest_tb.vhd
More file actions
executable file
·76 lines (59 loc) · 1.84 KB
/
newMemoryModuleTest_tb.vhd
File metadata and controls
executable file
·76 lines (59 loc) · 1.84 KB
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
--------------------------------------------------------------------------------
--
--------------------------------------------------------------------------------
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 newMemoryModuleTest_tb IS
END newMemoryModuleTest_tb;
ARCHITECTURE behavior OF newMemoryModuleTest_tb IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT memory
PORT(
address : IN std_logic_vector(15 downto 0);
write_data : IN std_logic_vector(15 downto 0);
MemWrite : IN std_logic;
read_data : OUT std_logic_vector(15 downto 0);
CLK : IN std_logic
);
END COMPONENT;
--Inputs
signal address : std_logic_vector(15 downto 0) := (others => '0');
signal write_data : std_logic_vector(15 downto 0) := (others => '0');
signal MemWrite : std_logic := '0';
signal CLK : std_logic := '0';
--Outputs
signal read_data : std_logic_vector(15 downto 0);
-- Clock period definitions
constant CLK_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: memory PORT MAP (
address => address,
write_data => write_data,
MemWrite => MemWrite,
read_data => read_data,
CLK => CLK
);
-- Clock process definitions
CLK_process :process
begin
CLK <= '0';
wait for CLK_period/2;
CLK <= '1';
wait for CLK_period/2;
end process;
-- Stimulus process
stim_proc: process
begin
address<=x"0000";
MemWrite<='0';
wait for 100 ns;
address<=x"0000";
write_data<=x"00ff";
MemWrite<='1';
wait;
end process;
END;