Project

General

Profile

Download (2.96 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2
-- Copyright (C) 2001 Bill Billowitch.
3

    
4
-- Some of the work to develop this test suite was done with Air Force
5
-- support.  The Air Force and Bill Billowitch assume no
6
-- responsibilities for this software.
7

    
8
-- This file is part of VESTs (Vhdl tESTs).
9

    
10
-- VESTs is free software; you can redistribute it and/or modify it
11
-- under the terms of the GNU General Public License as published by the
12
-- Free Software Foundation; either version 2 of the License, or (at
13
-- your option) any later version. 
14

    
15
-- VESTs is distributed in the hope that it will be useful, but WITHOUT
16
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18
-- for more details. 
19

    
20
-- You should have received a copy of the GNU General Public License
21
-- along with VESTs; if not, write to the Free Software Foundation,
22
-- Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
23

    
24
-- ---------------------------------------------------------------------
25
--
26
-- $Id: tc1576.vhd,v 1.2 2001-10-26 16:29:42 paw Exp $
27
-- $Revision: 1.2 $
28
--
29
-- ---------------------------------------------------------------------
30

    
31
ENTITY c08s10b00x00p04n01i01576ent IS
32
END c08s10b00x00p04n01i01576ent;
33

    
34
ARCHITECTURE c08s10b00x00p04n01i01576arch OF c08s10b00x00p04n01i01576ent IS
35

    
36
BEGIN
37
  TESTING: PROCESS
38
    -- Local variables
39
    variable DIDIT    : BOOLEAN;
40
    variable CONSTONE : INTEGER := 1;
41
    variable   k     : integer := 0;
42
  BEGIN
43
    -- The following loop should never fail its assertion.
44
    DIDIT := FALSE;
45
    for I in 0 to 10 loop
46
      -- Make sure that the last statement of loop is executed.
47
      if  (I /= 0) then
48
        if (DIDIT /= true) then
49
          k := 1;
50
        end if;
51
        assert (DIDIT)
52
          report "Did not execute statement after 'next when FALSE'";
53
        DIDIT := FALSE;
54
      end if;
55
      
56
      -- This condition is NEVER true.
57
      next when FALSE;
58
      
59
      -- This statement should always be executed.
60
      DIDIT := TRUE;
61
    end loop;
62
    
63
    -- The following loop should never fail its assertion.
64
    DIDIT := FALSE;
65
    for I in 0 to 10 loop
66
      -- Make sure that the last statement of loop is executed.
67
      if  (I /= 0) then
68
        if (DIDIT /= true) then
69
          k := 1;
70
        end if;
71
        assert (DIDIT)
72
          report "Did not execute statement after 'next when FALSE'";
73
        DIDIT := FALSE;
74
      end if;
75
      
76
      -- This condition is NEVER true.
77
      next when (CONSTONE /= 1);
78
      
79
      -- This statement should always be executed.
80
      DIDIT := TRUE;
81
    end loop;
82

    
83
    assert NOT( k=0 ) 
84
      report "***PASSED TEST: c08s10b00x00p04n01i01576" 
85
      severity NOTE;
86
    assert ( k=0 ) 
87
      report "***FAILED TEST: c08s10b00x00p04n01i01576 - If the condition in the next statement is FALSE, it should execute the sequence of statements enclosed within the loop condition with the next statement." 
88
      severity ERROR;
89
    wait;
90
  END PROCESS TESTING;
91

    
92
END c08s10b00x00p04n01i01576arch;
(250-250/2088)