Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

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

    
31
ENTITY c08s01b00x00p28n01i01225ent IS
32
END c08s01b00x00p28n01i01225ent;
33

    
34
ARCHITECTURE c08s01b00x00p28n01i01225arch OF c08s01b00x00p28n01i01225ent IS
35
  -- Local signals.
36
  signal A : BIT;
37
BEGIN
38
  TESTING: PROCESS
39
    -- Local variables.
40
    variable ShouldBeTime    : TIME;
41
    variable I               : INTEGER;
42
    variable k       : integer := 0;
43
  BEGIN
44
    -- Make sure it takes an EVENT to trigger the WAIT statement.
45
    A <= A after 2 ns,           -- NOT an event.
46
         (not A) after 4 ns;      -- an event.
47
    ShouldBeTime := NOW + 4 ns;   -- Should wait for event.   
48
    wait on A;
49
    if (ShouldBeTime /= Now) then
50
      k := 1;
51
    end if;
52
    assert (ShouldBeTime = NOW)
53
      report "Did not wait for 4ns";
54

    
55
    -- If the value of the condition is FALSE, resuspend.
56
    -- If the value is TRUE, the process will resume.
57
    A <= '1' after 2 ns,
58
         '0' after 4 ns;
59

    
60
    -- Make sure that we wait until the second one for
61
    -- the following wait statement to resume.
62
    ShouldBeTime := NOW + 4 ns;
63
    wait until (A = '0');
64
    if (ShouldBeTime /= Now and A /= '0') then
65
      k := 1;
66
    end if;
67
    assert (ShouldBeTime = NOW)
68
      report "Did not wait for 4ns";
69
    assert (A = '0')
70
      report "Did not assign the correct value.";
71
    
72
    -- Such resuspension does not involve the recalculation of the timeout interval.
73
    -- If the value of the condition is FALSE, resuspend.
74
    -- IF the value is TRUE, the process will resume.
75
    A <= '1' after 2 ns,
76
         '0' after 4 ns;
77
    
78
    -- Make sure that we wait until the second one for
79
    -- the following wait statement to resume.
80
    ShouldBeTime := NOW + 3 ns;
81
    wait until (A = '0') for 3 ns;
82
    if (ShouldBeTime /= Now and A /= '1') then
83
      k := 1;   
84
    end if;
85
    assert (ShouldBeTime = NOW)
86
      report "Did not wait for 3ns";
87
    assert (A = '1')
88
      report "Did not assign the correct value to A.";
89
    assert NOT( k=0 )
90
      report "***PASSED TEST: c08s01b00x00p28n01i01225"
91
      severity NOTE;
92
    assert ( k=0 )
93
      report "***FAILED TEST: c08s01b00x00p28n01i01225 - The process will resume if the result of an event occuring on sentivity set is TRUE."
94
      severity ERROR;
95
    wait;
96
  END PROCESS TESTING;
97

    
98
END c08s01b00x00p28n01i01225arch;