Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (4.69 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: tc1348.vhd,v 1.2 2001-10-26 16:29:40 paw Exp $
27
-- $Revision: 1.2 $
28
--
29
-- ---------------------------------------------------------------------
30

    
31
ENTITY c08s04b01x00p07n01i01348ent IS
32
END c08s04b01x00p07n01i01348ent;
33

    
34
ARCHITECTURE c08s04b01x00p07n01i01348arch OF c08s04b01x00p07n01i01348ent IS
35

    
36
  -- Local signals.
37
  signal S : BIT := '0';
38

    
39
BEGIN
40
  TESTING: PROCESS
41
    -- local variables.
42
    variable S_INITIAL : BIT;
43
    variable ShouldBeTime : TIME;
44

    
45
    variable k : integer := 0;
46

    
47
  BEGIN
48
    -- 0. Keep around the initial value of S.
49
    S_INITIAL := S;
50
    
51
    -- 1. When no preemption necessary, verify the results.
52
    S <= transport (not S) after 10 ns, (S) after 20 ns;
53
    -- a. Wait for first transaction.
54
    ShouldBeTime := NOW + 10 ns;
55
    wait on S;
56
    if (ShouldBeTime /= now or S /= not S_INITIAL) then
57
      k := 1;
58
    end if;
59
    assert (ShouldBeTime = NOW);
60
    assert (S = (not S_INITIAL));
61

    
62
    -- b. Wait for second transaction.
63
    ShouldBeTime := NOW + 10 ns;
64
    wait on S;
65
    assert (ShouldBeTime = NOW);
66
    assert (S = S_INITIAL);
67

    
68
    -- 2. Preempt a transaction which is to occur at the same time as second one.
69
    S_INITIAL := S;
70
    S <= transport (S) after 10 ns;
71
    S <= transport (not S) after 10 ns;     -- Should preempt first transaction.
72
    -- a. Verify that the second transaction comes as expected.
73
    ShouldBeTime := NOW + 10 ns;
74
    wait on S;
75
    if (ShouldBeTime /= now or S /= not S_INITIAL) then
76
      k := 1;
77
    end if;
78
    assert (ShouldBeTime = NOW);
79
    assert (S = (not S_INITIAL));
80
    
81
    -- b. Verify that the first transaction has been preempted.
82
    ShouldBeTime := NOW + 10 ns;
83
    wait on S for 10 ns;
84
    if (ShouldBeTime /= now) then
85
      k := 1;
86
    end if;
87
    assert (ShouldBeTime = NOW);
88
    
89
    -- 3. Preempt a transaction which is to occur at a later time than second one.
90
    S_INITIAL := S;
91
    S <= transport (S) after 15 ns;
92
    S <= transport (not S) after 10 ns;     -- Should preempt first transaction.
93
    -- a. Verify that the second transaction comes as expected.
94
    ShouldBeTime := NOW + 10 ns;
95
    wait on S;  
96
    if (ShouldBeTime /= now or S /= not S_INITIAL) then
97
      k := 1;
98
    end if;
99
    assert (ShouldBeTime = NOW);
100
    assert (S = (not S_INITIAL));
101
    
102
    -- b. Verify that the first transaction has been preempted.
103
    ShouldBeTime := NOW + 10 ns;
104
    wait on S for 10 ns;
105
    if (ShouldBeTime /= now) then
106
      k := 1;
107
    end if;
108
    assert (ShouldBeTime = NOW);
109
    
110
    -- 4. Preempt multiple transactions.
111
    S_INITIAL := S;
112
    S <= transport (S) after 15 ns, (not S) after 30 ns;
113
    S <= transport (not S) after 10 ns, (S) after 20 ns;
114
    -- a. Verify that the second transactions come as expected.
115
    ShouldBeTime := NOW + 10 ns;
116
    wait on S;
117
    if (ShouldBeTime /= now or S /= not S_INITIAL) then
118
      k := 1;
119
    end if;
120
    assert (ShouldBeTime = NOW);
121
    assert (S = (not S_INITIAL));
122
    ShouldBeTime := NOW + 10 ns;
123
    wait on S;
124
    if (ShouldBeTime /= now or S /= S_INITIAL) then
125
      k := 1;
126
    end if;
127
    assert (ShouldBeTime = NOW);
128
    assert (S = S_INITIAL);
129
    
130
    -- b. Verify that the first transactions have been preempted.
131
    ShouldBeTime := NOW + 40 ns;
132
    wait on S for 40 ns;
133
    if (ShouldBeTime /= now) then
134
      k := 1;
135
    end if;
136
    assert (ShouldBeTime = NOW);
137

    
138
    assert NOT( k=0 )
139
      report "***PASSED TEST: c08s04b01x00p07n01i01348"
140
      severity NOTE;
141
    assert ( k=0 )
142
      report "***FAILED TEST: c08s04b01x00p07n01i01348 - The sequence of transactions is used to update the projected output waveform representing the current and future values of the driver associated with the signal assignment statement."
143
      severity ERROR;
144
    wait;
145
  END PROCESS TESTING;
146

    
147
END c08s04b01x00p07n01i01348arch;