summaryrefslogtreecommitdiff
path: root/testsuite/vests/vhdl-93/billowitch/compliant/tc91.vhd
blob: 00b9aaea724e033d86b3c10cb7ee023900556898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300

-- Copyright (C) 2001 Bill Billowitch.

-- Some of the work to develop this test suite was done with Air Force
-- support.  The Air Force and Bill Billowitch assume no
-- responsibilities for this software.

-- This file is part of VESTs (Vhdl tESTs).

-- VESTs is free software; you can redistribute it and/or modify it
-- under the terms of the GNU General Public License as published by the
-- Free Software Foundation; either version 2 of the License, or (at
-- your option) any later version. 

-- VESTs is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-- for more details. 

-- You should have received a copy of the GNU General Public License
-- along with VESTs; if not, write to the Free Software Foundation,
-- Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

-- ---------------------------------------------------------------------
--
-- $Id: tc91.vhd,v 1.2 2001-10-26 16:30:02 paw Exp $
-- $Revision: 1.2 $
--
-- ---------------------------------------------------------------------

PACKAGE c04s03b02x00p01n01i00091pkg IS
--
--
--          Declaration of composite types
--           - array types and subtypes
--
  TYPE    ut_chary    IS ARRAY (CHARACTER RANGE <>) OF INTEGER;      --unconstrained array type

  TYPE    ct_word     IS ARRAY (0 TO 15)            OF BIT;          --constrained array type

  SUBTYPE ust_subchary IS ut_chary;                                  --unconstrained array subtype

  SUBTYPE cst_str10    IS STRING    ( 1  TO 10 );                    --constrained array subtype

  SUBTYPE cst_digit    IS ut_chary  ('0' TO '9');                    --constrained array subtype

--
--          Declaration of composite types
--           - records types and subtypes
--
  TYPE month_name IS (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec );

  TYPE rt_date IS
    RECORD
      day   : INTEGER RANGE 0 TO 31;
      month : month_name;
      year  : INTEGER RANGE 0 TO 4000;
    END RECORD;
--
  SUBTYPE rst_date IS rt_date;

END c04s03b02x00p01n01i00091pkg;


USE WORK.c04s03b02x00p01n01i00091pkg.ALL;
ENTITY c04s03b02x00p01n01i00091ent_a IS
  PORT (
    SIGNAL     STRING_prt : IN     STRING (1 TO 7);
    SIGNAL BIT_VECTOR_prt : IN BIT_VECTOR (0 TO 7);
    SIGNAL   ut_chary_prt : IN   ut_chary (NUL TO ENQ);
    SIGNAL    ct_word_prt : IN    ct_word;
    SIGNAL  cst_str10_prt : IN  cst_str10;
    SIGNAL  cst_digit_prt : IN  cst_digit;
    SIGNAL    rt_date_prt : IN    rt_date;
    SIGNAL   rst_date_prt : IN   rst_date
    );
END c04s03b02x00p01n01i00091ent_a;



ARCHITECTURE c04s03b02x00p01n01i00091arch_a OF c04s03b02x00p01n01i00091ent_a IS

BEGIN
  PROCESS
  BEGIN
