Project

General

Profile

Download (3.15 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: tc1572.vhd,v 1.2 2001-10-26 16:29:42 paw Exp $
27
-- $Revision: 1.2 $
28
--
29
-- ---------------------------------------------------------------------
30

    
31
ENTITY c08s10b00x00p03n01i01572ent IS
32
END c08s10b00x00p03n01i01572ent;
33

    
34
ARCHITECTURE c08s10b00x00p03n01i01572arch OF c08s10b00x00p03n01i01572ent 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
    -- TEST1:  Should always go to outer loop.
44
    OUTERLOOP:
45
    for I in 1 to 10 loop
46

    
47
      INNERLOOP:
48
      for J in 1 to 10 loop
49
        -- Skip to next iteration of outerloop.
50
        next OUTERLOOP;
51

    
52
        k := 1;
53
        -- This should never be executed.
54
        assert (FALSE)
55
          report "Statement should never be executed.";
56
      end loop INNERLOOP;
57

    
58
      k := 1;
59
      -- This should never be executed.
60
      assert (FALSE)
61
        report "Statement should never be executed.";
62
    end loop OUTERLOOP;
63
    
64
    -- TEST2:  Should always go to inner loop.
65
    -- Set the flag initially.
66
    DIDIT := TRUE;
67
    
68
    -- Execute the loops.
69
    OUTERLOOP2:
70
    for I in 1 to 10 loop
71
      
72
      INNERLOOP2:
73
      for J in 1 to 10 loop
74
        -- Check that last statement of OUTERLOOP2 got done.
75
        if  (J = 1) then
76
          assert (DIDIT)
77
            report "Last statement of OUTERLOOP2 was not executed.";
78
          if (DIDIT /= true) then   
79
            k := 1;
80
          end if;
81
          DIDIT := FALSE;
82
        end if;
83
        
84
        -- Skip to next iteration of outerloop.
85
        next INNERLOOP2;
86
        k := 1; 
87
        -- This should never be executed.
88
        assert (FALSE)
89
          report "Statement should never be executed.";
90
      end loop INNERLOOP2;
91
      
92
      -- This should ALWAYS be executed.
93
      DIDIT := TRUE;
94
    end loop OUTERLOOP2;
95
    assert NOT(k=0) 
96
      report "***PASSED TEST: c08s10b00x00p03n01i01572"
97
      severity NOTE;
98
    assert (k=0) 
99
      report "***FAILED TEST: c08s10b00x00p03n01i01572 - The NEXT statement did not properly associated with the loop whose label it matchs." 
100
      severity ERROR;
101
    wait;
102
  END PROCESS TESTING;
103

    
104
END c08s10b00x00p03n01i01572arch;
(241-241/2088)