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

Subversion Repositories core1990_interlaken

[/] [core1990_interlaken/] [trunk/] [gateware/] [simulation/] [interlaken_receiver_tb.vhd] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 N.Boukadid
library ieee;
2
use ieee.std_logic_1164.all;
3
 
4
entity testbench_interlaken_receiver is
5
end entity testbench_interlaken_receiver;
6
 
7
architecture tb_interlaken_receiver of testbench_interlaken_receiver is
8 9 N.Boukadid
 
9
    signal fifo_read_clk   : std_logic;
10
    signal clk                      : std_logic;
11
    signal reset                    : std_logic;
12
 
13
    signal RX_Data_In   : std_logic_vector(66 downto 0);
14
    signal RX_Data_Out  : std_logic_vector (63 downto 0);        -- Data ready to transmit
15
 
16
    signal RX_Valid_Out : std_logic;
17
 
18
    signal RX_SOP               : std_logic;                         -- Start of Packet
19
    signal RX_EOP_Valid         : std_logic_vector(2 downto 0);      -- Valid bytes packet contains
20
    signal RX_EOP               : std_logic;                         -- End of Packet
21
    signal RX_FlowControl       : std_logic_vector(15 downto 0);     -- Flow control data (yet unutilized)
22
    signal RX_prog_full     : std_logic_vector(15 downto 0);      -- Indication FIFO of this channel is full
23
    signal RX_Channel           : std_logic_vector(7 downto 0);      -- Select transmit channel (yet unutilized)
24
    signal RX_Datavalid     : std_logic;
25
 
26
    signal CRC24_Error       : std_logic;
27
    signal CRC32_Error       : std_logic;
28
    signal Decoder_lock      : std_logic;
29
    signal Descrambler_lock  : std_logic;
30
 
31
    signal Data_Descrambler : std_logic_vector(63 downto 0);
32
    signal Data_Decoder     : std_logic_vector(63 downto 0);
33
 
34
    signal RX_FIFO_Full     : std_logic;
35
    signal RX_FIFO_Read     : std_logic;
36
 
37
    signal RX_Link_Up      : std_logic;
38
    signal Bitslip         : std_logic;
39 6 N.Boukadid
 
40
        constant CLK_PERIOD : time := 10 ns;
41
 
42
begin
43 9 N.Boukadid
    uut : entity work.interlaken_receiver
44
    port map (
45
        write_clk => write_clk,
46
        clk => clk,
47
        reset => reset,
48
        RX_Data_In => RX_Data_In,
49
        RX_Data_Out => RX_Data_Out,
50
        RX_Enable => RX_Enable,
51
        RX_SOP => RX_SOP,
52
        RX_ValidBytes => RX_ValidBytes,
53
        RX_EOP => RX_EOP,
54
        RX_FlowControl => RX_FlowControl,
55
        RX_Channel => RX_Channel,
56
 
57
        RX_Link_Up => RX_Link_Up
58
    );
59 6 N.Boukadid
 
60 9 N.Boukadid
    Clk_process :process
61
    begin
62
        write_clk <= '1';
63
        clk <= '1';
64
        wait for CLK_PERIOD/2;  --for half of clock period clk stays at '0'.
65
        clk <= '0';
66
        write_clk <= '0';
67
        wait for CLK_PERIOD/2;  --for next half of clock period clk stays at '1'.
68
    end process;
69
 
70 6 N.Boukadid
    simulation : process
71
    begin
72
        wait for 1 ps;
73
        RX_Data_In <= (others=>'0');
74
        reset <= '1';
75 9 N.Boukadid
        wait for CLK_PERIOD*2;
76 6 N.Boukadid
 
77
        reset <= '0';
78
        reset <= '0';
79
        RX_Data_in <= "101" & X"1f5e5d5c5b5a5958";
80
        wait for CLK_PERIOD;
81
 
82
        RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
83
        wait for CLK_PERIOD;
84
 
85
        RX_Data_In <= "101" & X"3f5e5d5c5b5a5958";
86
        wait for CLK_PERIOD;
87
 
88
        RX_Data_In <= "101" & X"4f21a2a3a4a5a6a7";
89
        wait for CLK_PERIOD;
90
 
91
        RX_Data_In <= "101" & X"5f5e5a5c5b60f2a0";
92
        wait for CLK_PERIOD;
93
 
94
        RX_Data_In  <= "001" & X"635e22a3a4a5a7a7";
95
        wait for CLK_PERIOD;
96
 
97
        RX_Data_In  <= "101" & X"70000FFF000000F0";
98
        wait for CLK_PERIOD*2;
99
 
100
 
101
        RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
102 9 N.Boukadid
        wait for CLK_PERIOD*2;
103 6 N.Boukadid
 
104
        RX_Data_In  <= "110" & X"8050505050050505";
105
        wait for CLK_PERIOD*3;
106
 
107
        RX_Data_In  <= "101" & X"9486576758050505";
108
        wait for CLK_PERIOD;
109
 
110
        RX_Data_In <= "101" & X"60b35d5dc4a582a7";
111
        wait for CLK_PERIOD;
112
 
113
        RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
