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

Subversion Repositories rio

[/] [rio/] [branches/] [parallelSymbols/] [bench/] [vhdl/] [TestRioPacketBuffer.vhd] - Blame information for rev 26

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

Line No. Rev Author Line
1 3 magro732
-------------------------------------------------------------------------------
2
-- 
3
-- RapidIO IP Library Core
4
-- 
5
-- This file is part of the RapidIO IP library project
6
-- http://www.opencores.org/cores/rio/
7
-- 
8
-- Description
9
-- Contains automatic simulation test code to verify a RioPacketBufferWindow
10
-- implementation.
11
-- 
12
-- To Do:
13
-- -
14
-- 
15
-- Author(s): 
16
-- - Magnus Rosenius, magro732@opencores.org 
17
-- 
18
-------------------------------------------------------------------------------
19
-- 
20
-- Copyright (C) 2013 Authors and OPENCORES.ORG 
21
-- 
22
-- This source file may be used and distributed without 
23
-- restriction provided that this copyright statement is not 
24
-- removed from the file and that any derivative work contains 
25
-- the original copyright notice and the associated disclaimer. 
26
-- 
27
-- This source file is free software; you can redistribute it 
28
-- and/or modify it under the terms of the GNU Lesser General 
29
-- Public License as published by the Free Software Foundation; 
30
-- either version 2.1 of the License, or (at your option) any 
31
-- later version. 
32
-- 
33
-- This source is distributed in the hope that it will be 
34
-- useful, but WITHOUT ANY WARRANTY; without even the implied 
35
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
36
-- PURPOSE. See the GNU Lesser General Public License for more 
37
-- details. 
38
-- 
39
-- You should have received a copy of the GNU Lesser General 
40
-- Public License along with this source; if not, download it 
41
-- from http://www.opencores.org/lgpl.shtml 
42
-- 
43
-------------------------------------------------------------------------------
44
 
45
-------------------------------------------------------------------------------
46
-- TestRioPacketBuffer.
47
-------------------------------------------------------------------------------
48
 
49
library ieee;
50
use ieee.std_logic_1164.all;
51
use ieee.numeric_std.all;
52
use ieee.math_real.all;
53
library std;
54
use std.textio.all;
55
use work.rio_common.all;
56
 
57
 
58
-------------------------------------------------------------------------------
59
-- Entity for TestRioPacketBuffer.
60
-------------------------------------------------------------------------------
61
entity TestRioPacketBuffer is
62
end entity;
63
 
64
 
65
-------------------------------------------------------------------------------
66
-- Architecture for TestRioPacketBuffer.
67
-------------------------------------------------------------------------------
68
architecture TestRioPacketBufferImpl of TestRioPacketBuffer is
69
 
70
  component RioPacketBufferWindow is
71
    port(
72
      clk : in std_logic;
73
      areset_n : in std_logic;
74
 
75
      inboundWriteFrameFull_o : out std_logic;
76
      inboundWriteFrame_i : in std_logic;
77
      inboundWriteFrameAbort_i : in std_logic;
78
      inboundWriteContent_i : in std_logic;
79
      inboundWriteContentData_i : in std_logic_vector(31 downto 0);
80
      inboundReadFrameEmpty_o : out std_logic;
81
      inboundReadFrame_i : in std_logic;
82
      inboundReadFrameRestart_i : in std_logic;
83
      inboundReadFrameAborted_o : out std_logic;
84
      inboundReadContentEmpty_o : out std_logic;
85
      inboundReadContent_i : in std_logic;
86
      inboundReadContentEnd_o : out std_logic;
87
      inboundReadContentData_o : out std_logic_vector(31 downto 0);
88
 
89
      outboundWriteFrameFull_o : out std_logic;
90
      outboundWriteFrame_i : in std_logic;
91
      outboundWriteFrameAbort_i : in std_logic;
92
      outboundWriteContent_i : in std_logic;
93
      outboundWriteContentData_i : in std_logic_vector(31 downto 0);
94
      outboundReadFrameEmpty_o : out std_logic;
95
      outboundReadFrame_i : in std_logic;
96
      outboundReadFrameRestart_i : in std_logic;
97
      outboundReadFrameAborted_o : out std_logic;
98
      outboundReadWindowEmpty_o : out std_logic;
99
      outboundReadWindowReset_i : in std_logic;
100
      outboundReadWindowNext_i : in std_logic;
101
      outboundReadContentEmpty_o : out std_logic;
102
      outboundReadContent_i : in std_logic;
103
      outboundReadContentEnd_o : out std_logic;
104
      outboundReadContentData_o : out std_logic_vector(31 downto 0));
105
  end component;
106
 
107
  signal clk : std_logic;
108
  signal areset_n : std_logic;
109
 
110
  signal inboundWriteFrameFull : std_logic;
111
  signal inboundWriteFrame : std_logic;
112
  signal inboundWriteFrameAbort : std_logic;
113
  signal inboundWriteContent : std_logic;
114
  signal inboundWriteContentData : std_logic_vector(31 downto 0);
115
  signal inboundReadFrameEmpty : std_logic;
116
  signal inboundReadFrame : std_logic;
117
  signal inboundReadFrameRestart : std_logic;
118
  signal inboundReadFrameAborted : std_logic;
119
  signal inboundReadContentEmpty : std_logic;
120
  signal inboundReadContent : std_logic;
121
  signal inboundReadContentEnd : std_logic;
122
  signal inboundReadContentData : std_logic_vector(31 downto 0);
123
 
124
  signal outboundWriteFrameFull : std_logic;
125
  signal outboundWriteFrame : std_logic;
126
  signal outboundWriteFrameAbort : std_logic;
127
  signal outboundWriteContent : std_logic;
128
  signal outboundWriteContentData : std_logic_vector(31 downto 0);
129
  signal outboundReadFrameEmpty : std_logic;
130
  signal outboundReadFrame : std_logic;
131
  signal outboundReadFrameRestart : std_logic;
132
  signal outboundReadFrameAborted : std_logic;
133
  signal outboundReadWindowEmpty : std_logic;
134
  signal outboundReadWindowReset : std_logic;
135
  signal outboundReadWindowNext : std_logic;
136
  signal outboundReadContentEmpty : std_logic;
137
  signal outboundReadContent : std_logic;
138
  signal outboundReadContentEnd : std_logic;
139
  signal outboundReadContentData : std_logic_vector(31 downto 0);
140
 
141
begin
142
 
143
  -----------------------------------------------------------------------------
144
  -- Clock generation.
145
  -----------------------------------------------------------------------------
146
  ClockGenerator: process
147
  begin
148
    clk <= '0';
149
    wait for 20 ns;
150
    clk <= '1';
151
    wait for 20 ns;
152
  end process;
153
 
154
 
155
  -----------------------------------------------------------------------------
156
  -- Test case driver.
157
  -----------------------------------------------------------------------------
158
  TestDriver: process
159
    ---------------------------------------------------------------------------
160
    -- Inbound procedures.
161
    ---------------------------------------------------------------------------
162
 
163
    procedure SetInboundWriteContent(
164
      constant content : in std_logic_vector(31 downto 0)) is
165
    begin
166
      assert inboundWriteFrameFull = '0'
167
        report "Inbound frame cannot be accepted." severity error;
168
 
169
      inboundWriteContent <= '1';
170
      inboundWriteContentData <= content;
171
      wait until clk'event and clk = '1';
172
      wait for 1 ns;
173
      inboundWriteContent <= '0';
174
      inboundWriteContentData <= (others=>'U');
175
    end procedure;
176
 
177
    procedure SetInboundWriteFrame is
178
    begin
179
      inboundWriteFrame <= '1';
180
      wait until clk'event and clk = '1';
181
      wait for 1 ns;
182
 
183
      inboundWriteFrame <= '0';
184
    end procedure;
185
 
186
    procedure SetInboundWriteFrameAbort is
187
    begin
188
      inboundWriteFrameAbort <= '1';
189
      wait until clk'event and clk = '1';
190
      wait for 1 ns;
191
 
192
      inboundWriteFrameAbort <= '0';
193
    end procedure;
194
 
195
    procedure SetInboundReadContent(
196
      constant content : in std_logic_vector(31 downto 0)) is
197
    begin
198
      inboundReadContent <= '1';
199
      wait until clk'event and clk = '1';
200
      wait for 1 ns;
201
 
202
      assert (inboundReadContentData = content)
203
        report "Unexpected content read." severity error;
204
      assert (inboundReadContentEnd = '0')
205
        report "Unexpected content end." severity error;
206
 
207
      inboundReadContent <= '0';
208
    end procedure;
209
 
210
    procedure SetInboundReadContentEnd is
211
    begin
212
      inboundReadContent <= '1';
213
      wait until clk'event and clk = '1';
214
      wait for 1 ns;
215
 
216
      assert (inboundReadContentEnd = '1')
217
        report "Unexpected content end." severity error;
218
 
219
      inboundReadContent <= '0';
220
    end procedure;
221
 
222
    procedure SetInboundReadFrame is
223
    begin
224
      assert inboundReadFrameEmpty = '0'
225
        report "No pending inbound frame to be read." severity error;
226
 
227
      inboundReadFrame <= '1';
228
      wait until clk'event and clk = '1';
229
      wait for 1 ns;
230
 
231
      inboundReadFrame <= '0';
232
    end procedure;
233
 
234
    procedure SetInboundReadFrameRestart is
235
    begin
236
      inboundReadFrameRestart <= '1';
237
      wait until clk'event and clk = '1';
238
      wait for 1 ns;
239
 
240
      inboundReadFrameRestart <= '0';
241
    end procedure;
242
 
243
    ---------------------------------------------------------------------------
244
    -- Outbound procedures.
245
    ---------------------------------------------------------------------------
246
 
247
    procedure SetOutboundWriteContent(
248
      constant content : in std_logic_vector(31 downto 0)) is
249
    begin
250
      assert outboundWriteFrameFull = '0'
251
        report "Outbound frame cannot be accepted." severity error;
252
 
253
      outboundWriteContent <= '1';
254
      outboundWriteContentData <= content;
255
      wait until clk'event and clk = '1';
256
      wait for 1 ns;
257
      outboundWriteContent <= '0';
258
      outboundWriteContentData <= (others=>'U');
259
    end procedure;
260
 
261
    procedure SetOutboundWriteFrame is
262
    begin
263
      assert outboundWriteFrameFull = '0'
264
        report "Outbound frame cannot be accepted." severity error;
265
 
266
      outboundWriteFrame <= '1';
267
      wait until clk'event and clk = '1';
268
      wait for 1 ns;
269
 
270
      outboundWriteFrame <= '0';
271
    end procedure;
272
 
273
    procedure SetOutboundWriteFrameAbort is
274
    begin
275
      outboundWriteFrameAbort <= '1';
276
      wait until clk'event and clk = '1';
277
      wait for 1 ns;
278
 
279
      outboundWriteFrameAbort <= '0';
280
    end procedure;
281
 
282
    procedure SetOutboundReadContent(
283 16 magro732
      constant content : in std_logic_vector(31 downto 0);
284
      constant ending : in std_logic := '0') is
285 3 magro732
    begin
286
      outboundReadContent <= '1';
287
      wait until clk'event and clk = '1';
288
      wait for 1 ns;
289
 
290
      assert (outboundReadContentData = content)
291
        report "Unexpected content read." severity error;
292 16 magro732
      assert (outboundReadContentEnd = ending)
293 3 magro732
        report "Unexpected content end." severity error;
294
 
295
      outboundReadContent <= '0';
296
    end procedure;
297
 
298
    procedure SetOutboundReadFrame is
299
    begin
300
      assert outboundReadFrameEmpty = '0'
301
        report "No pending outbound frame to be read." severity error;
302
 
303
      outboundReadFrame <= '1';
304
      wait until clk'event and clk = '1';
305
      wait for 1 ns;
306
 
307
      outboundReadFrame <= '0';
308
    end procedure;
309
 
310
    procedure SetOutboundReadFrameRestart is
311
    begin
312
      outboundReadFrameRestart <= '1';
313
      wait until clk'event and clk = '1';
314
      wait for 1 ns;
315
 
316
      outboundReadFrameRestart <= '0';
317
    end procedure;
318
 
319
    procedure SetOutboundReadWindowReset is
320
    begin
321
      outboundReadWindowReset <= '1';
322
      wait until clk'event and clk = '1';
323
      wait for 1 ns;
324
 
325
      outboundReadWindowReset <= '0';
326
    end procedure;
327
 
328
    procedure SetOutboundReadWindowNext is
329
    begin
330
      assert outboundReadWindowEmpty = '0'
331
        report "No pending outbound window frame to be read." severity error;
332
 
333
      outboundReadWindowNext <= '1';
334
      wait until clk'event and clk = '1';
335
      wait for 1 ns;
336
 
337
      outboundReadWindowNext <= '0';
338
    end procedure;
339
 
340
  begin
341
    inboundWriteFrame <= '0';
342
    inboundWriteFrameAbort <= '0';
343
    inboundWriteContent <= '0';
344
    inboundWriteContentData <= (others=>'U');
345
    inboundReadFrame <= '0';
346
    inboundReadFrameRestart <= '0';
347
    inboundReadContent <= '0';
