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_19_random.vhd,v 1.2 2001-10-26 16:29:36 paw Exp $
23-- $Revision: 1.2 $
24--
25-- ---------------------------------------------------------------------
26
27package random is
28
29  type distribution_type is (fixed, uniform, exponential);
30
31  subtype probability is real range 0.0 to 1.0;
32
33  type probability_vector is array (positive range <>) of probability;
34
35  type seed_type is record
36                      seed1, seed2 : positive;
37                    end record seed_type;
38  type seed_array is array ( natural range <> ) of seed_type;
39  constant sample_seeds : seed_array(0 to 50);
40
41  type random_info_record is record
42                               seed : seed_type;
43                               distribution : distribution_type;
44                               mean : real;
45                               lower_bound, upper_bound : real;
46                             end record random_info_record;
47
48
49  procedure init_fixed ( random_info : out random_info_record;
50                         mean : in real );
51
52  procedure init_uniform ( random_info : out random_info_record;
53                           lower_bound, upper_bound : in real;
54                           seed : in seed_type );
55
56  procedure init_exponential ( random_info : out random_info_record;
57                               mean : in real;
58                               seed : in seed_type );
59
60  procedure generate_random ( random_info : inout random_info_record;
61                              random_number : out real );
62
63end package random;
64