--
    FOR I IN 1 TO 7
    LOOP
      ASSERT STRING_prt(I) = NUL REPORT "STRING_prt not properly intialized" SEVERITY FAILURE;
    END LOOP;
    
    FOR I IN 0 TO 7
    LOOP
      ASSERT BIT_VECTOR_prt(I) = '0' REPORT "BIT_VECTOR_prt not properly intialized" SEVERITY FAILURE;
    END LOOP;
    
    FOR I IN NUL TO ENQ
    LOOP
      ASSERT ut_chary_prt(I) = INTEGER'LEFT
        REPORT "ut_chary_prt not properly intialized" SEVERITY FAILURE;
    END LOOP;
    
    FOR I IN 0 TO 15
    LOOP
      ASSERT ct_word_prt(I) = '0' REPORT "ct_word_prt not properly intialized" SEVERITY FAILURE;
    END LOOP;
    FOR I IN 1 TO 10
    LOOP
      ASSERT cst_str10_prt(I) = NUL REPORT "cst_str10_prt not properly intialized" SEVERITY FAILURE;
    END LOOP;
    
    FOR I IN '0' TO '9'
    LOOP
      ASSERT cst_digit_prt(I) = INTEGER'LEFT
        REPORT "cst_digit_prt not properly intialized" SEVERITY FAILURE;      END LOOP;
    
    ASSERT  rt_date_prt.day   = 0    REPORT " rt_date_prt.day   not properly intialized" SEVERITY FAILURE;
    ASSERT  rt_date_prt.month = Jan  REPORT " rt_date_prt.month not properly intialized" SEVERITY FAILURE;
    ASSERT  rt_date_prt.year  = 0    REPORT " rt_date_prt.year  not properly intialized" SEVERITY FAILURE;
    
    ASSERT rst_date_prt.day   = 0    REPORT "rst_date_prt.day   not properly intialized" SEVERITY FAILURE;
    ASSERT rst_date_prt.month = Jan  REPORT "rst_date_prt.month not properly intialized" SEVERITY FAILURE;
    ASSERT rst_date_prt.year  = 0    REPORT "rst_date_prt.year  not properly intialized" SEVERITY FAILURE;
    
    
    assert NOT(   STRING_prt(1)      = NUL   and
                  STRING_prt(2)      = NUL   and   
                  STRING_prt(3)      = NUL   and   
                  STRING_prt(4)      = NUL   and   
                  STRING_prt(5)      = NUL   and   
                  STRING_prt(6)      = NUL   and   
                  STRING_prt(7)      = NUL   and   
                  BIT_VECTOR_prt(1)   = '0'   and
                  BIT_VECTOR_prt(2)   = '0'   and
                  BIT_VECTOR_prt(3)   = '0'   and
                  BIT_VECTOR_prt(4)   = '0'   and
                  BIT_VECTOR_prt(5)   = '0'   and
                  BIT_VECTOR_prt(6)   = '0'   and
                  BIT_VECTOR_prt(7)   = '0'   and
                  ut_chary_prt(NUL)   = integer'left   and
                  ut_chary_prt(SOH)   = integer'left   and
                  ut_chary_prt(STX)   = integer'left   and
                  ut_chary_prt(ETX)   = integer'left   and
                  ut_chary_prt(EOT)   = integer'left   and
                  ut_chary_prt(ENQ)   = integer'left   and
                  ct_word_prt( 0)      = '0'   and
                  ct_word_prt( 1)      = '0'   and
                  ct_word_prt( 2)      = '0'   and
                  ct_word_prt( 3)      = '0'   and
                  ct_word_prt( 4)      = '0'   and
                  ct_word_prt( 5)      = '0'   and
                  ct_word_prt( 6)      = '0'   and
                  ct_word_prt( 7)      = '0'   and
                  ct_word_prt( 8)      = '0'   and
                  ct_word_prt( 9)      = '0'   and
                  ct_word_prt(10)      = '0'   and
                  ct_word_prt(11)      = '0'   and
                  ct_word_prt(12)      = '0'   and
                  ct_word_prt(13)      = '0'   and
                  ct_word_prt(14)      = '0'   and
                  ct_word_prt(15)      = '0'   and
                  cst_str10_prt( 1)   = NUL   and
                  cst_str10_prt( 2)   = NUL   and
                  cst_str10_prt( 3)   = NUL   and
                  cst_str10_prt( 4)   = NUL   and
                  cst_str10_prt( 5)   = NUL   and
                  cst_str10_prt( 6)   = NUL   and
                  cst_str10_prt( 7)   = NUL   and
                  cst_str10_prt( 8)   = NUL   and
                  cst_str10_prt( 9)   = NUL   and
                  cst_str10_prt(10)   = NUL   and
                  cst_digit_prt('0')   = integer'left   and
                  cst_digit_prt('1')   = integer'left   and
                  cst_digit_prt('2')   = integer'left   and
                  cst_digit_prt('3')   = integer'left   and
                  cst_digit_prt('4')   = integer'left   and
                  cst_digit_prt('5')   = integer'left   and
                  cst_digit_prt('6')   = integer'left   and
                  cst_digit_prt('7')   = integer'left   and
                  cst_digit_prt('8')   = integer'left   and
                  cst_digit_prt('9')   = integer'left   and
                  rt_date_prt.day      = 0   and
                  rt_date_prt.month   = Jan   and
                  rt_date_prt.year   = 0   and
                  rst_date_prt.day   = 0   and
                  rst_date_prt.month   = Jan   and
                  rst_date_prt.year   = 0   )
      report "***PASSED TEST: c04s03b02x00p01n01i00091"
      severity NOTE;
    assert (   STRING_prt(1)      = NUL   and
               STRING_prt(2)      = NUL   and   
               STRING_prt(3)      = NUL   and   
               STRING_prt(4)      = NUL   and   
               STRING_prt(5)      = NUL   and   
               STRING_prt(6)      = NUL   and   
               STRING_prt(7)      = NUL   and   
               BIT_VECTOR_prt(1)   = '0'   and
               BIT_VECTOR_prt(2)   = '0'   and
               BIT_VECTOR_prt(3)   = '0'   and
               BIT_VECTOR_prt(4)   = '0'   and
               BIT_VECTOR_prt(5)   = '0'   and
               BIT_VECTOR_prt(6)   = '0'   and
               BIT_VECTOR_prt(7)   = '0'   and
               ut_chary_prt(NUL)   = integer'left   and
               ut_chary_prt(SOH)   = integer'left   and
               ut_chary_prt(STX)   = integer'left   and
               ut_chary_prt(ETX)   = integer'left   and
               ut_chary_prt(EOT)   = integer'left   and
               ut_chary_prt(ENQ)   = integer'left   and
               ct_word_prt( 0)      = '0'   and
               ct_word_prt( 1)      = '0'   and
               ct_word_prt( 2)      = '0'   and
               ct_word_prt( 3)      = '0'   and
               ct_word_prt( 4)      = '0'   and
               ct_word_prt( 5)      = '0'   and
               ct_word_prt( 6)      = '0'   and
               ct_word_prt( 7)      = '0'   and
               ct_word_prt( 8)      = '0'   and
               ct_word_prt( 9)      = '0'   and
               ct_word_prt(10)      = '0'   and
               ct_word_prt(11)      = '0'   and
               ct_word_prt(12)      = '0'   and
               ct_word_prt(13)      = '0'   and
               ct_word_prt(14)      = '0'   and
               ct_word_prt(15)      = '0'   and
               cst_str10_prt( 1)   = NUL   and
               cst_str10_prt( 2)   = NUL   and
               cst_str10_prt( 3)   = NUL   and
               cst_str10_prt( 4)   = NUL   and
               cst_str10_prt( 5)   = NUL   and
               cst_str10_prt( 6)   = NUL   and
               cst_str10_prt( 7)   = NUL   and
               cst_str10_prt( 8)   = NUL   and
               cst_str10_prt( 9)   = NUL   and
               cst_str10_prt(10)   = NUL   and
               cst_digit_prt('0')   = integer'left   and
               cst_digit_prt('1')   = integer'left   and
               cst_digit_prt('2')   = integer'left   and
               cst_digit_prt('3')   = integer'left   and
               cst_digit_prt('4')   = integer'left   and
               cst_digit_prt('5')   = integer'left   and
               cst_digit_prt('6')   = integer'left   and
               cst_digit_prt('7')   = integer'left   and
               cst_digit_prt('8')   = integer'left   and
               cst_digit_prt('9')   = integer'left   and
               rt_date_prt.day      = 0   and
               rt_date_prt.month   = Jan   and
               rt_date_prt.year   = 0   and
               rst_date_prt.day   = 0   and
               rst_date_prt.month   = Jan   and
               rst_date_prt.year   = 0   )
      report "***FAILED TEST: c04s03b02x00p01n01i00091 - Variables as the interface objects that appear as variable parameters of subprogram."
      severity ERROR;
    wait;
  END PROCESS;