348
 
349
    outboundWriteFrame <= '0';
350
    outboundWriteFrameAbort <= '0';
351
    outboundWriteContent <= '0';
352
    outboundWriteContentData <= (others=>'U');
353
    outboundReadFrame <= '0';
354
    outboundReadFrameRestart <= '0';
355
    outboundReadWindowReset <= '0';
356
    outboundReadWindowNext <= '0';
357
    outboundReadContent <= '0';
358
 
359
    areset_n <= '0';
360
    wait until clk'event and clk = '1';
361
    wait until clk'event and clk = '1';
362
    areset_n <= '1';
363
    wait until clk'event and clk = '1';
364
    wait until clk'event and clk = '1';
365
 
366
    ---------------------------------------------------------------------------
367
    PrintS("-----------------------------------------------------------------");
368
    PrintS("TG_RioPacketBuffer");
369
    PrintS("-----------------------------------------------------------------");
370
    PrintS("TG_RioPacketBuffer-TC1");
371
    PrintS("Description: Test normal operation without using the window. Only");
372
    PrintS("             full frames are tested.");
373
    PrintS("Requirement: XXXXX");
374
    PrintS("-----------------------------------------------------------------");
375
    PrintS("Step 1:");
376
    PrintS("Action: Complete a small frame and read it.");
377
    PrintS("Result: The read frame should be equal to the one written.");
378
    ---------------------------------------------------------------------------
379
    PrintR("TG_RioPacketBuffer-TC1-Step1");
380
    ---------------------------------------------------------------------------
381
    -- REMARK: Update testcases for inbound and outbound...
382
 
383
    assert (inboundWriteFrameFull = '0')
384
      report "Unexpected writeFrameFull." severity error;
385
    assert (inboundReadFrameEmpty = '1')
386
      report "Unexpected readFrameEmpty." severity error;
387
 
388
    SetInboundWriteContent(x"deadbeef");
389
 
390
    assert (inboundWriteFrameFull = '0')
391
      report "Unexpected writeFrameFull." severity error;
392
    assert (inboundReadFrameEmpty = '1')
393
      report "Unexpected readFrameEmpty." severity error;
394
 
395
    SetInboundWriteFrame;
396
 
397
    assert (inboundWriteFrameFull = '0')
398
      report "Unexpected writeFrameFull." severity error;
399
    assert (inboundReadFrameEmpty = '0')
400
      report "Unexpected readFrameEmpty." severity error;
401
 
402
    SetInboundReadContent(x"deadbeef");
403
 
404
    assert (inboundWriteFrameFull = '0')
405
      report "Unexpected writeFrameFull." severity error;
406
    assert (inboundReadFrameEmpty = '0')
407
      report "Unexpected readFrameEmpty." severity error;
408
 
409
    SetInboundReadContentEnd;
410
 
411
    assert (inboundWriteFrameFull = '0')
412
      report "Unexpected writeFrameFull." severity error;
413
    assert (inboundReadFrameEmpty = '0')
414
      report "Unexpected readFrameEmpty." severity error;
415
 
416
    SetInboundReadFrame;
417
 
418
    assert (inboundWriteFrameFull = '0')
419
      report "Unexpected writeFrameFull." severity error;
420
    assert (inboundReadFrameEmpty = '1')
421
      report "Unexpected readFrameEmpty." severity error;
422
 
423
    ---------------------------------------------------------------------------
424
    PrintS("-----------------------------------------------------------------");
425
    PrintS("Step 2:");
426
    PrintS("Action: Write a rio maximum size frame and read it.");
427
    PrintS("Result: The read frame should be equal to the one written.");
428
    ---------------------------------------------------------------------------
429
    PrintR("TG_RioPacketBuffer-TC1-Step2");
430
    ---------------------------------------------------------------------------
431
 
432
    for i in 0 to 68 loop
433
      SetInboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
434
 
435
      assert (inboundWriteFrameFull = '0')
436
        report "Unexpected writeFrameFull." severity error;
437
      assert (inboundReadFrameEmpty = '1')
438
        report "Unexpected readFrameEmpty." severity error;
439
    end loop;
440
 
441
    SetInboundWriteFrame;
442
 
443
    assert (inboundWriteFrameFull = '0')
444
      report "Unexpected writeFrameFull." severity error;
445
    assert (inboundReadFrameEmpty = '0')
446
      report "Unexpected readFrameEmpty." severity error;
447
 
448
    for i in 0 to 68 loop
449
      SetInboundReadContent(std_logic_vector(to_unsigned(i, 32)));
450
 
451
      assert (inboundWriteFrameFull = '0')
452
        report "Unexpected writeFrameFull." severity error;
453
      assert (inboundReadFrameEmpty = '0')
454
        report "Unexpected readFrameEmpty." severity error;
455
    end loop;
456
 
457
    SetInboundReadContentEnd;
458
 
459
    assert (inboundWriteFrameFull = '0')
460
      report "Unexpected writeFrameFull." severity error;
461
    assert (inboundReadFrameEmpty = '0')
462
      report "Unexpected readFrameEmpty." severity error;
463
 
464
    SetInboundReadFrame;
465
 
466
    assert (inboundWriteFrameFull = '0')
467
      report "Unexpected writeFrameFull." severity error;
468
    assert (inboundReadFrameEmpty = '1')
469
      report "Unexpected readFrameEmpty." severity error;
470
 
471
    ---------------------------------------------------------------------------
472
    PrintS("-----------------------------------------------------------------");
473
    PrintS("Step 3:");
474
    PrintS("Action: Fill the maximum number of small frames without filling ");
475
    PrintS("        the memory.");
476
    PrintS("Result: The frame buffer should accept 63 frames.");
477
    ---------------------------------------------------------------------------
478
    PrintR("TG_RioPacketBuffer-TC1-Step3");
479
    ---------------------------------------------------------------------------
480
 
481
    ---------------------------------------------------------------------------
482
    -- Write maximum number of frames.
483
    ---------------------------------------------------------------------------
484
 
485
    for i in 0 to 2 loop
486
      SetInboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
487
      assert (inboundWriteFrameFull = '0')
488
        report "Unexpected writeFrameFull." severity error;
489
      assert (inboundReadFrameEmpty = '1')
490
        report "Unexpected readFrameEmpty." severity error;
491
    end loop;
492
 
493
    for j in 1 to 62 loop
494
      SetInboundWriteFrame;
495
      assert (inboundWriteFrameFull = '0')
496
        report "Unexpected writeFrameFull." severity error;
497
      assert (inboundReadFrameEmpty = '0')
498
        report "Unexpected readFrameEmpty." severity error;
499
 
500
      for i in 0 to 2 loop
501
        SetInboundWriteContent(std_logic_vector(to_unsigned(j+i, 32)));
502
 
503
        assert (inboundWriteFrameFull = '0')
504
          report "Unexpected writeFrameFull." severity error;
505
        assert (inboundReadFrameEmpty = '0')
506
          report "Unexpected readFrameEmpty." severity error;
507
      end loop;
508
    end loop;
509
 
510
    SetInboundWriteFrame;
511
    assert (inboundWriteFrameFull = '1')
512
      report "Unexpected writeFrameFull." severity error;
513
    assert (inboundReadFrameEmpty = '0')
514
      report "Unexpected readFrameEmpty." severity error;
515
 
516
    ---------------------------------------------------------------------------
517
    -- Read the frames written in the above steps.
518
    ---------------------------------------------------------------------------
519
 
520
    for i in 0 to 2 loop
521
      SetInboundReadContent(std_logic_vector(to_unsigned(i, 32)));
522
 
523
      assert (inboundWriteFrameFull = '1')
524
        report "Unexpected writeFrameFull." severity error;
525
      assert (inboundReadFrameEmpty = '0')
526
        report "Unexpected readFrameEmpty." severity error;
527
    end loop;
528
 
529
    SetInboundReadContentEnd;
530
    assert (inboundWriteFrameFull = '1')
531
      report "Unexpected writeFrameFull." severity error;
532
    assert (inboundReadFrameEmpty = '0')
533
      report "Unexpected readFrameEmpty." severity error;
534
 
535
    for j in 1 to 62 loop
536
      SetInboundReadFrame;
537
      assert (inboundWriteFrameFull = '0')
538
        report "Unexpected writeFrameFull." severity error;
539
      assert (inboundReadFrameEmpty = '0')
540
        report "Unexpected readFrameEmpty." severity error;
541
 
542
      for i in 0 to 2 loop
543
        SetInboundReadContent(std_logic_vector(to_unsigned(j+i, 32)));
544
 
545
        assert (inboundWriteFrameFull = '0')
546
          report "Unexpected writeFrameFull." severity error;
547
        assert (inboundReadFrameEmpty = '0')
548
          report "Unexpected readFrameEmpty." severity error;
549
      end loop;
550
 
551
      SetInboundReadContentEnd;
552
      assert (inboundWriteFrameFull = '0')
553
        report "Unexpected writeFrameFull." severity error;
554
      assert (inboundReadFrameEmpty = '0')
555
        report "Unexpected readFrameEmpty." severity error;
556
    end loop;
557
 
558
    SetInboundReadFrame;
559
    assert (inboundWriteFrameFull = '0')
560
      report "Unexpected writeFrameFull." severity error;
561
    assert (inboundReadFrameEmpty = '1')
562
      report "Unexpected readFrameEmpty." severity error;
563
 
564
    ---------------------------------------------------------------------------
565
    PrintS("-----------------------------------------------------------------");
566
    PrintS("Step 4:");
567
    PrintS("Action: Fill the memory to its limit.");
568
    PrintS("Result: The frame buffer should accept 255-69 words.");
569
    ---------------------------------------------------------------------------
570
    PrintR("TG_RioPacketBuffer-TC1-Step4");
571
    ---------------------------------------------------------------------------
572
 
573
    for i in 0 to 186 loop
574
      SetInboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
575
      assert (inboundWriteFrameFull = '0')
576
        report "Unexpected writeFrameFull." severity error;
577
      assert (inboundReadFrameEmpty = '1')
578
        report "Unexpected readFrameEmpty." severity error;
579
    end loop;
580
 
581
    SetInboundWriteFrame;
582
    assert (inboundWriteFrameFull = '1')
583
      report "Unexpected writeFrameFull." severity error;
584
    assert (inboundReadFrameEmpty = '0')
585
      report "Unexpected readFrameEmpty." severity error;
586
 
587
    ---------------------------------------------------------------------------
588
 
589
    for i in 0 to 186 loop
590
      SetInboundReadContent(std_logic_vector(to_unsigned(i, 32)));
591
 
592
      assert (inboundWriteFrameFull = '1')
593
        report "Unexpected writeFrameFull." severity error;
594
      assert (inboundReadFrameEmpty = '0')
595
        report "Unexpected readFrameEmpty." severity error;
596
    end loop;
597
 
598
    SetInboundReadContentEnd;
599
    assert (inboundWriteFrameFull = '1')
600
      report "Unexpected writeFrameFull." severity error;
601
    assert (inboundReadFrameEmpty = '0')
602
      report "Unexpected readFrameEmpty." severity error;
603
 
604
    SetInboundReadFrame;
605
    assert (inboundWriteFrameFull = '0')
606
      report "Unexpected writeFrameFull." severity error;
607
    assert (inboundReadFrameEmpty = '1')
608
      report "Unexpected readFrameEmpty." severity error;
609
 
610
    ---------------------------------------------------------------------------
611
    PrintS("-----------------------------------------------------------------");
612
    PrintS("TG_RioPacketBuffer-TC2");
613
    PrintS("Description: Test operation when using the window.");
614
    PrintS("Requirement: XXXXX");
615
    PrintS("-----------------------------------------------------------------");
616
    PrintS("Step 1:");
617
    PrintS("Action: Add one frame and update the window.");
618
    PrintS("Result: The window empty flag and the read frame empty flag should");
619
    PrintS("        be updated and it should be possible to read the frame again.");
620
    ---------------------------------------------------------------------------
621
    PrintR("TG_RioPacketBuffer-TC2-Step1");
622
    ---------------------------------------------------------------------------
623
 
624
    assert (outboundWriteFrameFull = '0')
625
      report "Unexpected writeFrameFull." severity error;
626
    assert (outboundReadFrameEmpty = '1')
627
      report "Unexpected readFrameEmpty." severity error;
628
    assert (outboundReadWindowEmpty = '1')
629
      report "Unexpected readWindowEmpty." severity error;
630
 
631
    for i in 0 to 2 loop
632
      SetOutboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
633
      assert (outboundWriteFrameFull = '0')
634
        report "Unexpected writeFrameFull." severity error;
635
      assert (outboundReadFrameEmpty = '1')
636
        report "Unexpected readFrameEmpty." severity error;
637
      assert (outboundReadWindowEmpty = '1')
638
        report "Unexpected readWindowEmpty." severity error;
639
    end loop;
640
 
641
    SetOutboundWriteFrame;
642
    assert (outboundWriteFrameFull = '0')
643
      report "Unexpected writeFrameFull." severity error;
644
    assert (outboundReadFrameEmpty = '0')
645
      report "Unexpected readFrameEmpty." severity error;
646
    assert (outboundReadWindowEmpty = '0')
