Project

General

Profile

Download (2.32 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc
3

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

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

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

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

    
20
-- ---------------------------------------------------------------------
21
--
22
-- $Id: ch_17_ch_17_05.vhd,v 1.2 2001-10-26 16:29:36 paw Exp $
23
-- $Revision: 1.2 $
24
--
25
-- ---------------------------------------------------------------------
26

    
27
entity ch_17_05 is
28

    
29
end entity ch_17_05;
30

    
31

    
32
----------------------------------------------------------------
33

    
34

    
35
architecture test of ch_17_05 is
36
begin
37

    
38

    
39
  process is
40

    
41
            -- code from book:
42

    
43
            type coordinate is array (1 to 3) of real;
44
          type coordinate_ptr is access coordinate;
45

    
46
          variable origin : coordinate_ptr := new coordinate'(0.0, 0.0, 0.0);
47

    
48
          type time_array is array (positive range <>) of time;
49
          variable activation_times : time_array(1 to 100);
50

    
51
          -- end of code from book
52

    
53
  begin
54

    
55
    report real'image( origin(1) );
56
    report real'image( origin(2) );
57
    report real'image( origin(3) );
58
    report real'image( origin.all(1) );
59

    
60
    wait;
61
  end process;
62

    
63

    
64
  process is
65

    
66
            type time_array is array (positive range <>) of time;
67

    
68
          -- code from book:
69

    
70
          type time_array_ptr is access time_array;
71

    
72
          variable activation_times : time_array_ptr;
73

    
74
          -- end of code from book
75

    
76
  begin
77

    
78
    -- code from book:
79

    
80
    activation_times := new time_array'(10 us, 15 us, 40 us);
81

    
82
    activation_times := new time_array'( activation_times.all
83
                                         & time_array'(70 us, 100 us) );
84

    
85
    activation_times := new time_array(1 to 10);
86

    
87
    -- end of code from book
88

    
89
    wait;
90
  end process;
91

    
92

    
93
end architecture test;
(116-116/171)