END c04s03b02x00p01n01i00091arch_a;


USE WORK.c04s03b02x00p01n01i00091pkg.ALL;
ENTITY c04s03b02x00p01n01i00091ent IS
END c04s03b02x00p01n01i00091ent;

ARCHITECTURE c04s03b02x00p01n01i00091arch OF c04s03b02x00p01n01i00091ent IS
  COMPONENT c04s03b02x00p01n01i00091ent_a
    PORT (
      SIGNAL     STRING_prt : IN     STRING (1 TO 7);
      SIGNAL BIT_VECTOR_prt : IN BIT_VECTOR (0 TO 7);
      SIGNAL   ut_chary_prt : IN   ut_chary (NUL TO ENQ);
      SIGNAL    ct_word_prt : IN    ct_word;
      SIGNAL  cst_str10_prt : IN  cst_str10;
      SIGNAL  cst_digit_prt : IN  cst_digit;
      SIGNAL    rt_date_prt : IN    rt_date;
      SIGNAL   rst_date_prt : IN   rst_date
      );
  END COMPONENT;
  for c : c04s03b02x00p01n01i00091ent_a use entity work.c04s03b02x00p01n01i00091ent_a(c04s03b02x00p01n01i00091arch_a);
  
  SIGNAL     STRING_prt :     STRING (1 TO 7);
  SIGNAL BIT_VECTOR_prt : BIT_VECTOR (0 TO 7);
  SIGNAL   ut_chary_prt :   ut_chary (NUL TO ENQ);
  SIGNAL    ct_word_prt :    ct_word;
  SIGNAL  cst_str10_prt :  cst_str10;
  SIGNAL  cst_digit_prt :  cst_digit;
  SIGNAL    rt_date_prt :    rt_date;
  SIGNAL   rst_date_prt :   rst_date;
  
BEGIN
  C : c04s03b02x00p01n01i00091ent_a
    PORT MAP ( STRING_prt,
               BIT_VECTOR_prt,
               ut_chary_prt,
               ct_word_prt,
               cst_str10_prt,
               cst_digit_prt,
               rt_date_prt,
               rst_date_prt );
  

END c04s03b02x00p01n01i00091arch;