647
      report "Unexpected readWindowEmpty." severity error;
648
 
649
    ---------------------------------------------------------------------------
650
 
651 16 magro732
    for i in 0 to 1 loop
652 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(i, 32)));
653
      assert (outboundWriteFrameFull = '0')
654
        report "Unexpected writeFrameFull." severity error;
655
      assert (outboundReadFrameEmpty = '0')
656
        report "Unexpected readFrameEmpty." severity error;
657
      assert (outboundReadWindowEmpty = '0')
658
        report "Unexpected readWindowEmpty." severity error;
659
    end loop;
660
 
661 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(2, 32)), '1');
662 3 magro732
    assert (outboundWriteFrameFull = '0')
663
      report "Unexpected writeFrameFull." severity error;
664
    assert (outboundReadFrameEmpty = '0')
665
      report "Unexpected readFrameEmpty." severity error;
666
    assert (outboundReadWindowEmpty = '0')
667
      report "Unexpected readWindowEmpty." severity error;
668
 
669
    SetOutboundReadWindowReset;
670
    assert (outboundWriteFrameFull = '0')
671
      report "Unexpected writeFrameFull." severity error;
672
    assert (outboundReadFrameEmpty = '0')
673
      report "Unexpected readFrameEmpty." severity error;
674
    assert (outboundReadWindowEmpty = '0')
675
      report "Unexpected readWindowEmpty." severity error;
676
 
677 16 magro732
    for i in 0 to 1 loop
678 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(i, 32)));
679
      assert (outboundWriteFrameFull = '0')
680
        report "Unexpected writeFrameFull." severity error;
681
      assert (outboundReadFrameEmpty = '0')
682
        report "Unexpected readFrameEmpty." severity error;
683
      assert (outboundReadWindowEmpty = '0')
684
        report "Unexpected readWindowEmpty." severity error;
685
    end loop;
686
 
687 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(2, 32)), '1');
688 3 magro732
    assert (outboundWriteFrameFull = '0')
689
      report "Unexpected writeFrameFull." severity error;
690
    assert (outboundReadFrameEmpty = '0')
691
      report "Unexpected readFrameEmpty." severity error;
692
    assert (outboundReadWindowEmpty = '0')
693
      report "Unexpected readWindowEmpty." severity error;
694
 
695
    SetOutboundReadWindowNext;
696
    assert (outboundWriteFrameFull = '0')
697
      report "Unexpected writeFrameFull." severity error;
698
    assert (outboundReadFrameEmpty = '0')
699
      report "Unexpected readFrameEmpty." severity error;
700
    assert (outboundReadWindowEmpty = '1')
701
      report "Unexpected readWindowEmpty." severity error;
702
 
703
    SetOutboundReadFrame;
704
    assert (outboundWriteFrameFull = '0')
705
      report "Unexpected writeFrameFull." severity error;
706
    assert (outboundReadFrameEmpty = '1')
707
      report "Unexpected readFrameEmpty." severity error;
708
    assert (outboundReadWindowEmpty = '1')
709
      report "Unexpected readWindowEmpty." severity error;
710
 
711
    ---------------------------------------------------------------------------
712
    PrintS("-----------------------------------------------------------------");
713
    PrintS("Step 2:");
714
    PrintS("Action: Add two frames and test the window accesses.");
715
    PrintS("Result: .");
716
    ---------------------------------------------------------------------------
717
    PrintR("TG_RioPacketBuffer-TC2-Step2");
718
    ---------------------------------------------------------------------------
719
 
720
    ---------------------------------------------------------------------------
721
    -- Write two frames.
722
    ---------------------------------------------------------------------------
723
 
724
    assert (outboundWriteFrameFull = '0')
725
      report "Unexpected writeFrameFull." severity error;
726
    assert (outboundReadFrameEmpty = '1')
727
      report "Unexpected readFrameEmpty." severity error;
728
    assert (outboundReadWindowEmpty = '1')
729
      report "Unexpected readWindowEmpty." severity error;
730
 
731
    for i in 0 to 2 loop
732
      SetOutboundWriteContent(std_logic_vector(to_unsigned(1+i, 32)));
733
      assert (outboundWriteFrameFull = '0')
734
        report "Unexpected writeFrameFull." severity error;
735
      assert (outboundReadFrameEmpty = '1')
736
        report "Unexpected readFrameEmpty." severity error;
737
      assert (outboundReadWindowEmpty = '1')
738
        report "Unexpected readWindowEmpty." severity error;
739
    end loop;
740
 
741
    SetOutboundWriteFrame;
742
    assert (outboundWriteFrameFull = '0')
743
      report "Unexpected writeFrameFull." severity error;
744
    assert (outboundReadFrameEmpty = '0')
745
      report "Unexpected readFrameEmpty." severity error;
746
    assert (outboundReadWindowEmpty = '0')
747
      report "Unexpected readWindowEmpty." severity error;
748
 
749
    for i in 0 to 2 loop
750
      SetOutboundWriteContent(std_logic_vector(to_unsigned(2+i, 32)));
751
      assert (outboundWriteFrameFull = '0')
752
        report "Unexpected writeFrameFull." severity error;
753
      assert (outboundReadFrameEmpty = '0')
754
        report "Unexpected readFrameEmpty." severity error;
755
      assert (outboundReadWindowEmpty = '0')
756
        report "Unexpected readWindowEmpty." severity error;
757
    end loop;
758
 
759
    SetOutboundWriteFrame;
760
    assert (outboundWriteFrameFull = '0')
761
      report "Unexpected writeFrameFull." severity error;
762
    assert (outboundReadFrameEmpty = '0')
763
      report "Unexpected readFrameEmpty." severity error;
764
    assert (outboundReadWindowEmpty = '0')
765
      report "Unexpected readWindowEmpty." severity error;
766
 
767
    ---------------------------------------------------------------------------
768
    -- Read the frames using the window mechanism.
769
    ---------------------------------------------------------------------------
770
 
771 16 magro732
    for i in 0 to 1 loop
772 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(1+i, 32)));
773
      assert (outboundWriteFrameFull = '0')
774
        report "Unexpected writeFrameFull." severity error;
775
      assert (outboundReadFrameEmpty = '0')
776
        report "Unexpected readFrameEmpty." severity error;
777
      assert (outboundReadWindowEmpty = '0')
778
        report "Unexpected readWindowEmpty." severity error;
779
    end loop;
780
 
781 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1+2, 32)), '1');
782 3 magro732
    assert (outboundWriteFrameFull = '0')
783
      report "Unexpected writeFrameFull." severity error;
784
    assert (outboundReadFrameEmpty = '0')
785
      report "Unexpected readFrameEmpty." severity error;
786
    assert (outboundReadWindowEmpty = '0')
787
      report "Unexpected readWindowEmpty." severity error;
788
 
789
    SetOutboundReadWindowNext;
790
    assert (outboundWriteFrameFull = '0')
791
      report "Unexpected writeFrameFull." severity error;
792
    assert (outboundReadFrameEmpty = '0')
793
      report "Unexpected readFrameEmpty." severity error;
794
    assert (outboundReadWindowEmpty = '0')
795
      report "Unexpected readWindowEmpty." severity error;
796
 
797 16 magro732
    for i in 0 to 1 loop
798 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(2+i, 32)));
799
      assert (outboundWriteFrameFull = '0')
800
        report "Unexpected writeFrameFull." severity error;
801
      assert (outboundReadFrameEmpty = '0')
802
        report "Unexpected readFrameEmpty." severity error;
803
      assert (outboundReadWindowEmpty = '0')
804
        report "Unexpected readWindowEmpty." severity error;
805
    end loop;
806
 
807 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(2+2, 32)), '1');
808 3 magro732
    assert (outboundWriteFrameFull = '0')
809
      report "Unexpected writeFrameFull." severity error;
810
    assert (outboundReadFrameEmpty = '0')
811
      report "Unexpected readFrameEmpty." severity error;
812
    assert (outboundReadWindowEmpty = '0')
813
      report "Unexpected readWindowEmpty." severity error;
814
 
815
    SetOutboundReadWindowNext;
816
    assert (outboundWriteFrameFull = '0')
817
      report "Unexpected writeFrameFull." severity error;
818
    assert (outboundReadFrameEmpty = '0')
819
      report "Unexpected readFrameEmpty." severity error;
820
    assert (outboundReadWindowEmpty = '1')
821
      report "Unexpected readWindowEmpty." severity error;
822
 
823
    ---------------------------------------------------------------------------
824
    -- Reset the window and read the frames again.
825
    ---------------------------------------------------------------------------
826
 
827
    SetOutboundReadWindowReset;
828
    assert (outboundWriteFrameFull = '0')
829
      report "Unexpected writeFrameFull." severity error;
830
    assert (outboundReadFrameEmpty = '0')
831
      report "Unexpected readFrameEmpty." severity error;
832
    assert (outboundReadWindowEmpty = '0')
833
      report "Unexpected readWindowEmpty." severity error;
834
 
835 16 magro732
    for i in 0 to 1 loop
836 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(1+i, 32)));
837
      assert (outboundWriteFrameFull = '0')
838
        report "Unexpected writeFrameFull." severity error;
839
      assert (outboundReadFrameEmpty = '0')
840
        report "Unexpected readFrameEmpty." severity error;
841
      assert (outboundReadWindowEmpty = '0')
842
        report "Unexpected readWindowEmpty." severity error;
843
    end loop;
844
 
845 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1+2, 32)), '1');
846 3 magro732
    assert (outboundWriteFrameFull = '0')
847
      report "Unexpected writeFrameFull." severity error;
848
    assert (outboundReadFrameEmpty = '0')
849
      report "Unexpected readFrameEmpty." severity error;
850
    assert (outboundReadWindowEmpty = '0')
851
      report "Unexpected readWindowEmpty." severity error;
852
 
853
    SetOutboundReadWindowNext;
854
    assert (outboundWriteFrameFull = '0')
855
      report "Unexpected writeFrameFull." severity error;
856
    assert (outboundReadFrameEmpty = '0')
857
      report "Unexpected readFrameEmpty." severity error;
858
    assert (outboundReadWindowEmpty = '0')
859
      report "Unexpected readWindowEmpty." severity error;
860
 
861 16 magro732
    for i in 0 to 1 loop
862 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(2+i, 32)));
863
      assert (outboundWriteFrameFull = '0')
864
        report "Unexpected writeFrameFull." severity error;
865
      assert (outboundReadFrameEmpty = '0')
866
        report "Unexpected readFrameEmpty." severity error;
867
      assert (outboundReadWindowEmpty = '0')
868
        report "Unexpected readWindowEmpty." severity error;
869
    end loop;
870
 
871 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(2+2, 32)), '1');
872 3 magro732
    assert (outboundWriteFrameFull = '0')
873
      report "Unexpected writeFrameFull." severity error;
874
    assert (outboundReadFrameEmpty = '0')
875
      report "Unexpected readFrameEmpty." severity error;
876
    assert (outboundReadWindowEmpty = '0')
877
      report "Unexpected readWindowEmpty." severity error;
878
 
879
    SetOutboundReadWindowNext;
880
    assert (outboundWriteFrameFull = '0')
881
      report "Unexpected writeFrameFull." severity error;
882
    assert (outboundReadFrameEmpty = '0')
883
      report "Unexpected readFrameEmpty." severity error;
884
    assert (outboundReadWindowEmpty = '1')
885
      report "Unexpected readWindowEmpty." severity error;
886
 
887
    ---------------------------------------------------------------------------
888
    -- Remove one frame and access the remaining frame.
889
    ---------------------------------------------------------------------------
890
    SetOutboundReadFrame;
891
    assert (outboundWriteFrameFull = '0')
892
      report "Unexpected writeFrameFull." severity error;
893
    assert (outboundReadFrameEmpty = '0')
894
      report "Unexpected readFrameEmpty." severity error;
895
    assert (outboundReadWindowEmpty = '1')
896
      report "Unexpected readWindowEmpty." severity error;
897
 
898
    SetOutboundReadWindowReset;
899
    assert (outboundWriteFrameFull = '0')
900
      report "Unexpected writeFrameFull." severity error;
901
    assert (outboundReadFrameEmpty = '0')
902
      report "Unexpected readFrameEmpty." severity error;
903
    assert (outboundReadWindowEmpty = '0')
904
      report "Unexpected readWindowEmpty." severity error;
905
 
906 16 magro732
    for i in 0 to 1 loop
907 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(2+i, 32)));
908
      assert (outboundWriteFrameFull = '0')
909
        report "Unexpected writeFrameFull." severity error;
910
      assert (outboundReadFrameEmpty = '0')
911
        report "Unexpected readFrameEmpty." severity error;
912
      assert (outboundReadWindowEmpty = '0')
913
        report "Unexpected readWindowEmpty." severity error;
914
    end loop;
915
 
916 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(2+2, 32)), '1');
917 3 magro732
    assert (outboundWriteFrameFull = '0')
918
      report "Unexpected writeFrameFull." severity error;
919
    assert (outboundReadFrameEmpty = '0')
920
      report "Unexpected readFrameEmpty." severity error;
921
    assert (outboundReadWindowEmpty = '0')
922
      report "Unexpected readWindowEmpty." severity error;