114
        wait for CLK_PERIOD*12;
115
 
116
        RX_Data_In <= "111" & X"2f5e5d5c5b5a5958";
117
        wait for CLK_PERIOD;
118
 
119
        RX_Data_In <= "101" & X"1f5e5d5c5b5a5958";
120
        wait for CLK_PERIOD;
121
 
122
        RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
123
        wait for CLK_PERIOD;
124
 
125
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
126
        wait for CLK_PERIOD;
127
 
128
        RX_Data_In <= "001" & X"70000FFF000000F0";
129
        wait for CLK_PERIOD*21;
130
 
131
        RX_Data_In <= "001" & X"78f6_78f6_78f6_78f6"; --Sync & 
132
        wait for CLK_PERIOD;
133
 
134
        RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
135
        wait for CLK_PERIOD;
136
 
137
        RX_Data_In <= "101" & X"3f5e5d5c5b5a5958";
138
        wait for CLK_PERIOD;
139
 
140
        RX_Data_In <= "101" & X"4f21a2a3a4a5a6a7";
141
        wait for CLK_PERIOD;
142
 
143
        RX_Data_In <= "101" & X"5f5e5a5c5b60f2a0";
144
        wait for CLK_PERIOD;
145
 
146
        RX_Data_In  <= "001" & X"635e22a3a4a5a7a7";
147
        wait for CLK_PERIOD;
148
 
149
        RX_Data_In  <= "101" & X"70000FFF000000F0";
150
        wait for CLK_PERIOD*2;
151
 
152
        RX_Data_In <= "001" & X"2Bfe_d100_19e0_1dbd";
153
        wait for CLK_PERIOD;
154
 
155
        RX_Data_In <= "001" & X"70000FFF000000F0";
156
        wait for CLK_PERIOD*2;
157
 
158
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
159
        wait for CLK_PERIOD;
160
 
161
        RX_Data_In <= "101" & X"3f5e5d5c5b5a5958";
162
        wait for CLK_PERIOD*10;
163
 
164
 
165
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
166
        wait for CLK_PERIOD;
167
 
168
        RX_Data_In <= "001" & X"8050505050050505";
169
        wait for CLK_PERIOD*3;
170
 
171
        RX_Data_In <= "001" & X"9486576758050505";
172
        wait for CLK_PERIOD;
173
 
174
 
175
        RX_Data_In <= "101" & X"4f21a2a3a4a5a6a7";
176
        wait for CLK_PERIOD*20;
177
 
178
        RX_Data_In <= "101" & X"5f5e5a5c5b60f2a0";
179
        wait for CLK_PERIOD*10;
180
 
181
        RX_Data_In  <= "001" & X"635e22a3a4a5a7a7";
182
        wait for CLK_PERIOD;
183
 
184
        RX_Data_In <= "101" & X"5f5e5a5c5b60f2a0";
185
        wait for CLK_PERIOD;
186
 
187
        RX_Data_In  <= "001" & X"635e22a3a4a5a7a7";
188
        wait for CLK_PERIOD;
189
 
190
        RX_Data_In  <= "101" & X"70000FFF000000F0";
191
        wait for CLK_PERIOD*6;
192
 
193
        RX_Data_In <= "001" & X"8050505050050505";
194 9 N.Boukadid
        wait for CLK_PERIOD*9;
195 6 N.Boukadid
 
196
        RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
197
        wait for CLK_PERIOD;
198
 
199
        RX_Data_In  <= "110" & X"8050505050050505";
200
        wait for CLK_PERIOD*3;
201
 
202
        RX_Data_In  <= "101" & X"9486576758050505";
203
        wait for CLK_PERIOD;
204
 
205
        RX_Data_In <= "001" & X"1f5e5d5c5b5a5958";
206
        wait for CLK_PERIOD;
207
 
208
        RX_Data_In <= "010" & X"78f6_78f6_78f6_78f6"; --1
209
        wait for CLK_PERIOD;
210
 
211
        RX_Data_In <= "001" & X"3f5e5d5c5b5a5958";
212
        wait for CLK_PERIOD*23;
213
 
214
        RX_Data_In <= "010" & X"78f6_78f6_78f6_78f6";--2
215
        wait for CLK_PERIOD;
216
 
217
        RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
218
        wait for CLK_PERIOD*23;
219
 
220
        RX_Data_In <= "010" & X"78f6_78f6_78f6_78f6";--3
221
        wait for CLK_PERIOD;
222
 
223
        RX_Data_In <= "001" & X"70000FFF000000F0";
224
        wait for CLK_PERIOD*23;
225 9 N.Boukadid
 
226 6 N.Boukadid
        RX_Data_In <= "010" & X"78f6_78f6_78f6_78f6";--4 -> lock
227
        wait for CLK_PERIOD;
228
 
229
        RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
230
        wait for CLK_PERIOD;
231
 
232
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
233
        wait for CLK_PERIOD;
234
 
235
        RX_Data_In <= "001" & X"70000FFF000000F0";
236
        wait for CLK_PERIOD*21;
237
 
238
        RX_Data_In <= "010" & X"78f6_78f6_78f6_78f6"; --Sync & 
