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

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [vhdl/] [test/] [RegMultiplexer_Test.vhd] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 Andrewski
 
2
--------------------------------------------------------------------------------
3
-- Company: 
4
-- Engineer:
5
--
6
-- Create Date:   20:43:38 11/14/2011
7
-- Design Name:   RegMultiplexer
8
-- Module Name:   J:/projekty/elektronika/USB_to_HPIB/usbToHpib/src/test/RegMultiplexer_Test.vhd
9
-- Project Name:  usbToGpib
10
-- Target Device:  
11
-- Tool versions:  
12
-- Description:   
13
-- 
14
-- VHDL Test Bench Created by ISE for module: RegMultiplexer
15
--
16
-- Dependencies:
17
-- 
18
-- Revision:
19
-- Revision 0.01 - File Created
20
-- Additional Comments:
21
--
22
-- Notes: 
23
-- This testbench has been automatically generated using types std_logic and
24
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends 
25
-- that these types always be used for the top-level I/O of a design in order 
26
-- to guarantee that the testbench will bind correctly to the post-implementation 
27
-- simulation model.
28
--------------------------------------------------------------------------------
29
LIBRARY ieee;
30
USE ieee.std_logic_1164.ALL;
31
USE ieee.std_logic_unsigned.all;
32
USE ieee.numeric_std.ALL;
33
 
34
use work.wrapperComponents.all;
35
 
36
ENTITY RegMultiplexer_Test_vhd IS
37
END RegMultiplexer_Test_vhd;
38
 
39
ARCHITECTURE behavior OF RegMultiplexer_Test_vhd IS
40
 
41
        -- clock definitions
42
        constant clk_period : time := 2ps;
43
        signal clk : std_logic := '0';
44
 
45
 
46
        --Inputs
47
        SIGNAL strobe :  std_logic := '0';
48
        SIGNAL data_in :  std_logic_vector(15 downto 0) := (others=>'0');
49
        SIGNAL reg_addr :  std_logic_vector(14 downto 0) := (others=>'0');
50
        SIGNAL reg_out_0 :  std_logic_vector(15 downto 0) := "0000000000000001";
51
        SIGNAL reg_out_1 :  std_logic_vector(15 downto 0) := "0000000000000010";
52
        SIGNAL reg_out_2 :  std_logic_vector(15 downto 0) := "0000000000000011";
53
        SIGNAL reg_out_3 :  std_logic_vector(15 downto 0) := "0000000000000100";
54
        SIGNAL reg_out_4 :  std_logic_vector(15 downto 0) := "0000000000000101";
55
        SIGNAL reg_out_5 :  std_logic_vector(15 downto 0) := "0000000000000110";
56
        SIGNAL reg_out_6 :  std_logic_vector(15 downto 0) := "0000000000000111";
57
        SIGNAL reg_out_7 :  std_logic_vector(15 downto 0) := "0000000000001000";
58
        SIGNAL reg_out_8 :  std_logic_vector(15 downto 0) := "0000000000001001";
59
        SIGNAL reg_out_9 :  std_logic_vector(15 downto 0) := "0000000000001010";
60
        SIGNAL reg_out_10 :  std_logic_vector(15 downto 0) := "0000000000001011";
61
        SIGNAL reg_out_11 :  std_logic_vector(15 downto 0) := "0000000000001100";
62
        SIGNAL reg_out_writer :  std_logic_vector(15 downto 0) := "0000000000001101";
63
        SIGNAL reg_out_reader :  std_logic_vector(15 downto 0) := "0000000000001110";
64
 
65
        --Outputs
66
        SIGNAL data_out :  std_logic_vector(15 downto 0);
67
        SIGNAL reg_strobe_0 :  std_logic;
68
        SIGNAL reg_in_0 :  std_logic_vector(15 downto 0);
69
        SIGNAL reg_strobe_1 :  std_logic;
70
        SIGNAL reg_in_1 :  std_logic_vector(15 downto 0);
71
        SIGNAL reg_strobe_2 :  std_logic;
72
        SIGNAL reg_in_2 :  std_logic_vector(15 downto 0);
73
        SIGNAL reg_strobe_3 :  std_logic;
74
        SIGNAL reg_in_3 :  std_logic_vector(15 downto 0);
75
        SIGNAL reg_strobe_4 :  std_logic;
76
        SIGNAL reg_in_4 :  std_logic_vector(15 downto 0);
77
        SIGNAL reg_strobe_5 :  std_logic;
78
        SIGNAL reg_in_5 :  std_logic_vector(15 downto 0);
79
        SIGNAL reg_strobe_6 :  std_logic;
80
        SIGNAL reg_in_6 :  std_logic_vector(15 downto 0);
81
        SIGNAL reg_strobe_7 :  std_logic;
82
        SIGNAL reg_in_7 :  std_logic_vector(15 downto 0);
83
        SIGNAL reg_strobe_8 :  std_logic;
84
        SIGNAL reg_in_8 :  std_logic_vector(15 downto 0);
85
        SIGNAL reg_strobe_9 :  std_logic;