923
 
924
    SetOutboundReadWindowNext;
925
    assert (outboundWriteFrameFull = '0')
926
      report "Unexpected writeFrameFull." severity error;
927
    assert (outboundReadFrameEmpty = '0')
928
      report "Unexpected readFrameEmpty." severity error;
929
    assert (outboundReadWindowEmpty = '1')
930
      report "Unexpected readWindowEmpty." severity error;
931
 
932
    ---------------------------------------------------------------------------
933
    -- Remove the remaining frame.
934
    ---------------------------------------------------------------------------
935
 
936
    SetOutboundReadFrame;
937
    assert (outboundWriteFrameFull = '0')
938
      report "Unexpected writeFrameFull." severity error;
939
    assert (outboundReadFrameEmpty = '1')
940
      report "Unexpected readFrameEmpty." severity error;
941
    assert (outboundReadWindowEmpty = '1')
942
      report "Unexpected readWindowEmpty." severity error;
943
 
944
    SetOutboundReadWindowReset;
945
    assert (outboundWriteFrameFull = '0')
946
      report "Unexpected writeFrameFull." severity error;
947
    assert (outboundReadFrameEmpty = '1')
948
      report "Unexpected readFrameEmpty." severity error;
949
    assert (outboundReadWindowEmpty = '1')
950
      report "Unexpected readWindowEmpty." severity error;
951
 
952
    ---------------------------------------------------------------------------
953
    PrintS("-----------------------------------------------------------------");
954
    PrintS("Step 3:");
955
    PrintS("Action: Add maximum number of frames and test the window accesses.");
956
    PrintS("Result: The buffer should be full and not accept more frames.");
957
    ---------------------------------------------------------------------------
958
    PrintR("TG_RioPacketBuffer-TC2-Step3");
959
    ---------------------------------------------------------------------------
960
 
961
    assert (outboundWriteFrameFull = '0')
962
      report "Unexpected writeFrameFull." severity error;
963
    assert (outboundReadFrameEmpty = '1')
964
      report "Unexpected readFrameEmpty." severity error;
965
    assert (outboundReadWindowEmpty = '1')
966
      report "Unexpected readWindowEmpty." severity error;
967
 
968
    ---------------------------------------------------------------------------
969
    -- Write 3*63 frames => maximum number of frames.  
970
    ---------------------------------------------------------------------------
971
 
972
    for i in 0 to 2 loop
973
      SetOutboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
974
      assert (outboundWriteFrameFull = '0')
975
        report "Unexpected writeFrameFull." severity error;
976
      assert (outboundReadFrameEmpty = '1')
977
        report "Unexpected readFrameEmpty." severity error;
978
      assert (outboundReadWindowEmpty = '1')
979
        report "Unexpected readWindowEmpty." severity error;
980
    end loop;
981
 
982
    for j in 1 to 62 loop
983
      SetOutboundWriteFrame;
984
      assert (outboundWriteFrameFull = '0')
985
        report "Unexpected writeFrameFull." severity error;
986
      assert (outboundReadFrameEmpty = '0')
987
        report "Unexpected readFrameEmpty." severity error;
988
      assert (outboundReadWindowEmpty = '0')
989
        report "Unexpected readWindowEmpty." severity error;
990
 
991
      for i in 0 to 2 loop
992
        SetOutboundWriteContent(std_logic_vector(to_unsigned(j+i, 32)));
993
        assert (outboundWriteFrameFull = '0')
994
          report "Unexpected writeFrameFull." severity error;
995
        assert (outboundReadFrameEmpty = '0')
996
          report "Unexpected readFrameEmpty." severity error;
997
        assert (outboundReadWindowEmpty = '0')
998
          report "Unexpected readWindowEmpty." severity error;
999
      end loop;
1000
    end loop;
1001
 
1002
    SetOutboundWriteFrame;
1003
    assert (outboundWriteFrameFull = '1')
1004
      report "Unexpected writeFrameFull." severity error;
1005
    assert (outboundReadFrameEmpty = '0')
1006
      report "Unexpected readFrameEmpty." severity error;
1007
    assert (outboundReadWindowEmpty = '0')
1008
      report "Unexpected readWindowEmpty." severity error;
1009
 
1010
    ---------------------------------------------------------------------------
1011
    -- Read the whole window until it is empty.
1012
    ---------------------------------------------------------------------------
1013
 
1014
    for j in 0 to 61 loop
1015 16 magro732
      for i in 0 to 1 loop
1016 3 magro732
        SetOutboundReadContent(std_logic_vector(to_unsigned(j+i, 32)));
1017
        assert (outboundWriteFrameFull = '1')
1018
          report "Unexpected writeFrameFull." severity error;
1019
        assert (outboundReadFrameEmpty = '0')
1020
          report "Unexpected readFrameEmpty." severity error;
1021
        assert (outboundReadWindowEmpty = '0')
1022
          report "Unexpected readWindowEmpty." severity error;
1023
      end loop;
1024
 
1025 16 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(j+2, 32)), '1');
1026 3 magro732
      assert (outboundWriteFrameFull = '1')
1027
        report "Unexpected writeFrameFull." severity error;
1028
      assert (outboundReadFrameEmpty = '0')
1029
        report "Unexpected readFrameEmpty." severity error;
1030
      assert (outboundReadWindowEmpty = '0')
1031
        report "Unexpected readWindowEmpty." severity error;
1032
 
1033
      SetOutboundReadWindowNext;
1034
      assert (outboundWriteFrameFull = '1')
1035
        report "Unexpected writeFrameFull." severity error;
1036
      assert (outboundReadFrameEmpty = '0')
1037
        report "Unexpected readFrameEmpty." severity error;
1038
      assert (outboundReadWindowEmpty = '0')
1039
        report "Unexpected readWindowEmpty." severity error;
1040
    end loop;
1041
 
1042 16 magro732
    for i in 0 to 1 loop
1043 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(62+i, 32)));
1044
      assert (outboundWriteFrameFull = '1')
1045
        report "Unexpected writeFrameFull." severity error;
1046
      assert (outboundReadFrameEmpty = '0')
1047
        report "Unexpected readFrameEmpty." severity error;
1048
      assert (outboundReadWindowEmpty = '0')
1049
        report "Unexpected readWindowEmpty." severity error;
1050
    end loop;
1051
 
1052 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(62+2, 32)), '1');
1053 3 magro732
    assert (outboundWriteFrameFull = '1')
1054
      report "Unexpected writeFrameFull." severity error;
1055
    assert (outboundReadFrameEmpty = '0')
1056
      report "Unexpected readFrameEmpty." severity error;
1057
    assert (outboundReadWindowEmpty = '0')
1058
      report "Unexpected readWindowEmpty." severity error;
1059
 
1060
    SetOutboundReadWindowNext;
1061
    assert (outboundWriteFrameFull = '1')
1062
      report "Unexpected writeFrameFull." severity error;
1063
    assert (outboundReadFrameEmpty = '0')
1064
      report "Unexpected readFrameEmpty." severity error;
1065
    assert (outboundReadWindowEmpty = '1')
1066
      report "Unexpected readWindowEmpty." severity error;
1067
 
1068
    ---------------------------------------------------------------------------
1069
    -- Reset the window and remove all frames.
1070
    ---------------------------------------------------------------------------
1071
 
1072
    SetOutboundReadWindowReset;
1073
    assert (outboundWriteFrameFull = '1')
1074
      report "Unexpected writeFrameFull." severity error;
1075
    assert (outboundReadFrameEmpty = '0')
1076
      report "Unexpected readFrameEmpty." severity error;
1077
    assert (outboundReadWindowEmpty = '0')
1078
      report "Unexpected readWindowEmpty." severity error;
1079
 
1080
    for j in 0 to 61 loop
1081
      SetOutboundReadFrame;
1082
      assert (outboundWriteFrameFull = '0')
1083
        report "Unexpected writeFrameFull." severity error;
1084
      assert (outboundReadFrameEmpty = '0')
1085
        report "Unexpected readFrameEmpty." severity error;
1086
      assert (outboundReadWindowEmpty = '0')
1087
        report "Unexpected readWindowEmpty." severity error;
1088
    end loop;
1089
 
1090
    SetOutboundReadWindowReset;
1091
    assert (outboundWriteFrameFull = '0')
1092
      report "Unexpected writeFrameFull." severity error;
1093
    assert (outboundReadFrameEmpty = '0')
1094
      report "Unexpected readFrameEmpty." severity error;
1095
    assert (outboundReadWindowEmpty = '0')
1096
      report "Unexpected readWindowEmpty." severity error;
1097
 
1098 16 magro732
    for i in 0 to 1 loop
1099 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(62+i, 32)));
1100
      assert (outboundWriteFrameFull = '0')
1101
        report "Unexpected writeFrameFull." severity error;
1102
      assert (outboundReadFrameEmpty = '0')
1103
        report "Unexpected readFrameEmpty." severity error;
1104
      assert (outboundReadWindowEmpty = '0')
1105
        report "Unexpected readWindowEmpty." severity error;
1106
    end loop;
1107
 
1108 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(62+2, 32)), '1');
1109 3 magro732
    assert (outboundWriteFrameFull = '0')
1110
      report "Unexpected writeFrameFull." severity error;
1111
    assert (outboundReadFrameEmpty = '0')
1112
      report "Unexpected readFrameEmpty." severity error;
1113
    assert (outboundReadWindowEmpty = '0')
1114
      report "Unexpected readWindowEmpty." severity error;
1115
 
1116
    SetOutboundReadWindowNext;
1117
    assert (outboundWriteFrameFull = '0')
1118
      report "Unexpected writeFrameFull." severity error;
1119
    assert (outboundReadFrameEmpty = '0')
1120
      report "Unexpected readFrameEmpty." severity error;
1121
    assert (outboundReadWindowEmpty = '1')
1122
      report "Unexpected readWindowEmpty." severity error;
1123
 
1124
    SetOutboundReadFrame;
1125
    assert (outboundWriteFrameFull = '0')
1126
      report "Unexpected writeFrameFull." severity error;
1127
    assert (outboundReadFrameEmpty = '1')
1128
      report "Unexpected readFrameEmpty." severity error;
1129
    assert (outboundReadWindowEmpty = '1')
1130
      report "Unexpected readWindowEmpty." severity error;
1131
 
1132
    ---------------------------------------------------------------------------
1133
    PrintS("-----------------------------------------------------------------");
1134
    PrintS("Step 4:");
1135
    PrintS("Action: Add maximum number of words and test the window accesses.");
1136
    PrintS("Result: The content memory should be full.");
1137
    ---------------------------------------------------------------------------
1138
    PrintR("TG_RioPacketBuffer-TC2-Step4");
1139
    ---------------------------------------------------------------------------
1140
 
1141
    assert (outboundWriteFrameFull = '0')
1142
      report "Unexpected writeFrameFull." severity error;
1143
    assert (outboundReadFrameEmpty = '1')
1144
      report "Unexpected readFrameEmpty." severity error;
1145
    assert (outboundReadWindowEmpty = '1')
1146
      report "Unexpected readWindowEmpty." severity error;
1147
 
1148
    ---------------------------------------------------------------------------
1149
    -- Write 6*31+69=255 words and 7 frames => full content.  
1150
    ---------------------------------------------------------------------------
1151
 
1152
    for i in 0 to 30 loop
1153
      SetOutboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
1154
      assert (outboundWriteFrameFull = '0')
1155
        report "Unexpected writeFrameFull." severity error;
1156
      assert (outboundReadFrameEmpty = '1')
1157
        report "Unexpected readFrameEmpty." severity error;
1158
      assert (outboundReadWindowEmpty = '1')
1159
        report "Unexpected readWindowEmpty." severity error;
1160
    end loop;
1161
 
1162
    for j in 1 to 5 loop
1163
      SetOutboundWriteFrame;
1164
      assert (outboundWriteFrameFull = '0')
1165
        report "Unexpected writeFrameFull." severity error;
1166
      assert (outboundReadFrameEmpty = '0')
1167
        report "Unexpected readFrameEmpty." severity error;
1168
      assert (outboundReadWindowEmpty = '0')
1169
        report "Unexpected readWindowEmpty." severity error;
1170
 
1171
      for i in 0 to 30 loop
1172
        SetOutboundWriteContent(std_logic_vector(to_unsigned(j+i, 32)));
1173
        assert (outboundWriteFrameFull = '0')
1174
          report "Unexpected writeFrameFull." severity error;
1175
        assert (outboundReadFrameEmpty = '0')
1176
          report "Unexpected readFrameEmpty." severity error;
1177
        assert (outboundReadWindowEmpty = '0')
1178
          report "Unexpected readWindowEmpty." severity error;
1179
      end loop;
1180
    end loop;
1181
 
1182
    SetOutboundWriteFrame;
1183
    assert (outboundWriteFrameFull = '0')
1184
      report "Unexpected writeFrameFull." severity error;
1185
    assert (outboundReadFrameEmpty = '0')
1186
      report "Unexpected readFrameEmpty." severity error;
1187
    assert (outboundReadWindowEmpty = '0')
1188
      report "Unexpected readWindowEmpty." severity error;
1189
 
1190
    for i in 0 to 68 loop