239
        wait for CLK_PERIOD;
240
 
241
        RX_Data_In <= "010" & X"2Bfe_d100_19e0_1dbd";
242
        wait for CLK_PERIOD;
243
 
244
        RX_Data_In <= "010" & X"1e1e_1e1e_1e1e_1e1e";
245
        wait for CLK_PERIOD;
246
 
247
        RX_Data_In <= "001" & X"70000FFF000000F0";
248
        wait for CLK_PERIOD*2;
249
 
250
        RX_Data_In <= "010" & X"E000_0001_0000_0000";
251
        wait for CLK_PERIOD*3;
252
 
253
        RX_Data_In <= "001" & X"9486576758050505";
254
        wait for CLK_PERIOD;
255
 
256
        RX_Data_In <= "001" & X"60b35d5dc4a582a7";
257
        wait for CLK_PERIOD;
258
 
259
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
260
        wait for CLK_PERIOD*5;
261
 
262
        RX_Data_In <= "001" & X"1f5e5d5c5b5a5958";
263
        wait for CLK_PERIOD*3;
264
 
265
        RX_Data_In <= "010" & X"6400_0000_6222_431a";
266
        wait for clk_period;
267
 
268
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
269
        wait for CLK_PERIOD;
270
 
271
        RX_Data_In <= "001" & X"9486576758050505";
272
        wait for CLK_PERIOD*19;
273
 
274
        wait for CLK_PERIOD;
275
 
276
        RX_Data_In <= "001" & X"8050505050050505";
277
        wait for CLK_PERIOD*3;
278
 
279
        RX_Data_In <= "001" & X"9486576758050505";
280
        wait for CLK_PERIOD;
281
 
282
        RX_Data_In <= "001" & X"60b35d5dc4a582a7";
283
        wait for CLK_PERIOD;
284
 
285
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
286
        wait for CLK_PERIOD*12;
287
 
288
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
289
        wait for CLK_PERIOD;
290
 
291
        RX_Data_In <= "001" & X"1f5e5d5c5b5a5958";
292
        wait for CLK_PERIOD;
293
 
294
 
295
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
296
        wait for CLK_PERIOD;
297
 
298
        RX_Data_In <= "001" & X"3f5e5d5c5b5a5958";
299
        wait for CLK_PERIOD;
300
 
301
        RX_Data_In <= "001" & X"4f21a2a3a4a5a6a7";
302
        wait for CLK_PERIOD;
303
 
304
        RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
305
        wait for CLK_PERIOD;
306
 
307
        RX_Data_In <= "001" & X"635e22a3a4a5a7a7";
308
        wait for CLK_PERIOD;
309
 
310
        RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
311
        wait for CLK_PERIOD;
312
 
313
        RX_Data_In <= "001" & X"635e22a3a4a5a7a7";
314
        wait for CLK_PERIOD;
315
 
316
        RX_Data_In <= "001" & X"70000FFF000000F0";
317
        wait for CLK_PERIOD*2;
318
 
319
        RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
320
        wait for CLK_PERIOD;
321
 
322
        RX_Data_In <= "001" & X"8050505050050505";
323
        wait for CLK_PERIOD*3;
324
 
325
        RX_Data_In <= "001" & X"9486576758050505";
326
        wait for CLK_PERIOD;
327
 
328
        RX_Data_In <= "001" & X"60b35d5dc4a582a7";
329
        wait for CLK_PERIOD*60;
330
 
331
        RX_Data_In <= "001" & X"8050505050050505";
332
        wait for CLK_PERIOD*3;
333
 
334
        RX_Data_In <= "001" & X"9486576758050505";
335
        wait for CLK_PERIOD;
336
 
337
        RX_Data_In <= "001" & X"60b35d5dc4a582a7";
338
        wait for CLK_PERIOD;
339
 
340
        RX_Data_In <= "101" & X"60b35d5dc4a582a7";
341
        wait for CLK_PERIOD*60;
342
 
343
        RX_Data_In  <= "110" & X"8050505050050505";
344
        wait for CLK_PERIOD*3;
345
 
346
        RX_Data_In  <= "101" & X"9486576758050505";
347
        wait for CLK_PERIOD;
348
 
349
        RX_Data_In <= "101" & X"60b35d5dc4a582a7";
350
        wait for CLK_PERIOD;
351
 
352
        RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
353
        wait for CLK_PERIOD*12;
354
 
355
        RX_Data_In <= "111" & X"2c8e5d5c5b5a5958";
356
        wait for CLK_PERIOD;
357
 
358
        RX_Data_In <= "101" & X"1f5e5d5c5b5a5958";
359
        wait for CLK_PERIOD*26;
360
 
361
        RX_Data_In <= "111" & X"2c8e5d5c5b5a5958";
362
        wait for CLK_PERIOD*18;
363
 
364
        RX_Data_In <= "101" & X"1f5e5d5c5b5a5958";
365
        wait;
366 9 N.Boukadid
 
367 6 N.Boukadid
    end process;
368
 
369
end architecture tb_interlaken_receiver;
370
 
371
 

powered by: WebSVN 2.1.0

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