-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache_test.vhd
More file actions
129 lines (111 loc) · 3.71 KB
/
cache_test.vhd
File metadata and controls
129 lines (111 loc) · 3.71 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
--------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 10:16:57 10/30/2020
-- Design Name:
-- Module Name: C:/Users/Yasamin/Documents/Classes/COE758/CacheController-master/cache_test.vhd
-- Project Name: CACHE2
-- Target Device:
-- Tool versions:
-- Description:
--
-- VHDL Test Bench Created by ISE for module: CacheController
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-- Notes:
-- This testbench has been automatically generated using types std_logic and
-- std_logic_vector for the ports of the unit under test. Xilinx recommends
-- that these types always be used for the top-level I/O of a design in order
-- to guarantee that the testbench will bind correctly to the post-implementation
-- simulation model.
--------------------------------------------------------------------------------
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 cache_test IS
END cache_test;
ARCHITECTURE behavior OF cache_test IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT CacheController
PORT(
clk : IN std_logic;
addr : OUT std_logic_vector(15 downto 0);
data_out : OUT std_logic_vector(7 downto 0);
cpu_out : OUT std_logic_vector(7 downto 0);
sram_address : OUT std_logic_vector(7 downto 0);
sram_data_in : OUT std_logic_vector(7 downto 0);
sram_data_out : OUT std_logic_vector(7 downto 0);
sdram_address : OUT std_logic_vector(15 downto 0);
sdram_data_in : OUT std_logic_vector(7 downto 0);
sdram_data_out : OUT std_logic_vector(7 downto 0);
state : OUT std_logic_vector(2 downto 0);
wr_rd : OUT std_logic;
memstrb : OUT std_logic;
rdy : OUT std_logic;
cs : OUT std_logic
);
END COMPONENT;
--Inputs
signal clk : std_logic := '0';
--Outputs
signal addr : std_logic_vector(15 downto 0);
signal data_out : std_logic_vector(7 downto 0);
signal sram_address : std_logic_vector(7 downto 0);
signal cpu_out : std_logic_vector(7 downto 0);
signal sram_data_in : std_logic_vector(7 downto 0);
signal sram_data_out : std_logic_vector(7 downto 0);
signal sdram_address : std_logic_vector(15 downto 0);
signal sdram_data_in : std_logic_vector(7 downto 0);
signal sdram_data_out : std_logic_vector(7 downto 0);
signal state : std_logic_vector(2 downto 0);
signal wr_rd : std_logic;
signal memstrb : std_logic;
signal rdy : std_logic;
signal cs : std_logic;
-- Clock period definitions
constant clk_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: CacheController PORT MAP (
clk => clk,
addr => addr,
data_out => data_out,
cpu_out => cpu_out,
sram_address => sram_address,
sram_data_in => sram_data_in,
sram_data_out => sram_data_out,
sdram_address => sdram_address,
sdram_data_in => sdram_data_in,
sdram_data_out => sdram_data_out,
state => state,
wr_rd => wr_rd,
memstrb => memstrb,
rdy => rdy,
cs => cs
);
-- 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
-- hold reset state for 100 ns.
wait for 100 ns;
wait for clk_period*300;
-- insert stimulus here
wait;
end process;
END;