1191
      SetOutboundWriteContent(std_logic_vector(to_unsigned(1024+i, 32)));
1192
      assert (outboundWriteFrameFull = '0')
1193
        report "Unexpected writeFrameFull." severity error;
1194
      assert (outboundReadFrameEmpty = '0')
1195
        report "Unexpected readFrameEmpty." severity error;
1196
      assert (outboundReadWindowEmpty = '0')
1197
        report "Unexpected readWindowEmpty." severity error;
1198
    end loop;
1199
 
1200
    SetOutboundWriteFrame;
1201
    assert (outboundWriteFrameFull = '1')
1202
      report "Unexpected writeFrameFull." severity error;
1203
    assert (outboundReadFrameEmpty = '0')
1204
      report "Unexpected readFrameEmpty." severity error;
1205
    assert (outboundReadWindowEmpty = '0')
1206
      report "Unexpected readWindowEmpty." severity error;
1207
 
1208
    ---------------------------------------------------------------------------
1209
    -- Read the whole window until it is empty.
1210
    ---------------------------------------------------------------------------
1211
 
1212
    for j in 0 to 5 loop
1213 16 magro732
      for i in 0 to 29 loop
1214 3 magro732
        SetOutboundReadContent(std_logic_vector(to_unsigned(j+i, 32)));
1215
        assert (outboundWriteFrameFull = '1')
1216
          report "Unexpected writeFrameFull." severity error;
1217
        assert (outboundReadFrameEmpty = '0')
1218
          report "Unexpected readFrameEmpty." severity error;
1219
        assert (outboundReadWindowEmpty = '0')
1220
          report "Unexpected readWindowEmpty." severity error;
1221
      end loop;
1222
 
1223 16 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(j+30, 32)), '1');
1224 3 magro732
      assert (outboundWriteFrameFull = '1')
1225
        report "Unexpected writeFrameFull." severity error;
1226
      assert (outboundReadFrameEmpty = '0')
1227
        report "Unexpected readFrameEmpty." severity error;
1228
      assert (outboundReadWindowEmpty = '0')
1229
        report "Unexpected readWindowEmpty." severity error;
1230
 
1231
      SetOutboundReadWindowNext;
1232
      assert (outboundWriteFrameFull = '1')
1233
        report "Unexpected writeFrameFull." severity error;
1234
      assert (outboundReadFrameEmpty = '0')
1235
        report "Unexpected readFrameEmpty." severity error;
1236
      assert (outboundReadWindowEmpty = '0')
1237
        report "Unexpected readWindowEmpty." severity error;
1238
    end loop;
1239
 
1240 16 magro732
    for i in 0 to 67 loop
1241 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(1024+i, 32)));
1242
      assert (outboundWriteFrameFull = '1')
1243
        report "Unexpected writeFrameFull." severity error;
1244
      assert (outboundReadFrameEmpty = '0')
1245
        report "Unexpected readFrameEmpty." severity error;
1246
      assert (outboundReadWindowEmpty = '0')
1247
        report "Unexpected readWindowEmpty." severity error;
1248
    end loop;
1249
 
1250 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1024+68, 32)), '1');
1251 3 magro732
    assert (outboundWriteFrameFull = '1')
1252
      report "Unexpected writeFrameFull." severity error;
1253
    assert (outboundReadFrameEmpty = '0')
1254
      report "Unexpected readFrameEmpty." severity error;
1255
    assert (outboundReadWindowEmpty = '0')
1256
      report "Unexpected readWindowEmpty." severity error;
1257
 
1258
    SetOutboundReadWindowNext;
1259
    assert (outboundWriteFrameFull = '1')
1260
      report "Unexpected writeFrameFull." severity error;
1261
    assert (outboundReadFrameEmpty = '0')
1262
      report "Unexpected readFrameEmpty." severity error;
1263
    assert (outboundReadWindowEmpty = '1')
1264
      report "Unexpected readWindowEmpty." severity error;
1265
 
1266
    ---------------------------------------------------------------------------
1267
    -- Reset the window and remove all frames.
1268
    ---------------------------------------------------------------------------
1269
 
1270
    SetOutboundReadWindowReset;
1271
    assert (outboundWriteFrameFull = '1')
1272
      report "Unexpected writeFrameFull." severity error;
1273
    assert (outboundReadFrameEmpty = '0')
1274
      report "Unexpected readFrameEmpty." severity error;
1275
    assert (outboundReadWindowEmpty = '0')
1276
      report "Unexpected readWindowEmpty." severity error;
1277
 
1278
    for j in 0 to 1 loop
1279
      SetOutboundReadFrame;
1280
      assert (outboundWriteFrameFull = '1')
1281
        report "Unexpected writeFrameFull." severity error;
1282
      assert (outboundReadFrameEmpty = '0')
1283
        report "Unexpected readFrameEmpty." severity error;
1284
      assert (outboundReadWindowEmpty = '0')
1285
        report "Unexpected readWindowEmpty." severity error;
1286
    end loop;
1287
 
1288
    for j in 2 to 5 loop
1289
      SetOutboundReadFrame;
1290
      assert (outboundWriteFrameFull = '0')
1291
        report "Unexpected writeFrameFull." severity error;
1292
      assert (outboundReadFrameEmpty = '0')
1293
        report "Unexpected readFrameEmpty." severity error;
1294
      assert (outboundReadWindowEmpty = '0')
1295
        report "Unexpected readWindowEmpty." severity error;
1296
    end loop;
1297
 
1298
    SetOutboundReadWindowReset;
1299
    assert (outboundWriteFrameFull = '0')
1300
      report "Unexpected writeFrameFull." severity error;
1301
    assert (outboundReadFrameEmpty = '0')
1302
      report "Unexpected readFrameEmpty." severity error;
1303
    assert (outboundReadWindowEmpty = '0')
1304
      report "Unexpected readWindowEmpty." severity error;
1305
 
1306 16 magro732
    for i in 0 to 67 loop
1307 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(1024+i, 32)));
1308
      assert (outboundWriteFrameFull = '0')
1309
        report "Unexpected writeFrameFull." severity error;
1310
      assert (outboundReadFrameEmpty = '0')
1311
        report "Unexpected readFrameEmpty." severity error;
1312
      assert (outboundReadWindowEmpty = '0')
1313
        report "Unexpected readWindowEmpty." severity error;
1314
    end loop;
1315
 
1316 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1024+68, 32)), '1');
1317 3 magro732
    assert (outboundWriteFrameFull = '0')
1318
      report "Unexpected writeFrameFull." severity error;
1319
    assert (outboundReadFrameEmpty = '0')
1320
      report "Unexpected readFrameEmpty." severity error;
1321
    assert (outboundReadWindowEmpty = '0')
1322
      report "Unexpected readWindowEmpty." severity error;
1323
 
1324
    SetOutboundReadWindowNext;
1325
    assert (outboundWriteFrameFull = '0')
1326
      report "Unexpected writeFrameFull." severity error;
1327
    assert (outboundReadFrameEmpty = '0')
1328
      report "Unexpected readFrameEmpty." severity error;
1329
    assert (outboundReadWindowEmpty = '1')
1330
      report "Unexpected readWindowEmpty." severity error;
1331
 
1332
    SetOutboundReadFrame;
1333
    assert (outboundWriteFrameFull = '0')
1334
      report "Unexpected writeFrameFull." severity error;
1335
    assert (outboundReadFrameEmpty = '1')
1336
      report "Unexpected readFrameEmpty." severity error;
1337
    assert (outboundReadWindowEmpty = '1')
1338
      report "Unexpected readWindowEmpty." severity error;
1339
 
1340
    ---------------------------------------------------------------------------
1341
    PrintS("-----------------------------------------------------------------");
1342
    PrintS("Step 5:");
1343
    PrintS("Action: Add maximum number of words -1 and test the window accesses.");
1344
    PrintS("Result: The content memory should not accept more frames.");
1345
    ---------------------------------------------------------------------------
1346
    PrintR("TG_RioPacketBuffer-TC2-Step5");
1347
    ---------------------------------------------------------------------------
1348
 
1349
    assert (outboundWriteFrameFull = '0')
1350
      report "Unexpected writeFrameFull." severity error;
1351
    assert (outboundReadFrameEmpty = '1')
1352
      report "Unexpected readFrameEmpty." severity error;
1353
    assert (outboundReadWindowEmpty = '1')
1354
      report "Unexpected readWindowEmpty." severity error;
1355
 
1356
    ---------------------------------------------------------------------------
1357
    -- Write 11*17=187 (one full frame will not fit).
1358
    ---------------------------------------------------------------------------
1359
 
1360
    for i in 0 to 16 loop
1361
      SetOutboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
1362
      assert (outboundWriteFrameFull = '0')
1363
        report "Unexpected writeFrameFull." severity error;
1364
      assert (outboundReadFrameEmpty = '1')
1365
        report "Unexpected readFrameEmpty." severity error;
1366
      assert (outboundReadWindowEmpty = '1')
1367
        report "Unexpected readWindowEmpty." severity error;
1368
    end loop;
1369
 
1370
    for j in 1 to 10 loop
1371
      SetOutboundWriteFrame;
1372
      assert (outboundWriteFrameFull = '0')
1373
        report "Unexpected writeFrameFull." severity error;
1374
      assert (outboundReadFrameEmpty = '0')
1375
        report "Unexpected readFrameEmpty." severity error;
1376
      assert (outboundReadWindowEmpty = '0')
1377
        report "Unexpected readWindowEmpty." severity error;
1378
 
1379
      for i in 0 to 16 loop
1380
        SetOutboundWriteContent(std_logic_vector(to_unsigned(j+i, 32)));
1381
        assert (outboundWriteFrameFull = '0')
1382
          report "Unexpected writeFrameFull." severity error;
1383
        assert (outboundReadFrameEmpty = '0')
1384
          report "Unexpected readFrameEmpty." severity error;
1385
        assert (outboundReadWindowEmpty = '0')
1386
          report "Unexpected readWindowEmpty." severity error;
1387
      end loop;
1388
    end loop;
1389
 
1390
    SetOutboundWriteFrame;
1391
    assert (outboundWriteFrameFull = '1')
1392
      report "Unexpected writeFrameFull." severity error;
1393
    assert (outboundReadFrameEmpty = '0')
1394
      report "Unexpected readFrameEmpty." severity error;
1395
    assert (outboundReadWindowEmpty = '0')
1396
      report "Unexpected readWindowEmpty." severity error;
1397
 
1398
    ---------------------------------------------------------------------------
1399
    -- Reset the window and remove all frames.
1400
    ---------------------------------------------------------------------------
1401
 
1402
    SetOutboundReadWindowReset;
1403
    assert (outboundWriteFrameFull = '1')
1404
      report "Unexpected writeFrameFull." severity error;
1405
    assert (outboundReadFrameEmpty = '0')
1406
      report "Unexpected readFrameEmpty." severity error;
1407
    assert (outboundReadWindowEmpty = '0')
1408
      report "Unexpected readWindowEmpty." severity error;
1409
 
1410
    SetOutboundReadWindowNext;
1411
    assert (outboundWriteFrameFull = '1')
1412
      report "Unexpected writeFrameFull." severity error;
1413
    assert (outboundReadFrameEmpty = '0')
1414
      report "Unexpected readFrameEmpty." severity error;
1415
    assert (outboundReadWindowEmpty = '0')
1416
      report "Unexpected readWindowEmpty." severity error;
1417
 
1418
    SetOutboundReadFrame;
1419
    assert (outboundWriteFrameFull = '0')
1420
      report "Unexpected writeFrameFull." severity error;
1421
    assert (outboundReadFrameEmpty = '0')
1422
      report "Unexpected readFrameEmpty." severity error;
1423
    assert (outboundReadWindowEmpty = '0')
1424
      report "Unexpected readWindowEmpty." severity error;
1425
 
1426
    for j in 1 to 9 loop
1427
      SetOutboundReadWindowNext;
1428
      assert (outboundWriteFrameFull = '0')
1429
        report "Unexpected writeFrameFull." severity error;
1430
      assert (outboundReadFrameEmpty = '0')
1431
        report "Unexpected readFrameEmpty." severity error;
1432
      assert (outboundReadWindowEmpty = '0')
1433
        report "Unexpected readWindowEmpty." severity error;
1434
 
1435
      SetOutboundReadFrame;
1436
      assert (outboundWriteFrameFull = '0')
1437
        report "Unexpected writeFrameFull." severity error;
1438
      assert (outboundReadFrameEmpty = '0')
1439
        report "Unexpected readFrameEmpty." severity error;
1440
      assert (outboundReadWindowEmpty = '0')
1441
        report "Unexpected readWindowEmpty." severity error;
1442
    end loop;
1443
 
1444
    SetOutboundReadWindowNext;
1445
    assert (outboundWriteFrameFull = '0')
1446
      report "Unexpected writeFrameFull." severity error;
1447
    assert (outboundReadFrameEmpty = '0')
1448
      report "Unexpected readFrameEmpty." severity error;
1449
    assert (outboundReadWindowEmpty = '1')
1450
      report "Unexpected readWindowEmpty." severity error;
1451
 
1452
    SetOutboundReadFrame;
