Project

General

Profile

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

    
31
ENTITY c09s02b00x00p05n01i01703ent IS
32
END c09s02b00x00p05n01i01703ent;
33

    
34
ARCHITECTURE c09s02b00x00p05n01i01703arch OF c09s02b00x00p05n01i01703ent IS
35
  signal s : boolean := false;
36
BEGIN
37

    
38
  TESTING: PROCESS
39
    type result_type is (fail, pass);
40
    variable result : result_type := fail;
41
    variable i, j   : integer;
42
    variable k   : integer := 0;
43
  BEGIN
44
    --
45
    -- Test all sequential statements in this process
46
    --
47
    s <= true;                        -- signal assignment        
48
    j := 1;                           -- variable assignment
49
    i := 0;
50
    
51
    L1: while  ( i < 10 )  loop       -- conditional loop
52
      if i > 2 then
53
        exit;
54
      end if;
55
      case i is
56
        when 0 =>
57
          L2: for j in 1 to 3 loop
58
            case j is
59
              when 3 =>       -- should never execute because of
60
                i := i + 1; -- alternative 2
61
                k := 1;
62
                exit;
63
                assert false
64
                  report "exit in loop 2 case failed."
65
                  severity note;
66
              when 2 =>
67
                i := i + 1;
68
                next L1;
69
                k := 1;
70
                assert false     -- should never execute
71
                  report "next in loop 2 case failed."
72
                  severity note;
73
              when 1 =>
74
                assert false
75
                  report "first iteration of loop 2."
76
                  severity note ;
77
                next;     -- applies to loop L2
78
              when others =>
79
                --
80
                -- This should never be executed but is
81
                -- required by the 1076-1987 spec. which
82
                -- says the subtype of 'j' is the same as
83
                -- the base type (integer) and not constrained
84
                -- to the range "1 to 3".
85
                --
86
                k := 1;
87
                assert false
88
                  report "Should never get here."
89
                  severity note ;
90
            end case;
91
            k := 1;
92
            assert false      -- should never execute
93
              report "next in loop 2 failed."
94
              severity note;
95
          end loop L2;
96
        when 2 =>
97
          s <= false after 5 ns;
98
          wait for 6 ns;
99
          assert not s
100
            report "wait statement in loop L1 failed."
101
            severity note ;
102
          
103
          i := i +1;
104
        when 1 =>
105
          null;
106
          assert false
107
            report "null statement and next statement worked."
108
            severity note ;
109
          i := i +1;
110
        when others =>
111
          k := 1;
112
          assert false
113
            report "exit in if statement in loop L1 failed."
114
            severity note ;
115
          exit;
116
      end case;
117
    end loop L1;
118

    
119
    wait for 50 ns;
120

    
121
    assert NOT(s=false and k = 0 and j=1) 
122
      report "***PASSED TEST: c09s02b00x00p05n01i01703" 
123
      severity NOTE;
124
    assert (s=false and k = 0 and j=1) 
125
      report "***FAILED TEST: c09s02b00x00p05n01i01703 - Process statement execution failed." 
126
      severity ERROR;
127
    wait;
128
  END PROCESS TESTING;
129

    
130
END c09s02b00x00p05n01i01703arch;
(307-307/2088)