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

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [vhdl/] [test/] [Fifo8b_Test.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 Andrewski
--------------------------------------------------------------------------------
2
--This file is part of fpga_gpib_controller.
3
--
4
-- Fpga_gpib_controller is free software: you can redistribute it and/or modify
5
-- it under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation, either version 3 of the License, or
7
-- (at your option) any later version.
8
--
9
-- Fpga_gpib_controller is distributed in the hope that it will be useful,
10
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
-- GNU General Public License for more details.
13 3 Andrewski
 
14 13 Andrewski
-- You should have received a copy of the GNU General Public License
15
-- along with Fpga_gpib_controller.  If not, see <http://www.gnu.org/licenses/>.
16 3 Andrewski
--------------------------------------------------------------------------------
17 13 Andrewski
-- Author: Andrzej Paluch
18 3 Andrewski
-- Fifo8b test
19
--------------------------------------------------------------------------------
20
LIBRARY ieee;
21
USE ieee.std_logic_1164.ALL;
22
USE ieee.std_logic_unsigned.all;
23
USE ieee.numeric_std.ALL;
24
use ieee.std_logic_arith.all;
25
 
26
use work.helperComponents.all;
27
 
28
ENTITY Fifo8b_Test_vhd IS
29
END Fifo8b_Test_vhd;
30
 
31
ARCHITECTURE behavior OF Fifo8b_Test_vhd IS
32
 
33
        constant clk_period : time := 1us;
34
 
35
 
36
        SIGNAL reset :  std_logic := '0';
37
        SIGNAL clk :  std_logic := '0';
38
        -------------- fifo --------------------
39
        SIGNAL bytesAvailable : std_logic;
40
        SIGNAL availableBytesCount : std_logic_vector(10 downto 0);
41
        SIGNAL bufferFull : std_logic;
42
        SIGNAL resetFifo : std_logic := '0';
43
        ----------------------------------------
44
        SIGNAL data_in : std_logic_vector(7 downto 0) := (others => '0');
45
        SIGNAL ready_to_write : std_logic;
46
        SIGNAL strobe_write : std_logic := '0';
47
                ----------------------------------------
48
        SIGNAL data_out : std_logic_vector(7 downto 0);
49
        SIGNAL ready_to_read : std_logic;
50
        SIGNAL strobe_read : std_logic := '0';
51
 
52
BEGIN
53
 
54
        -- Instantiate the Unit Under Test (UUT)
55
        fifo: Fifo8b port map (
56
                reset => reset,
57
                clk => clk,
58
                -------------- fifo --------------------
59
                bytesAvailable => bytesAvailable,
60
                availableBytesCount => availableBytesCount,
61
                bufferFull => bufferFull,
62
                resetFifo => resetFifo,
63
                ----------------------------------------
64
                data_in => data_in,
65
                ready_to_write => ready_to_write,
66
                strobe_write => strobe_write,
67
                ----------------------------------------
68
                data_out => data_out,
69
                ready_to_read => ready_to_read,
70
                strobe_read => strobe_read
71
        );
72
 
73
        -- Clock process definitions
74
        clk_process :process
75
        begin
76
                clk <= '0';
77
                wait for clk_period/2;
78
                clk <= '1';
79
                wait for clk_period/2;
80
        end process;
81
 
82
        stim_proc: PROCESS
83
        BEGIN
84
 
85
                reset <= '1';
86
                wait for clk_period*4;
87
                reset <= '0';
88
                wait for clk_period*4;
89
 
90
                data_in <= "00000010";
91
                wait for clk_period;
92
                strobe_write <= '1';
93
                wait for clk_period;
94
                strobe_write <= '0';
95
 
96
                wait for clk_period*4;
97
 
98
                data_in <= "00000011";
99
                wait for clk_period;
100
                strobe_write <= '1';
101
                wait for clk_period;
102
                strobe_write <= '0';
103
 
104
                wait for clk_period*4;
105
 
106
                strobe_read <= '1';
107
                wait for clk_period;
108
                strobe_read <= '0';
109
 
110
                wait for clk_period*4;
111
 
112
                strobe_read <= '1';
113
                wait for clk_period;
114
                strobe_read <= '0';
115
 
116
                wait for clk_period*4;
117
 
118
                data_in <= "00000100";
119
                wait for clk_period;
120
                strobe_write <= '1';
121
                wait for clk_period;
122
                strobe_write <= '0';
123
 
124
                wait for clk_period*4;
125
 
126
                strobe_read <= '1';
127
                wait for clk_period;
128
                strobe_read <= '0';
129
 
130
--              for i in 0 to 2**11-1 loop
131
--                      data_in <= conv_std_logic_vector(i, 8);
132
--                      wait for clk_period;
133
--                      strobe_write <= '1';
134
--                      wait until ready_to_write = '0';
135
--                      strobe_write <= '0';
136
--                      if i < 2**11-1 then
137
--                              wait until ready_to_write = '1';
138
--                      end if;
139
--              end loop; 
140
--              
141
--              wait for clk_period;
142
--              
143
--              strobe_read <= '1';
144
--              wait for clk_period;
145
--              strobe_read <= '0';
146
--              
147
--              wait for clk_period*3;
148
--              
149
--              for i in 0 to 1 loop
150
--                      data_in <= conv_std_logic_vector(i, 8);
151
--                      wait for clk_period;
152
--                      strobe_write <= '1';
153
--                      wait until ready_to_write = '0';
154
--                      strobe_write <= '0';
155
--                      wait until ready_to_write = '1';
156
--              end loop;
157
 
158
                wait; -- will wait forever
159
        END PROCESS;
160
 
161
END;

powered by: WebSVN 2.1.0

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