Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / vhdl_json / vhdl_files / 2-exportOK / ghdl / ghdl / testsuite / vests / vhdl-93 / billowitch / compliant / tc1349.vhd @ 3fd18385

History | View | Annotate | Download (6.35 KB)

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: tc1349.vhd,v 1.2 2001-10-26 16:29:40 paw Exp $
27
-- $Revision: 1.2 $
28
--
29
-- ---------------------------------------------------------------------
30

    
31
ENTITY c08s04b01x00p10n01i01349ent IS
32
END c08s04b01x00p10n01i01349ent;
33

    
34
ARCHITECTURE c08s04b01x00p10n01i01349arch OF c08s04b01x00p10n01i01349ent IS
35
  -- Local signals.
36
  signal S : BIT := '0';
37
BEGIN
38
  TESTING: PROCESS
39

    
40
    -- local variables.
41
    variable S_INITIAL : BIT;
42
    variable ShouldBeTime : TIME;
43

    
44
    variable k : integer := 0;
45

    
46
  BEGIN
47
    -- 0. Keep around the initial value of S.
48
    S_INITIAL := S;
49

    
50
    -- 1. When no preemption necessary, verify the results.  INERTIAL SAME AS TRANSPORT.
51
    S <= (not S) after 10 ns, (S) after 20 ns;
52
    -- a. Wait for first transaction.
53
    ShouldBeTime := NOW + 10 ns;
54
    wait on S;
55
    if (ShouldBeTime /= now and S /= not S_INITIAL) then
56
      k := 1;
57
    end if;
58
    assert (ShouldBeTime = NOW);
59
    assert (S = (not S_INITIAL));
60

    
61
    -- b. Wait for second transaction.
62
    ShouldBeTime := NOW + 10 ns;
63
    wait on S;
64
    if (ShouldBeTime /= now and S /= S_INITIAL) then
65
      k := 1;
66
    end if;
67
    assert (ShouldBeTime = NOW);
68
    assert (S = S_INITIAL);
69

    
70
    -- 2. Preempt a transaction which is to occur at the same time as second one.
71
    --    INERTIAL SAME AS TRANSPORT.
72
    S_INITIAL := S;
73
    S <= (S) after 10 ns;
74
    S <= (not S) after 10 ns;     -- Should preempt first transaction.
75
    -- a. Verify that the second transaction comes as expected.
76
    ShouldBeTime := NOW + 10 ns;
77
    wait on S;
78
    if (ShouldBeTime /= now and S /= not S_INITIAL) then
79
      k := 1;
80
    end if;
81
    assert (ShouldBeTime = NOW);
82
    assert (S = (not S_INITIAL));
83
    
84
    -- b. Verify that the first transaction has been preempted.
85
    ShouldBeTime := NOW + 10 ns;
86
    wait on S for 10 ns;
87
    if (ShouldBeTime /= now ) then
88
      k := 1;
89
    end if;
90
    assert (ShouldBeTime = NOW);
91
    
92
    -- 3. Preempt a transaction which is to occur at a later time than second one.
93
    --   INERTIAL SAME AS TRANSPORT.
94
    S_INITIAL := S;
95
    S <= (S) after 15 ns;
96
    S <= (not S) after 10 ns;     -- Should preempt first transaction.
97
    -- a. Verify that the second transaction comes as expected.
98
    ShouldBeTime := NOW + 10 ns;
99
    wait on S;
100
    if (ShouldBeTime /= now and S /= not S_INITIAL) then
101
      k := 1;
102
    end if;
103
    assert (ShouldBeTime = NOW);
104
    assert (S = (not S_INITIAL));
105
    
106
    -- b. Verify that the first transaction has been preempted.
107
    ShouldBeTime := NOW + 10 ns;
108
    wait on S for 10 ns;
109
    if (ShouldBeTime /= now ) then
110
      k := 1;
111
    end if;
112
    assert (ShouldBeTime = NOW);
113
    
114
    -- 4. Preempt multiple transactions.  INERTIAL SAME AS TRANSPORT.
