1 |
3fd18385
|
Arnaud Dieumegard
|
|
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: tc1912.vhd,v 1.2 2001-10-26 16:29:43 paw Exp $
|
27 |
|
|
-- $Revision: 1.2 $
|
28 |
|
|
--
|
29 |
|
|
-- ---------------------------------------------------------------------
|
30 |
|
|
|
31 |
|
|
ENTITY c07s02b00x00p09n03i01912ent IS
|
32 |
|
|
END c07s02b00x00p09n03i01912ent;
|
33 |
|
|
|
34 |
|
|
ARCHITECTURE c07s02b00x00p09n03i01912arch OF c07s02b00x00p09n03i01912ent IS
|
35 |
|
|
|
36 |
|
|
BEGIN
|
37 |
|
|
TESTING: PROCESS
|
38 |
|
|
variable b1a,b2a,b3a : BOOLEAN;
|
39 |
|
|
variable b1b,b2b,b3b : BOOLEAN;
|
40 |
|
|
variable b1c,b2c,b3c : BOOLEAN;
|
41 |
|
|
variable i1a,i2a,i3a : INTEGER;
|
42 |
|
|
variable i1b,i2b,i3b : INTEGER;
|
43 |
|
|
BEGIN
|
44 |
|
|
-- I. logical operator and relational operator.
|
45 |
|
|
b1a := FALSE;
|
46 |
|
|
b2a := FALSE;
|
47 |
|
|
b3a := TRUE;
|
48 |
|
|
assert ((b1a and b2a) /= b3a)
|
49 |
|
|
report "1:Parentheses do NOT change the precedence of operation.";
|
50 |
|
|
|
51 |
|
|
-- V. logical operator and miscellaneous operator.
|
52 |
|
|
b1b := FALSE;
|
53 |
|
|
b2b := TRUE;
|
54 |
|
|
assert (not (b1b and b2b))
|
55 |
|
|
report "2:Parentheses do NOT change the precedence of operation.";
|
56 |
|
|
|
57 |
|
|
-- VI. relational operators cannot be thus compared to ANY other operators
|
58 |
|
|
-- but the NOT operator, because they return boolean values and no other
|
59 |
|
|
-- higher precedence operators work on this type.
|
60 |
|
|
b1c := FALSE;
|
61 |
|
|
b2c := TRUE;
|
62 |
|
|
assert (not (b1c >= b2c))
|
63 |
|
|
report "3:Parentheses do NOT change the precedence of operation.";
|
64 |
|
|
|
65 |
|
|
-- VIII. adding operator and multiplying operator.
|
66 |
|
|
i1a := 3;
|
67 |
|
|
i2a := 4;
|
68 |
|
|
i3a := 5;
|
69 |
|
|
assert (((i1a + i2a) * i3a) = 35)
|
70 |
|
|
report "4:Parentheses do NOT change the precedence of operation.";
|
71 |
|
|
|
72 |
|
|
-- XII. multiplying operator and miscellaneous operator.
|
73 |
|
|
i1b := 2;
|
74 |
|
|
i2b := 3;
|
75 |
|
|
i3b := 2;
|
76 |
|
|
assert (((i1b + i2b) ** i3b) = 25)
|
77 |
|
|
report "5:Parentheses do NOT change the precedence of operation.";
|
78 |
|
|
|
79 |
|
|
wait for 5 ns;
|
80 |
|
|
assert NOT( ((b1a and b2a) /= b3a) and
|
81 |
|
|
(not (b1b and b2b)) and
|
82 |
|
|
(not (b1c >= b2c)) and
|
83 |
|
|
(((i1a + i2a) * i3a) = 35) and
|
84 |
|
|
(((i1b + i2b) ** i3b) = 25) )
|
85 |
|
|
report "***PASSED TEST: c07s02b00x00p09n03i01912"
|
86 |
|
|
severity NOTE;
|
87 |
|
|
assert ( ((b1a and b2a) /= b3a) and
|
88 |
|
|
(not (b1b and b2b)) and
|
89 |
|
|
(not (b1c >= b2c)) and
|
90 |
|
|
(((i1a + i2a) * i3a) = 35) and
|
91 |
|
|
(((i1b + i2b) ** i3b) = 25) )
|
92 |
|
|
report "***FAILED TEST: c07s02b00x00p09n03i01912 - The parentheses should be able to control the association of operators and operands."
|
93 |
|
|
severity ERROR;
|
94 |
|
|
wait;
|
95 |
|
|
END PROCESS TESTING;
|
96 |
|
|
|
97 |
|
|
END c07s02b00x00p09n03i01912arch;
|