Project

General

Profile

Download (3.05 KB) Statistics
| Branch: | Tag: | Revision:
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: tc1119.vhd,v 1.2 2001-10-26 16:29:39 paw Exp $
27
-- $Revision: 1.2 $
28
--
29
-- ---------------------------------------------------------------------
30

    
31
ENTITY c06s05b00x00p03n01i01119ent IS
32
  subtype    idx     is integer range 1 to 10;
33
  type    aray1    is array (idx) of bit;
34
  type    aray2    is array (idx range <>) of aray1;
35
END c06s05b00x00p03n01i01119ent;
36

    
37
ARCHITECTURE c06s05b00x00p03n01i01119arch OF c06s05b00x00p03n01i01119ent IS
38

    
39
BEGIN
40
  TESTING: PROCESS
41
    variable v1   : aray1;
42
    variable v2   : aray1;
43
    variable v5    : aray1;
44
    variable v3     : aray2(1 to 2);
45
    variable v4     : aray2(1 to 3);
46
  BEGIN
47
    --
48
    -- Try slices consisting of indexed names
49
    --
50
    v1 := "1111111111";
51
    v1 := v3(1)(idx);                -- slice is a whole array
52
    assert not (v2 = v1)
53
      report "Slice of an indexed name as a value passed."
54
      severity note;
55
    
56
    v5 := "1111111111";
57
    v4(2)(idx) := v5;                -- slice is a whole array
58
    assert not(v4(2) = v5)
59
      report "Slice of an indexed name as a target passed."
60
      severity note;
61
    
62
    v2(1) := v3(1)(1 to 1)(1);               -- a one element slice
63
    assert not (v3(1)(1) = v2(1))
64
      report "One element slice of an indexed name as a value passed." 
65
      severity note;
66
    
67
    v3(1)(1 to 1)(1) := v1(1);               -- a one element slice
68
    assert not (v3(1)(1) = v1(1))
69
      report "One element slice of an indexed name as a target passed."
70
      severity note;
71

    
72
    assert NOT(   v1       = "0000000000"   and
73
                  v4(2)       = "1111111111"   and
74
                  v2(1)      = '0'      and
75
                  v3(1)(1)   = '0') 
76
      report "***PASSED TEST: c06s05b00x00p03n01i01119" 
77
      severity NOTE;
78
    assert (   v1       = "0000000000"   and
79
               v4(2)       = "1111111111"   and
80
               v2(1)      = '0'      and
81
               v3(1)(1)   = '0') 
82
      report "***FAILED TEST: c06s05b00x00p03n01i01119 - The prefix of a slice may be an indexed name." 
83
      severity ERROR;
84
    wait;
85
  END PROCESS TESTING;
86

    
87
END c06s05b00x00p03n01i01119arch;
(76-76/2088)