115
    S_INITIAL := S;
116
    S <= (S) after 15 ns, (not S) after 30 ns;
117
    S <= (not S) after 10 ns, (S) after 20 ns;
118
    -- a. Verify that the second transactions come as expected.
119
    ShouldBeTime := NOW + 10 ns;
120
    wait on S;
121
    if (ShouldBeTime /= now and S /= not S_INITIAL) then
122
      k := 1;
123
    end if;
124
    assert (ShouldBeTime = NOW);
125
    assert (S = (not S_INITIAL));
126
    ShouldBeTime := NOW + 10 ns;
127
    wait on S;
128
    if (ShouldBeTime /= now and S /= S_INITIAL) then
129
      k := 1;
130
    end if;
131
    assert (ShouldBeTime = NOW);
132
    assert (S = S_INITIAL);
133
    
134
    -- b. Verify that the first transactions have been preempted.
135
    ShouldBeTime := NOW + 40 ns;
136
    wait on S for 40 ns;
137
    if (ShouldBeTime /= now ) then
138
      k := 1;
139
    end if;
140
    assert (ShouldBeTime = NOW);
141
    
142
    -- 5. Preempt transactions which occur before the second inertial assignment.
143
    S_INITIAL := S;
144
    S <= (S) after 5 ns;
145
    S <= (not S) after 10 ns, (S) after 20 ns;
146
    -- a. Verify that the second transactions come as expected.
147
    ShouldBeTime := NOW + 10 ns;
148
    wait on S;
149
    if (ShouldBeTime /= now and S /= not S_INITIAL) then
150
      k := 1;
151
    end if;
152
    assert (ShouldBeTime = NOW);
153
    assert (S = (not S_INITIAL));
154
    ShouldBeTime := NOW + 10 ns;
155
    wait on S;
156
    if (ShouldBeTime /= now and S /= S_INITIAL) then
157
      k := 1;
158
    end if;
159
    assert (ShouldBeTime = NOW);
160
    assert (S = S_INITIAL);
161
    
162
    -- b. Verify that the first transactions have been preempted.
163
    ShouldBeTime := NOW + 40 ns;
164
    wait on S for 40 ns;
165
    if (ShouldBeTime /= now ) then
166
      k := 1;
167
    end if;
168
    assert (ShouldBeTime = NOW);
169

    
170
    -- 6. Don't preempt transactions which occur before the second inertial assignment.
171
    S_INITIAL := S;
172
    S <= (not S) after 5 ns;
173
    S <= (not S) after 10 ns, (S) after 20 ns;
174
    -- a. Verify that the first transaction was NOT preempted.
175
    ShouldBeTime := NOW + 5 ns;
176
    wait on S;
177
    if (ShouldBeTime /= now and S /= not S_INITIAL) then
178
      k := 1;
179
    end if;
180
    assert (ShouldBeTime = NOW);
181
    assert (S = (not S_INITIAL));
182
    ShouldBeTime := NOW + 15 ns;
183
    wait on S;
184
    if (ShouldBeTime /= now and S /= S_INITIAL) then
185
      k := 1;
186
    end if;
187
    assert (ShouldBeTime = NOW);
188
    assert (S = S_INITIAL);
189
    
190
    -- b. Verify that there are no more transactions.
191
    ShouldBeTime := NOW + 40 ns;
192
    wait on S for 40 ns;
193
    if (ShouldBeTime /= now ) then
194
      k := 1;
195
    end if;
196
    assert (ShouldBeTime = NOW);
197

    
198
    assert NOT( k=0 )
199
      report "***PASSED TEST: c08s04b01x00p10n01i01349"
200
      severity NOTE;
201
    assert ( k=0 )
202
      report "***FAILED TEST: c08s04b01x00p10n01i01349 - Interial signal assignment test failed."
203
      severity ERROR;
204
    wait;
205
  END PROCESS TESTING;
206

    
207
END c08s04b01x00p10n01i01349arch;