1453
    assert (outboundWriteFrameFull = '0')
1454
      report "Unexpected writeFrameFull." severity error;
1455
    assert (outboundReadFrameEmpty = '1')
1456
      report "Unexpected readFrameEmpty." severity error;
1457
    assert (outboundReadWindowEmpty = '1')
1458
      report "Unexpected readWindowEmpty." severity error;
1459
 
1460
    ---------------------------------------------------------------------------
1461
    PrintS("-----------------------------------------------------------------");
1462
    PrintS("Step 6:");
1463
    PrintS("Action: Add two frames and start reading the second, then remove");
1464
    PrintS("        the first.");
1465
    PrintS("Result: The readContentEnd flag should not be changed when frames");
1466
    PrintS("        are removed.");
1467
    ---------------------------------------------------------------------------
1468
    PrintR("TG_RioPacketBuffer-TC2-Step6");
1469
    ---------------------------------------------------------------------------
1470
 
1471
    assert (outboundWriteFrameFull = '0')
1472
      report "Unexpected writeFrameFull." severity error;
1473
    assert (outboundReadFrameEmpty = '1')
1474
      report "Unexpected readFrameEmpty." severity error;
1475
    assert (outboundReadWindowEmpty = '1')
1476
      report "Unexpected readWindowEmpty." severity error;
1477
 
1478
    ---------------------------------------------------------------------------
1479
    -- 
1480
    ---------------------------------------------------------------------------
1481
 
1482
    for i in 0 to 3 loop
1483
      SetOutboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
1484
      assert (outboundWriteFrameFull = '0')
1485
 
1486
        report "Unexpected writeFrameFull." severity error;
1487
      assert (outboundReadFrameEmpty = '1')
1488
        report "Unexpected readFrameEmpty." severity error;
1489
      assert (outboundReadWindowEmpty = '1')
1490
        report "Unexpected readWindowEmpty." severity error;
1491
    end loop;
1492
 
1493
    SetOutboundWriteFrame;
1494
    assert (outboundWriteFrameFull = '0')
1495
      report "Unexpected writeFrameFull." severity error;
1496
    assert (outboundReadFrameEmpty = '0')
1497
      report "Unexpected readFrameEmpty." severity error;
1498
    assert (outboundReadWindowEmpty = '0')
1499
      report "Unexpected readWindowEmpty." severity error;
1500
 
1501
    for i in 0 to 3 loop
1502
      SetOutboundWriteContent(std_logic_vector(to_unsigned(i+1, 32)));
1503
      assert (outboundWriteFrameFull = '0')
1504
        report "Unexpected writeFrameFull." severity error;
1505
      assert (outboundReadFrameEmpty = '0')
1506
        report "Unexpected readFrameEmpty." severity error;
1507
      assert (outboundReadWindowEmpty = '0')
1508
        report "Unexpected readWindowEmpty." severity error;
1509
    end loop;
1510
 
1511
    SetOutboundWriteFrame;
1512
    assert (outboundWriteFrameFull = '0')
1513
      report "Unexpected writeFrameFull." severity error;
1514
    assert (outboundReadFrameEmpty = '0')
1515
      report "Unexpected readFrameEmpty." severity error;
1516
    assert (outboundReadWindowEmpty = '0')
1517
      report "Unexpected readWindowEmpty." severity error;
1518
 
1519
    ---------------------------------------------------------------------------
1520
    -- 
1521
    ---------------------------------------------------------------------------
1522
 
1523 16 magro732
    for i in 0 to 2 loop
1524 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(i, 32)));
1525
      assert (outboundWriteFrameFull = '0')
1526
        report "Unexpected writeFrameFull." severity error;
1527
      assert (outboundReadFrameEmpty = '0')
1528
        report "Unexpected readFrameEmpty." severity error;
1529
      assert (outboundReadWindowEmpty = '0')
1530
        report "Unexpected readWindowEmpty." severity error;
1531
    end loop;
1532
 
1533 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(3, 32)), '1');
1534 3 magro732
    assert (outboundWriteFrameFull = '0')
1535
      report "Unexpected writeFrameFull." severity error;
1536
    assert (outboundReadFrameEmpty = '0')
1537
      report "Unexpected readFrameEmpty." severity error;
1538
    assert (outboundReadWindowEmpty = '0')
1539
      report "Unexpected readWindowEmpty." severity error;
1540
 
1541
    SetOutboundReadWindowNext;
1542
    assert (outboundWriteFrameFull = '0')
1543
      report "Unexpected writeFrameFull." severity error;
1544
    assert (outboundReadFrameEmpty = '0')
1545
      report "Unexpected readFrameEmpty." severity error;
1546
    assert (outboundReadWindowEmpty = '0')
1547
      report "Unexpected readWindowEmpty." severity error;
1548
 
1549
    SetOutboundReadContent(std_logic_vector(to_unsigned(1, 32)));
1550
    assert (outboundWriteFrameFull = '0')
1551
      report "Unexpected writeFrameFull." severity error;
1552
    assert (outboundReadFrameEmpty = '0')
1553
      report "Unexpected readFrameEmpty." severity error;
1554
    assert (outboundReadWindowEmpty = '0')
1555
      report "Unexpected readWindowEmpty." severity error;
1556
 
1557
    SetOutboundReadFrame;
1558
    assert (outboundWriteFrameFull = '0')
1559
      report "Unexpected writeFrameFull." severity error;
1560
    assert (outboundReadFrameEmpty = '0')
1561
      report "Unexpected readFrameEmpty." severity error;
1562
    assert (outboundReadWindowEmpty = '0')
1563
      report "Unexpected readWindowEmpty." severity error;
1564
 
1565
    SetOutboundReadContent(std_logic_vector(to_unsigned(2, 32)));
1566
    assert (outboundWriteFrameFull = '0')
1567
      report "Unexpected writeFrameFull." severity error;
1568
    assert (outboundReadFrameEmpty = '0')
1569
      report "Unexpected readFrameEmpty." severity error;
1570
    assert (outboundReadWindowEmpty = '0')
1571
      report "Unexpected readWindowEmpty." severity error;
1572
 
1573
    SetOutboundReadContent(std_logic_vector(to_unsigned(3, 32)));
1574
    assert (outboundWriteFrameFull = '0')
1575
      report "Unexpected writeFrameFull." severity error;
1576
    assert (outboundReadFrameEmpty = '0')
1577
      report "Unexpected readFrameEmpty." severity error;
1578
    assert (outboundReadWindowEmpty = '0')
1579
      report "Unexpected readWindowEmpty." severity error;
1580
 
1581 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(4, 32)), '1');
1582 3 magro732
    assert (outboundWriteFrameFull = '0')
1583
      report "Unexpected writeFrameFull." severity error;
1584
    assert (outboundReadFrameEmpty = '0')
1585
      report "Unexpected readFrameEmpty." severity error;
1586
    assert (outboundReadWindowEmpty = '0')
1587
      report "Unexpected readWindowEmpty." severity error;
1588
 
1589
    SetOutboundReadWindowNext;
1590
    assert (outboundWriteFrameFull = '0')
1591
      report "Unexpected writeFrameFull." severity error;
1592
    assert (outboundReadFrameEmpty = '0')
1593
      report "Unexpected readFrameEmpty." severity error;
1594
    assert (outboundReadWindowEmpty = '1')
1595
      report "Unexpected readWindowEmpty." severity error;
1596
 
1597
    SetOutboundReadFrame;
1598
    assert (outboundWriteFrameFull = '0')
1599
      report "Unexpected writeFrameFull." severity error;
1600
    assert (outboundReadFrameEmpty = '1')
1601
      report "Unexpected readFrameEmpty." severity error;
1602
    assert (outboundReadWindowEmpty = '1')
1603
      report "Unexpected readWindowEmpty." severity error;
1604
 
1605
    ---------------------------------------------------------------------------
1606
    PrintS("-----------------------------------------------------------------");
1607
    PrintS("TG_RioPacketBuffer");
1608
    PrintS("-----------------------------------------------------------------");
1609
    PrintS("TG_RioPacketBuffer-TC3");
1610
    PrintS("Description: Test operation when restarting and aborting frames.");
1611
    PrintS("Requirement: XXXXX");
1612
    PrintS("-----------------------------------------------------------------");
1613
    PrintS("Step 1:");
1614
    PrintS("Action: Write one frame and abort it.");
1615
    PrintS("Result: The aborted frame should be discarded.");
1616
    ---------------------------------------------------------------------------
1617
    PrintR("TG_RioPacketBuffer-TC3-Step1");
1618
    ---------------------------------------------------------------------------
1619
 
1620
    assert (outboundWriteFrameFull = '0')
1621
      report "Unexpected writeFrameFull." severity error;
1622
    assert (outboundReadFrameEmpty = '1')
1623
      report "Unexpected readFrameEmpty." severity error;
1624
    assert (outboundReadWindowEmpty = '1')
1625
      report "Unexpected readWindowEmpty." severity error;
1626
 
1627
    for i in 0 to 3 loop
1628
      SetOutboundWriteContent(std_logic_vector(to_unsigned(i, 32)));
1629
      assert (outboundWriteFrameFull = '0')
1630
        report "Unexpected writeFrameFull." severity error;
1631
      assert (outboundReadFrameEmpty = '1')
1632
        report "Unexpected readFrameEmpty." severity error;
1633
      assert (outboundReadWindowEmpty = '1')
1634
        report "Unexpected readWindowEmpty." severity error;
1635
    end loop;
1636
 
1637
    SetOutboundWriteFrameAbort;
1638
    assert (outboundWriteFrameFull = '0')
1639
      report "Unexpected writeFrameFull." severity error;
1640
    assert (outboundReadFrameEmpty = '1')
1641
      report "Unexpected readFrameEmpty." severity error;
1642
    assert (outboundReadWindowEmpty = '1')
1643
      report "Unexpected readWindowEmpty." severity error;
1644
 
1645
    ---------------------------------------------------------------------------
1646
    PrintS("-----------------------------------------------------------------");
1647
    PrintS("Step 2:");
1648
    PrintS("Action: Write one full frame then one more that is aborted.");
1649
    PrintS("Result: The first frame should remain and the aborted should be ");
1650
    PrintS("        discarded.");
1651
    ---------------------------------------------------------------------------
1652
    PrintR("TG_RioPacketBuffer-TC3-Step2");
1653
    ---------------------------------------------------------------------------
1654
 
1655
    for i in 0 to 3 loop
1656
      SetOutboundWriteContent(std_logic_vector(to_unsigned(1+i, 32)));
1657
      assert (outboundWriteFrameFull = '0')
1658
        report "Unexpected writeFrameFull." severity error;
1659
      assert (outboundReadFrameEmpty = '1')
1660
        report "Unexpected readFrameEmpty." severity error;
1661
      assert (outboundReadWindowEmpty = '1')
1662
        report "Unexpected readWindowEmpty." severity error;
1663
    end loop;
1664
 
1665
    SetOutboundWriteFrame;
1666
    assert (outboundWriteFrameFull = '0')
1667
      report "Unexpected writeFrameFull." severity error;
1668
    assert (outboundReadFrameEmpty = '0')
1669
      report "Unexpected readFrameEmpty." severity error;
1670
    assert (outboundReadWindowEmpty = '0')
1671
      report "Unexpected readWindowEmpty." severity error;
1672
 
1673
    for i in 0 to 3 loop
1674
      SetOutboundWriteContent(std_logic_vector(to_unsigned(2+i, 32)));
1675
      assert (outboundWriteFrameFull = '0')
1676
        report "Unexpected writeFrameFull." severity error;
1677
      assert (outboundReadFrameEmpty = '0')
1678
        report "Unexpected readFrameEmpty." severity error;
1679
      assert (outboundReadWindowEmpty = '0')
1680
        report "Unexpected readWindowEmpty." severity error;
1681
    end loop;
1682
 
1683
    SetOutboundWriteFrameAbort;
1684
    assert (outboundWriteFrameFull = '0')
1685
      report "Unexpected writeFrameFull." severity error;
1686
    assert (outboundReadFrameEmpty = '0')
1687
      report "Unexpected readFrameEmpty." severity error;
1688
    assert (outboundReadWindowEmpty = '0')
1689
      report "Unexpected readWindowEmpty." severity error;
1690
 
1691
    for i in 0 to 3 loop
1692
      SetOutboundWriteContent(std_logic_vector(to_unsigned(3+i, 32)));
1693
      assert (outboundWriteFrameFull = '0')
1694
        report "Unexpected writeFrameFull." severity error;
1695
      assert (outboundReadFrameEmpty = '0')
1696
        report "Unexpected readFrameEmpty." severity error;
1697
      assert (outboundReadWindowEmpty = '0')
1698
        report "Unexpected readWindowEmpty." severity error;
1699
    end loop;
1700
 
1701
    SetOutboundWriteFrame;
1702
    assert (outboundWriteFrameFull = '0')
1703
      report "Unexpected writeFrameFull." severity error;
1704
    assert (outboundReadFrameEmpty = '0')
1705
      report "Unexpected readFrameEmpty." severity error;
1706
    assert (outboundReadWindowEmpty = '0')
1707
      report "Unexpected readWindowEmpty." severity error;
1708
 
