Project

General

Profile

Download (2.78 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: tc1076.vhd,v 1.2 2001-10-26 16:29:38 paw Exp $
27
-- $Revision: 1.2 $
28
--
29
-- ---------------------------------------------------------------------
30

    
31
ENTITY c06s05b00x00p01n01i01076ent IS
32
  subtype    line      is integer range 0 to 15;
33
  subtype    cmd      is integer range 0 to 3;
34
  type    d_lines   is array (line range <>) of bit;
35
  subtype    data_line is d_lines(line);
36
  subtype    cmd_line  is d_lines(cmd);
37
END c06s05b00x00p01n01i01076ent;
38

    
39
ARCHITECTURE c06s05b00x00p01n01i01076arch OF c06s05b00x00p01n01i01076ent IS
40

    
41
BEGIN
42
  TESTING: PROCESS
43
    variable d1    : data_line := (0 to 3 => '1', others => '0');
44
    variable instr    : cmd_line;
45
  BEGIN
46
    --
47
    -- Test assigning a slice to a full array
48
    --
49
    instr := d1(0 to 3);
50
    for i in 0 to 3 loop
51
      assert instr(i) = '1'
52
        report "Slice to full array assignment failed."
53
        severity note ;
54
    end loop;
55

    
56
    --
57
    -- Now try a full array to a slice
58
    --
59
    d1(8 to 11) := instr;
60
    for i in 8 to 11 loop
61
      assert d1(i) = '1'
62
        report "Full array to slice assignment failed."
63
        severity note ;
64
    end loop;
65

    
66
    --
67
    -- Now try assigning a slice to a slice
68
    --
69
    d1(8 to 11) := d1(4 to 7);
70
    for i in 4 to 15 loop
71
      assert d1(i) = '0'
72
        report "Slice to slice assignment failed."
73
        severity note ;
74
    end loop;
75

    
76
    assert NOT( instr = "1111" and d1 = "1111000000000000" )
77
      report "***PASSED TEST: c06s05b00x00p01n01i01076"
78
      severity NOTE;
79
    assert ( instr = "1111" and d1 = "1111000000000000" )
80
      report "***FAILED TEST: c06s05b00x00p01n01i01076 - A slice name denotes a one-dimensional array composed of a sequence of consecutive elements of another one-dimensional array."
81
      severity ERROR;
82
    wait;
83
  END PROCESS TESTING;
84

    
85
END c06s05b00x00p01n01i01076arch;
(52-52/2088)