86
        SIGNAL reg_in_9 :  std_logic_vector(15 downto 0);
87
        SIGNAL reg_strobe_10 :  std_logic;
88
        SIGNAL reg_in_10 :  std_logic_vector(15 downto 0);
89
        SIGNAL reg_strobe_11 :  std_logic;
90
        SIGNAL reg_in_11 :  std_logic_vector(15 downto 0);
91
        SIGNAL reg_strobe_writer :  std_logic;
92
        SIGNAL reg_in_writer :  std_logic_vector(15 downto 0);
93
        SIGNAL reg_strobe_reader :  std_logic;
94
        SIGNAL reg_in_reader :  std_logic_vector(15 downto 0);
95
 
96
BEGIN
97
 
98
        -- Instantiate the Unit Under Test (UUT)
99
        uut: RegMultiplexer generic map(READER_WRITER_BUF_LEN => 16) PORT MAP(
100
                strobe => strobe,
101
                data_in => data_in,
102
                data_out => data_out,
103
                reg_addr => reg_addr,
104
                reg_strobe_0 => reg_strobe_0,
105
                reg_in_0 => reg_in_0,
106
                reg_out_0 => reg_out_0,
107
                reg_strobe_1 => reg_strobe_1,
108
                reg_in_1 => reg_in_1,
109
                reg_out_1 => reg_out_1,
110
                reg_strobe_2 => reg_strobe_2,
111
                reg_in_2 => reg_in_2,
112
                reg_out_2 => reg_out_2,
113
                reg_strobe_3 => reg_strobe_3,
114
                reg_in_3 => reg_in_3,
115
                reg_out_3 => reg_out_3,
116
                reg_strobe_4 => reg_strobe_4,
117
                reg_in_4 => reg_in_4,
118
                reg_out_4 => reg_out_4,
119
                reg_strobe_5 => reg_strobe_5,
120
                reg_in_5 => reg_in_5,
121
                reg_out_5 => reg_out_5,
122
                reg_strobe_6 => reg_strobe_6,
123
                reg_in_6 => reg_in_6,
124
                reg_out_6 => reg_out_6,
125
                reg_strobe_7 => reg_strobe_7,
126
                reg_in_7 => reg_in_7,
127
                reg_out_7 => reg_out_7,
128
                reg_strobe_8 => reg_strobe_8,
129
                reg_in_8 => reg_in_8,
130
                reg_out_8 => reg_out_8,
131
                reg_strobe_9 => reg_strobe_9,
132
                reg_in_9 => reg_in_9,
133
                reg_out_9 => reg_out_9,
134
                reg_strobe_10 => reg_strobe_10,
135
                reg_in_10 => reg_in_10,
136
                reg_out_10 => reg_out_10,
137
                reg_strobe_11 => reg_strobe_11,
138
                reg_in_11 => reg_in_11,
139
                reg_out_11 => reg_out_11,
140
                reg_strobe_other0 => reg_strobe_writer,
141
                reg_in_other0 => reg_in_writer,
142
                reg_out_other0 => reg_out_writer,
143
                reg_strobe_other1 => reg_strobe_reader,
144
                reg_in_other1 => reg_in_reader,
145
                reg_out_other1 => reg_out_reader
146
        );
147
 
148
        -- Clock process definitions
149
        clk_process :process
150
        begin
151
                clk <= '0';
152
                wait for clk_period/2;
153
                clk <= '1';
154
                wait for clk_period/2;
155
        end process;
156
 
157
        strobe <= clk;
158
 
159
        stim_proc : PROCESS
160
        BEGIN
161
 
162
                data_in <= "1010101010101010";
163
 
164
                wait for clk_period * 10;
165
 
166
                report "$$$ begin RegMultiplexer test $$$";
167
 
168
                reg_addr <= "000000000000000";
169
                wait for clk_period * 10;
170
                reg_addr <= "000000000000001";
171
                wait for clk_period * 10;
172
                reg_addr <= "000000000000010";
173
                wait for clk_period * 10;
174
                reg_addr <= "000000000000011";
175
                wait for clk_period * 10;
176
                reg_addr <= "000000000000100";
177
                wait for clk_period * 10;
178
                reg_addr <= "000000000000101";
179
                wait for clk_period * 10;
180
                reg_addr <= "000000000000110";
181
                wait for clk_period * 10;
182
                reg_addr <= "000000000000111";
183
                wait for clk_period * 10;
184
                reg_addr <= "000000000001000";
185
                wait for clk_period * 10;
186
                reg_addr <= "000000000001001";
187
                wait for clk_period * 10;
188
                reg_addr <= "000000000001010";
189
                wait for clk_period * 10;
190
                reg_addr <= "000000000001011";
191
                wait for clk_period * 10;
192
                reg_addr <= "000000000001100";
193
                wait for clk_period * 10;
194
                reg_addr <= "000000000011100";
195
                wait for clk_period * 10;
196
 
197
                report "$$$ end RegMultiplexer test $$$";
198
 
199
                wait; -- will wait forever
200
        END PROCESS;
201
 
202
END;

powered by: WebSVN 2.1.0

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