1709 16 magro732
    for i in 0 to 2 loop
1710 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(1+i, 32)));
1711
      assert (outboundWriteFrameFull = '0')
1712
        report "Unexpected writeFrameFull." severity error;
1713
      assert (outboundReadFrameEmpty = '0')
1714
        report "Unexpected readFrameEmpty." severity error;
1715
      assert (outboundReadWindowEmpty = '0')
1716
        report "Unexpected readWindowEmpty." severity error;
1717
    end loop;
1718
 
1719 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1+3, 32)), '1');
1720 3 magro732
    assert (outboundWriteFrameFull = '0')
1721
      report "Unexpected writeFrameFull." severity error;
1722
    assert (outboundReadFrameEmpty = '0')
1723
      report "Unexpected readFrameEmpty." severity error;
1724
    assert (outboundReadWindowEmpty = '0')
1725
      report "Unexpected readWindowEmpty." severity error;
1726
 
1727
    SetOutboundReadWindowNext;
1728
    assert (outboundWriteFrameFull = '0')
1729
      report "Unexpected writeFrameFull." severity error;
1730
    assert (outboundReadFrameEmpty = '0')
1731
      report "Unexpected readFrameEmpty." severity error;
1732
    assert (outboundReadWindowEmpty = '0')
1733
      report "Unexpected readWindowEmpty." severity error;
1734
 
1735
    SetOutboundReadFrame;
1736
    assert (outboundWriteFrameFull = '0')
1737
      report "Unexpected writeFrameFull." severity error;
1738
    assert (outboundReadFrameEmpty = '0')
1739
      report "Unexpected readFrameEmpty." severity error;
1740
    assert (outboundReadWindowEmpty = '0')
1741
      report "Unexpected readWindowEmpty." severity error;
1742
 
1743 16 magro732
    for i in 0 to 2 loop
1744 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(3+i, 32)));
1745
      assert (outboundWriteFrameFull = '0')
1746
        report "Unexpected writeFrameFull." severity error;
1747
      assert (outboundReadFrameEmpty = '0')
1748
        report "Unexpected readFrameEmpty." severity error;
1749
      assert (outboundReadWindowEmpty = '0')
1750
        report "Unexpected readWindowEmpty." severity error;
1751
    end loop;
1752
 
1753 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(3+3, 32)), '1');
1754 3 magro732
    assert (outboundWriteFrameFull = '0')
1755
      report "Unexpected writeFrameFull." severity error;
1756
    assert (outboundReadFrameEmpty = '0')
1757
      report "Unexpected readFrameEmpty." severity error;
1758
    assert (outboundReadWindowEmpty = '0')
1759
      report "Unexpected readWindowEmpty." severity error;
1760
 
1761
    SetOutboundReadWindowNext;
1762
    assert (outboundWriteFrameFull = '0')
1763
      report "Unexpected writeFrameFull." severity error;
1764
    assert (outboundReadFrameEmpty = '0')
1765
      report "Unexpected readFrameEmpty." severity error;
1766
    assert (outboundReadWindowEmpty = '1')
1767
      report "Unexpected readWindowEmpty." severity error;
1768
 
1769
    SetOutboundReadFrame;
1770
    assert (outboundWriteFrameFull = '0')
1771
      report "Unexpected writeFrameFull." severity error;
1772
    assert (outboundReadFrameEmpty = '1')
1773
      report "Unexpected readFrameEmpty." severity error;
1774
    assert (outboundReadWindowEmpty = '1')
1775
      report "Unexpected readWindowEmpty." severity error;
1776
 
1777
    ---------------------------------------------------------------------------
1778
    PrintS("-----------------------------------------------------------------");
1779
    PrintS("Step 3:");
1780
    PrintS("Action: Write one full frame then read one that is restarted.");
1781
    PrintS("Result: The content of the first frame should be read twice. ");
1782
    ---------------------------------------------------------------------------
1783
    PrintR("TG_RioPacketBuffer-TC3-Step3");
1784
    ---------------------------------------------------------------------------
1785
 
1786
    for i in 0 to 3 loop
1787
      SetOutboundWriteContent(std_logic_vector(to_unsigned(1+i, 32)));
1788
      assert (outboundWriteFrameFull = '0')
1789
        report "Unexpected writeFrameFull." severity error;
1790
      assert (outboundReadFrameEmpty = '1')
1791
        report "Unexpected readFrameEmpty." severity error;
1792
      assert (outboundReadWindowEmpty = '1')
1793
        report "Unexpected readWindowEmpty." severity error;
1794
    end loop;
1795
 
1796
    SetOutboundWriteFrame;
1797
    assert (outboundWriteFrameFull = '0')
1798
      report "Unexpected writeFrameFull." severity error;
1799
    assert (outboundReadFrameEmpty = '0')
1800
      report "Unexpected readFrameEmpty." severity error;
1801
    assert (outboundReadWindowEmpty = '0')
1802
      report "Unexpected readWindowEmpty." severity error;
1803
 
1804 16 magro732
    for i in 0 to 2 loop
1805 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(1+i, 32)));
1806
      assert (outboundWriteFrameFull = '0')
1807
        report "Unexpected writeFrameFull." severity error;
1808
      assert (outboundReadFrameEmpty = '0')
1809
        report "Unexpected readFrameEmpty." severity error;
1810
      assert (outboundReadWindowEmpty = '0')
1811
        report "Unexpected readWindowEmpty." severity error;
1812
    end loop;
1813
 
1814 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1+3, 32)), '1');
1815 3 magro732
    assert (outboundWriteFrameFull = '0')
1816
      report "Unexpected writeFrameFull." severity error;
1817
    assert (outboundReadFrameEmpty = '0')
1818
      report "Unexpected readFrameEmpty." severity error;
1819
    assert (outboundReadWindowEmpty = '0')
1820
      report "Unexpected readWindowEmpty." severity error;
1821
 
1822
    SetOutboundReadFrameRestart;
1823
    assert (outboundWriteFrameFull = '0')
1824
      report "Unexpected writeFrameFull." severity error;
1825
    assert (outboundReadFrameEmpty = '0')
1826
      report "Unexpected readFrameEmpty." severity error;
1827
    assert (outboundReadWindowEmpty = '0')
1828
      report "Unexpected readWindowEmpty." severity error;
1829
 
1830 16 magro732
    for i in 0 to 2 loop
1831 3 magro732
      SetOutboundReadContent(std_logic_vector(to_unsigned(1+i, 32)));
1832
      assert (outboundWriteFrameFull = '0')
1833
        report "Unexpected writeFrameFull." severity error;
1834
      assert (outboundReadFrameEmpty = '0')
1835
        report "Unexpected readFrameEmpty." severity error;
1836
      assert (outboundReadWindowEmpty = '0')
1837
        report "Unexpected readWindowEmpty." severity error;
1838
    end loop;
1839
 
1840 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1+3, 32)), '1');
1841 3 magro732
    assert (outboundWriteFrameFull = '0')
1842
      report "Unexpected writeFrameFull." severity error;
1843
    assert (outboundReadFrameEmpty = '0')
1844
      report "Unexpected readFrameEmpty." severity error;
1845
    assert (outboundReadWindowEmpty = '0')
1846
      report "Unexpected readWindowEmpty." severity error;
1847
 
1848
    SetOutboundReadWindowNext;
1849
    assert (outboundWriteFrameFull = '0')
1850
      report "Unexpected writeFrameFull." severity error;
1851
    assert (outboundReadFrameEmpty = '0')
1852
      report "Unexpected readFrameEmpty." severity error;
1853
    assert (outboundReadWindowEmpty = '1')
1854
      report "Unexpected readWindowEmpty." severity error;
1855
 
1856
    SetOutboundReadFrame;
1857
    assert (outboundWriteFrameFull = '0')
1858
      report "Unexpected writeFrameFull." severity error;
1859
    assert (outboundReadFrameEmpty = '1')
1860
      report "Unexpected readFrameEmpty." severity error;
1861
    assert (outboundReadWindowEmpty = '1')
1862
      report "Unexpected readWindowEmpty." severity error;
1863
 
1864
    ---------------------------------------------------------------------------
1865
    PrintS("-----------------------------------------------------------------");
1866
    PrintS("TG_RioPacketBuffer");
1867
    PrintS("-----------------------------------------------------------------");
1868
    PrintS("TG_RioPacketBuffer-TC4");
1869
    PrintS("Description: Test operation when partial frames are read.");
1870
    PrintS("Requirement: XXXXX");
1871
    PrintS("-----------------------------------------------------------------");
1872
    PrintS("Step 1:");
1873
    PrintS("Action: Write a one word frame and read it before it is completed.");
1874
    PrintS("Result: Empty signals should reflect the status of the frame.");
1875
    ---------------------------------------------------------------------------
1876
    PrintR("TG_RioPacketBuffer-TC4-Step1");
1877
    ---------------------------------------------------------------------------
1878
 
1879
    assert (outboundWriteFrameFull = '0')
1880
      report "Unexpected writeFrameFull." severity error;
1881
    assert (outboundReadFrameEmpty = '1')
1882
      report "Unexpected readFrameEmpty." severity error;
1883
    assert (outboundReadWindowEmpty = '1')
1884
      report "Unexpected readWindowEmpty." severity error;
1885
    assert (outboundReadContentEmpty = '1')
1886
      report "Unexpected readContentEmpty." severity error;
1887
 
1888
    SetOutboundWriteContent(std_logic_vector(to_unsigned(1, 32)));
1889
    assert (outboundWriteFrameFull = '0')
1890
      report "Unexpected writeFrameFull." severity error;
1891
    assert (outboundReadFrameEmpty = '1')
1892
      report "Unexpected readFrameEmpty." severity error;
1893
    assert (outboundReadWindowEmpty = '1')
1894
      report "Unexpected readWindowEmpty." severity error;
1895
    assert (outboundReadContentEmpty = '0')
1896
      report "Unexpected readContentEmpty." severity error;
1897
 
1898 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1, 32)), '1');
1899 3 magro732
    assert (outboundWriteFrameFull = '0')
1900
      report "Unexpected writeFrameFull." severity error;
1901
    assert (outboundReadFrameEmpty = '1')
1902
      report "Unexpected readFrameEmpty." severity error;
1903
    assert (outboundReadWindowEmpty = '1')
1904
      report "Unexpected readWindowEmpty." severity error;
1905
    assert (outboundReadContentEmpty = '1')
1906
      report "Unexpected readContentEmpty." severity error;
1907
 
1908
    SetOutboundWriteFrame;
1909
    assert (outboundWriteFrameFull = '0')
1910
      report "Unexpected writeFrameFull." severity error;
1911
    assert (outboundReadFrameEmpty = '0')
1912
      report "Unexpected readFrameEmpty." severity error;
1913
    assert (outboundReadWindowEmpty = '0')
1914
      report "Unexpected readWindowEmpty." severity error;
1915
    assert (outboundReadContentEmpty = '0')
1916
      report "Unexpected readContentEmpty." severity error;
1917
 
1918
    SetOutboundReadWindowNext;
1919
    assert (outboundWriteFrameFull = '0')
1920
      report "Unexpected writeFrameFull." severity error;
1921
    assert (outboundReadFrameEmpty = '0')
1922
      report "Unexpected readFrameEmpty." severity error;
1923
    assert (outboundReadWindowEmpty = '1')
1924
      report "Unexpected readWindowEmpty." severity error;
1925
    assert (outboundReadContentEmpty = '1')
1926
      report "Unexpected readContentEmpty." severity error;
1927
 
1928
    SetOutboundReadFrame;
1929
    assert (outboundWriteFrameFull = '0')
1930
      report "Unexpected writeFrameFull." severity error;
1931
    assert (outboundReadFrameEmpty = '1')
1932
      report "Unexpected readFrameEmpty." severity error;
1933
    assert (outboundReadWindowEmpty = '1')
1934
      report "Unexpected readWindowEmpty." severity error;
1935
    assert (outboundReadContentEmpty = '1')
1936
      report "Unexpected readContentEmpty." severity error;
1937
 
1938
    ---------------------------------------------------------------------------
1939
    PrintS("-----------------------------------------------------------------");
1940
    PrintS("Step 2:");
1941
    PrintS("Action: Write content to a frame and read it, then abort the frame.");
1942
    PrintS("Result: The reader should be notified about the aborted frame. The");
1943
    PrintS("        notification should be reset when the frame has been ");
1944
    PrintS("        restarted.");
1945
    ---------------------------------------------------------------------------
1946
    PrintR("TG_RioPacketBuffer-TC4-Step2");
1947
    ---------------------------------------------------------------------------
1948
 
1949
    SetOutboundWriteContent(std_logic_vector(to_unsigned(1, 32)));
1950
    assert (outboundWriteFrameFull = '0')
1951
      report "Unexpected writeFrameFull." severity error;
1952
    assert (outboundReadFrameEmpty = '1')
1953
      report "Unexpected readFrameEmpty." severity error;
1954
    assert (outboundReadWindowEmpty = '1')
1955
      report "Unexpected readWindowEmpty." severity error;
1956
    assert (outboundReadContentEmpty = '0')
1957
      report "Unexpected readContentEmpty." severity error;
1958
    assert (outboundReadFrameAborted = '0')
