OpenCores
URL https://opencores.org/ocsvn/fat_32_file_parser/fat_32_file_parser/trunk

Subversion Repositories fat_32_file_parser

[/] [fat_32_file_parser/] [trunk/] [TB_lifo.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 craighaywo
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   22:03:37 11/18/2014
6
-- Design Name:   
7
-- Module Name:   /home/craig/Documents/CW/Git_Repos/sd_card/TB_lifo.vhd
8
-- Project Name:  hw_client
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: lifo
14
-- 
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--
21
-- Notes: 
22
-- This testbench has been automatically generated using types std_logic and
23
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
24
-- that these types always be used for the top-level I/O of a design in order
25
-- to guarantee that the testbench will bind correctly to the post-implementation 
26
-- simulation model.
27
--------------------------------------------------------------------------------
28
LIBRARY ieee;
29
USE ieee.std_logic_1164.ALL;
30
 
31
-- Uncomment the following library declaration if using
32
-- arithmetic functions with Signed or Unsigned values
33
--USE ieee.numeric_std.ALL;
34
 
35
ENTITY TB_lifo IS
36
END TB_lifo;
37
 
38
ARCHITECTURE behavior OF TB_lifo IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT lifo
43
    PORT(
44
         CLK_IN : IN  std_logic;
45
         RESET_IN : IN  std_logic;
46
         CACHE_ADDR_IN : IN  std_logic;
47
         GOTO_CACHE_IN : IN  std_logic;
48
         WR_DATA_IN : IN  std_logic_vector(7 downto 0);
49
         WR_EN_IN : IN  std_logic;
50
         RD_DATA_OUT : OUT  std_logic_vector(7 downto 0);
51
         RD_EN_IN : IN  std_logic;
52
         EMPTY_OUT : OUT  std_logic;
53
         FULL_OUT : OUT  std_logic
54
        );
55
    END COMPONENT;
56
 
57
 
58
   --Inputs
59
   signal CLK_IN : std_logic := '0';
60
   signal RESET_IN : std_logic := '0';
61
   signal CACHE_ADDR_IN : std_logic := '0';
62
   signal GOTO_CACHE_IN : std_logic := '0';
63
   signal WR_DATA_IN : std_logic_vector(7 downto 0) := (others => '0');
64
   signal WR_EN_IN : std_logic := '0';
65
   signal RD_EN_IN : std_logic := '0';
66
 
67
        --Outputs
68
   signal RD_DATA_OUT : std_logic_vector(7 downto 0);
69
   signal EMPTY_OUT : std_logic;
70
   signal FULL_OUT : std_logic;
71
 
72
   -- Clock period definitions
73
   constant CLK_IN_period : time := 10 ns;
74
 
75
BEGIN
76
 
77
        -- Instantiate the Unit Under Test (UUT)
78
   uut: lifo PORT MAP (
79
          CLK_IN => CLK_IN,
80
          RESET_IN => RESET_IN,
81
          CACHE_ADDR_IN => CACHE_ADDR_IN,
82
          GOTO_CACHE_IN => GOTO_CACHE_IN,
83
          WR_DATA_IN => WR_DATA_IN,
84
          WR_EN_IN => WR_EN_IN,
85
          RD_DATA_OUT => RD_DATA_OUT,
86
          RD_EN_IN => RD_EN_IN,
87
          EMPTY_OUT => EMPTY_OUT,
88
          FULL_OUT => FULL_OUT
89
        );
90
 
91
   -- Clock process definitions
92
   CLK_IN_process :process
93
   begin
94
                CLK_IN <= '0';
95
                wait for CLK_IN_period/2;
96
                CLK_IN <= '1';
97
                wait for CLK_IN_period/2;
98
   end process;
99
 
100
--   stim_proc: process
101
--   begin
102
--      
103
--              wait for CLK_IN_period*10;
104
--
105
--              WR_DATA_IN <= X"81";
106
--              WR_EN_IN <= '1';
107
--              wait for CLK_IN_period;
108
--              WR_EN_IN <= '0';
109
--              wait for CLK_IN_period * 5;
110
--              
111
--              WR_DATA_IN <= X"82";
112
--              WR_EN_IN <= '1';
113
--              wait for CLK_IN_period;
114
--              WR_EN_IN <= '0';
115
--              wait for CLK_IN_period * 5;
116
--
117
--              WR_DATA_IN <= X"83";
118
--              WR_EN_IN <= '1';
119
--              wait for CLK_IN_period;
120
--              WR_EN_IN <= '0';
121
--              wait for CLK_IN_period * 25;
122
--
123
--              RD_EN_IN <= '1';
124
--              wait for CLK_IN_period;
125
--              RD_EN_IN <= '0';
126
--              wait for CLK_IN_period * 5;
127
--
128
--              RD_EN_IN <= '1';
129
--              wait for CLK_IN_period;
130
--              RD_EN_IN <= '0';
131
--              wait for CLK_IN_period * 5;
132
--
133
--              RD_EN_IN <= '1';
134
--              wait for CLK_IN_period;
135
--              RD_EN_IN <= '0';
136
--              wait for CLK_IN_period * 5;
137
--
138
--      wait;
139
--   end process;
140
 
141
   -- Stimulus process
142
   stim_proc: process
143
   begin
144
 
145
                wait for CLK_IN_period*10;
146
 
147
                WR_DATA_IN <= X"01";
148
                WR_EN_IN <= '1';
149
                wait for CLK_IN_period;
150
                WR_EN_IN <= '0';
151
 
152
                WR_DATA_IN <= X"02";
153
                WR_EN_IN <= '1';
154
                wait for CLK_IN_period;
155
                WR_EN_IN <= '0';
156
 
157
                WR_DATA_IN <= X"03";
158
                WR_EN_IN <= '1';
159
                wait for CLK_IN_period;
160
                WR_EN_IN <= '0';
161
 
162
                WR_DATA_IN <= X"11";
163
                WR_EN_IN <= '1';
164
                wait for CLK_IN_period;
165
                WR_EN_IN <= '0';
166
 
167
                WR_DATA_IN <= X"12";
168
                WR_EN_IN <= '1';
169
                wait for CLK_IN_period;
170
                WR_DATA_IN <= X"13";
171
                WR_EN_IN <= '1';
172
                wait for CLK_IN_period;
173
                WR_DATA_IN <= X"14";
174
                WR_EN_IN <= '1';
175
                wait for CLK_IN_period;
176
                WR_EN_IN <= '0';
177
 
178
                wait for CLK_IN_period;
179
                RD_EN_IN <= '1';
180
                wait for CLK_IN_period;
181
                RD_EN_IN <= '0';
182
 
183
                wait for CLK_IN_period;
184
                RD_EN_IN <= '1';
185
                wait for CLK_IN_period;
186
                RD_EN_IN <= '0';
187
 
188
                wait for CLK_IN_period;
189
                RD_EN_IN <= '1';
190
                wait for CLK_IN_period;
191
                RD_EN_IN <= '0';
192
 
193
                wait for CLK_IN_period;
194
                RD_EN_IN <= '1';
195
                wait for CLK_IN_period;
196
                RD_EN_IN <= '0';
197
 
198
                wait for CLK_IN_period * 2;
199
                RD_EN_IN <= '0';
200
                wait for CLK_IN_period * 4;
201
 
202
                CACHE_ADDR_IN <= '1';
203
                wait for CLK_IN_period;
204
                CACHE_ADDR_IN <= '0';
205
 
206
                RD_EN_IN <= '1';
207
                wait for CLK_IN_period * 20;
208
                RD_EN_IN <= '0';
209
 
210
                wait for CLK_IN_period;
211
                GOTO_CACHE_IN <= '1';
212
                wait for CLK_IN_period;
213
                GOTO_CACHE_IN <= '0';
214
 
215
                wait for CLK_IN_period * 20;
216
                RD_EN_IN <= '1';
217
                wait for CLK_IN_period * 20;
218
                RD_EN_IN <= '0';
219
 
220
                wait for CLK_IN_period;
221
                GOTO_CACHE_IN <= '1';
222
                wait for CLK_IN_period;
223
                GOTO_CACHE_IN <= '0';
224
 
225
                wait for CLK_IN_period;
226
                RESET_IN <= '1';
227
                wait for CLK_IN_period;
228
                RESET_IN <= '0';
229
 
230
      wait;
231
   end process;
232
 
233
END;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.