1959
      report "Unexpected readFrameAborted." severity error;
1960
 
1961
    SetOutboundReadContent(std_logic_vector(to_unsigned(1, 32)));
1962
    assert (outboundWriteFrameFull = '0')
1963
      report "Unexpected writeFrameFull." severity error;
1964
    assert (outboundReadFrameEmpty = '1')
1965
      report "Unexpected readFrameEmpty." severity error;
1966
    assert (outboundReadWindowEmpty = '1')
1967
      report "Unexpected readWindowEmpty." severity error;
1968
    assert (outboundReadContentEmpty = '1')
1969
      report "Unexpected readContentEmpty." severity error;
1970
    assert (outboundReadFrameAborted = '0')
1971
      report "Unexpected readFrameAborted." severity error;
1972
 
1973
    SetOutboundWriteFrameAbort;
1974
    assert (outboundWriteFrameFull = '0')
1975
      report "Unexpected writeFrameFull." severity error;
1976
    assert (outboundReadFrameEmpty = '1')
1977
      report "Unexpected readFrameEmpty." severity error;
1978
    assert (outboundReadWindowEmpty = '1')
1979
      report "Unexpected readWindowEmpty." severity error;
1980
    assert (outboundReadContentEmpty = '0')
1981
      report "Unexpected readContentEmpty." severity error;
1982
    assert (outboundReadFrameAborted = '1')
1983
      report "Unexpected readFrameAborted." severity error;
1984
 
1985
    SetOutboundWriteContent(std_logic_vector(to_unsigned(2, 32)));
1986
    assert (outboundWriteFrameFull = '0')
1987
      report "Unexpected writeFrameFull." severity error;
1988
    assert (outboundReadFrameEmpty = '1')
1989
      report "Unexpected readFrameEmpty." severity error;
1990
    assert (outboundReadWindowEmpty = '1')
1991
      report "Unexpected readWindowEmpty." severity error;
1992
    assert (outboundReadContentEmpty = '1')
1993
      report "Unexpected readContentEmpty." severity error;
1994
    assert (outboundReadFrameAborted = '1')
1995
      report "Unexpected readFrameAborted." severity error;
1996
 
1997
    SetOutboundReadFrameRestart;
1998
    assert (outboundWriteFrameFull = '0')
1999
      report "Unexpected writeFrameFull." severity error;
2000
    assert (outboundReadFrameEmpty = '1')
2001
      report "Unexpected readFrameEmpty." severity error;
2002
    assert (outboundReadWindowEmpty = '1')
2003
      report "Unexpected readWindowEmpty." severity error;
2004
    assert (outboundReadContentEmpty = '0')
2005
      report "Unexpected readContentEmpty." severity error;
2006
    assert (outboundReadFrameAborted = '0')
2007
      report "Unexpected readFrameAborted." severity error;
2008
 
2009 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(2, 32)), '1');
2010 3 magro732
    assert (outboundWriteFrameFull = '0')
2011
      report "Unexpected writeFrameFull." severity error;
2012
    assert (outboundReadFrameEmpty = '1')
2013
      report "Unexpected readFrameEmpty." severity error;
2014
    assert (outboundReadWindowEmpty = '1')
2015
      report "Unexpected readWindowEmpty." severity error;
2016
    assert (outboundReadContentEmpty = '1')
2017
      report "Unexpected readContentEmpty." severity error;
2018
    assert (outboundReadFrameAborted = '0')
2019
      report "Unexpected readFrameAborted." severity error;
2020
 
2021
    SetOutboundWriteFrame;
2022
    assert (outboundWriteFrameFull = '0')
2023
      report "Unexpected writeFrameFull." severity error;
2024
    assert (outboundReadFrameEmpty = '0')
2025
      report "Unexpected readFrameEmpty." severity error;
2026
    assert (outboundReadWindowEmpty = '0')
2027
      report "Unexpected readWindowEmpty." severity error;
2028
    assert (outboundReadContentEmpty = '0')
2029
      report "Unexpected readContentEmpty." severity error;
2030
    assert (outboundReadFrameAborted = '0')
2031
      report "Unexpected readFrameAborted." severity error;
2032
 
2033
    SetOutboundReadWindowNext;
2034
    assert (outboundWriteFrameFull = '0')
2035
      report "Unexpected writeFrameFull." severity error;
2036
    assert (outboundReadFrameEmpty = '0')
2037
      report "Unexpected readFrameEmpty." severity error;
2038
    assert (outboundReadWindowEmpty = '1')
2039
      report "Unexpected readWindowEmpty." severity error;
2040
    assert (outboundReadContentEmpty = '1')
2041
      report "Unexpected readContentEmpty." severity error;
2042
    assert (outboundReadFrameAborted = '0')
2043
      report "Unexpected readFrameAborted." severity error;
2044
 
2045
    SetOutboundReadFrame;
2046
    assert (outboundWriteFrameFull = '0')
2047
      report "Unexpected writeFrameFull." severity error;
2048
    assert (outboundReadFrameEmpty = '1')
2049
      report "Unexpected readFrameEmpty." severity error;
2050
    assert (outboundReadWindowEmpty = '1')
2051
      report "Unexpected readWindowEmpty." severity error;
2052
    assert (outboundReadContentEmpty = '1')
2053
      report "Unexpected readContentEmpty." severity error;
2054
    assert (outboundReadFrameAborted = '0')
2055
      report "Unexpected readFrameAborted." severity error;
2056
 
2057
    ---------------------------------------------------------------------------
2058
    PrintS("-----------------------------------------------------------------");
2059
    PrintS("Step 3:");
2060
    PrintS("Action: Write one complete frame then abort a second.");
2061
    PrintS("Result: The reader should not notice the aborted frame. ");
2062
    ---------------------------------------------------------------------------
2063
    PrintR("TG_RioPacketBuffer-TC4-Step3");
2064
    ---------------------------------------------------------------------------
2065
 
2066
    SetOutboundWriteContent(std_logic_vector(to_unsigned(1, 32)));
2067
    assert (outboundWriteFrameFull = '0')
2068
      report "Unexpected writeFrameFull." severity error;
2069
    assert (outboundReadFrameEmpty = '1')
2070
      report "Unexpected readFrameEmpty." severity error;
2071
    assert (outboundReadWindowEmpty = '1')
2072
      report "Unexpected readWindowEmpty." severity error;
2073
    assert (outboundReadContentEmpty = '0')
2074
      report "Unexpected readContentEmpty." severity error;
2075
    assert (outboundReadFrameAborted = '0')
2076
      report "Unexpected readFrameAborted." severity error;
2077
 
2078 16 magro732
    SetOutboundReadContent(std_logic_vector(to_unsigned(1, 32)), '1');
2079 3 magro732
    assert (outboundWriteFrameFull = '0')
2080
      report "Unexpected writeFrameFull." severity error;
2081
    assert (outboundReadFrameEmpty = '1')
2082
      report "Unexpected readFrameEmpty." severity error;
2083
    assert (outboundReadWindowEmpty = '1')
2084
      report "Unexpected readWindowEmpty." severity error;
2085
    assert (outboundReadContentEmpty = '1')
2086
      report "Unexpected readContentEmpty." severity error;
2087
    assert (outboundReadFrameAborted = '0')
2088
      report "Unexpected readFrameAborted." severity error;
2089
 
2090
    SetOutboundWriteFrame;
2091
    assert (outboundWriteFrameFull = '0')
2092
      report "Unexpected writeFrameFull." severity error;
2093
    assert (outboundReadFrameEmpty = '0')
2094
      report "Unexpected readFrameEmpty." severity error;
2095
    assert (outboundReadWindowEmpty = '0')
2096
      report "Unexpected readWindowEmpty." severity error;
2097
    assert (outboundReadContentEmpty = '0')
2098
      report "Unexpected readContentEmpty." severity error;
2099
    assert (outboundReadFrameAborted = '0')
2100
      report "Unexpected readFrameAborted." severity error;
2101
 
2102
    SetOutboundWriteContent(std_logic_vector(to_unsigned(2, 32)));
2103
    assert (outboundWriteFrameFull = '0')
2104
      report "Unexpected writeFrameFull." severity error;
2105
    assert (outboundReadFrameEmpty = '0')
2106
      report "Unexpected readFrameEmpty." severity error;
2107
    assert (outboundReadWindowEmpty = '0')
2108
      report "Unexpected readWindowEmpty." severity error;
2109
    assert (outboundReadContentEmpty = '0')
2110
      report "Unexpected readContentEmpty." severity error;
2111
    assert (outboundReadFrameAborted = '0')
2112
      report "Unexpected readFrameAborted." severity error;
2113
 
2114
    SetOutboundWriteFrameAbort;
2115
    assert (outboundWriteFrameFull = '0')
2116
      report "Unexpected writeFrameFull." severity error;
2117
    assert (outboundReadFrameEmpty = '0')
2118
      report "Unexpected readFrameEmpty." severity error;
2119
    assert (outboundReadWindowEmpty = '0')
2120
      report "Unexpected readWindowEmpty." severity error;
2121
    assert (outboundReadContentEmpty = '0')
2122
      report "Unexpected readContentEmpty." severity error;
2123
    assert (outboundReadFrameAborted = '0')
2124
      report "Unexpected readFrameAborted." severity error;
2125
 
2126
    SetOutboundReadWindowNext;
2127
    assert (outboundWriteFrameFull = '0')
2128
      report "Unexpected writeFrameFull." severity error;
2129
    assert (outboundReadFrameEmpty = '0')
2130
      report "Unexpected readFrameEmpty." severity error;
2131
    assert (outboundReadWindowEmpty = '1')
2132
      report "Unexpected readWindowEmpty." severity error;
2133
    assert (outboundReadContentEmpty = '1')
2134
      report "Unexpected readContentEmpty." severity error;
2135
    assert (outboundReadFrameAborted = '0')
2136
      report "Unexpected readFrameAborted." severity error;
2137
 
2138
    SetOutboundReadFrame;
2139
    assert (outboundWriteFrameFull = '0')
2140
      report "Unexpected writeFrameFull." severity error;
2141
    assert (outboundReadFrameEmpty = '1')
2142
      report "Unexpected readFrameEmpty." severity error;
2143
    assert (outboundReadWindowEmpty = '1')
2144
      report "Unexpected readWindowEmpty." severity error;
2145
    assert (outboundReadContentEmpty = '1')
2146
      report "Unexpected readContentEmpty." severity error;
2147
    assert (outboundReadFrameAborted = '0')
2148
      report "Unexpected readFrameAborted." severity error;
2149
 
2150
    ---------------------------------------------------------------------------
2151
    -- Test completed.
2152
    ---------------------------------------------------------------------------
2153
 
2154
    TestEnd;
2155
  end process;
2156
 
2157
  -----------------------------------------------------------------------------
2158
  -- Instantiate the testobject.
2159
  -----------------------------------------------------------------------------
2160
 
2161
  TestPacketBuffer: RioPacketBufferWindow
2162
    port map(
2163
      clk=>clk, areset_n=>areset_n,
2164
      inboundWriteFrameFull_o=>inboundWriteFrameFull,
2165
      inboundWriteFrame_i=>inboundWriteFrame,
2166
      inboundWriteFrameAbort_i=>inboundWriteFrameAbort,
2167
      inboundWriteContent_i=>inboundWriteContent,
2168
      inboundWriteContentData_i=>inboundWriteContentData,
2169
      inboundReadFrameEmpty_o=>inboundReadFrameEmpty,
2170
      inboundReadFrame_i=>inboundReadFrame,
2171
      inboundReadFrameRestart_i=>inboundReadFrameRestart,
2172
      inboundReadFrameAborted_o=>inboundReadFrameAborted,
2173
      inboundReadContentEmpty_o=>inboundReadContentEmpty,
2174
      inboundReadContent_i=>inboundReadContent,
2175
      inboundReadContentEnd_o=>inboundReadContentEnd,
2176
      inboundReadContentData_o=>inboundReadContentData,
2177
      outboundWriteFrameFull_o=>outboundWriteFrameFull,
2178
      outboundWriteFrame_i=>outboundWriteFrame,
2179
      outboundWriteFrameAbort_i=>outboundWriteFrameAbort,
2180
      outboundWriteContent_i=>outboundWriteContent,
2181
      outboundWriteContentData_i=>outboundWriteContentData,
2182
      outboundReadFrameEmpty_o=>outboundReadFrameEmpty,
2183
      outboundReadFrame_i=>outboundReadFrame,
2184
      outboundReadFrameRestart_i=>outboundReadFrameRestart,
2185
      outboundReadFrameAborted_o=>outboundReadFrameAborted,
2186
      outboundReadWindowEmpty_o=>outboundReadWindowEmpty,
2187
      outboundReadWindowReset_i=>outboundReadWindowReset,
2188
      outboundReadWindowNext_i=>outboundReadWindowNext,
2189
      outboundReadContentEmpty_o=>outboundReadContentEmpty,
2190
      outboundReadContent_i=>outboundReadContent,
2191
      outboundReadContentEnd_o=>outboundReadContentEnd,
2192
      outboundReadContentData_o=>outboundReadContentData);
2193
 
2194
end architecture;

powered by: WebSVN 2.1.0

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