lustrec-tests / vhdl_json / vhdl_files / 2-exportOK / ghdl / ghdl / testsuite / vests / vhdl-93 / ashenden / compliant / ch_19_tb-qs.vhd @ 3fd18385
History | View | Annotate | Download (3.53 KB)
1 | 3fd18385 | Arnaud Dieumegard | |
---|---|---|---|
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_tb-qs.vhd,v 1.3 2001-10-26 16:29:36 paw Exp $ |
||
23 | -- $Revision: 1.3 $ |
||
24 | -- |
||
25 | -- --------------------------------------------------------------------- |
||
26 | |||
27 | library qsim; |
||
28 | library random; |
||
29 | |||
30 | use std.textio.all; |
||
31 | |||
32 | architecture queue_server of test_bench is |
||
33 | |||
34 | use qsim.qsim_types.all; |
||
35 | use random.random.all; |
||
36 | |||
37 | signal source_arc, queue_arc, server_arc : arc_type; |
||
38 | signal server_ready : boolean; |
||
39 | signal info_detail : info_detail_type := trace; |
||
40 | |||
41 | begin |
||
42 | |||
43 | source1 : entity qsim.source(behavior) |
||
44 | generic map ( name => "source1", |
||
45 | distribution => fixed, mean_inter_arrival_time => 100 ns, |
||
46 | seed => sample_seeds(1), |
||
47 | time_unit => ns, |
||
48 | info_file_name => "source1.dat" ) |
||
49 | port map ( out_arc => source_arc, |
||
50 | info_detail => info_detail ); |
||
51 | |||
52 | queue1 : entity qsim.queue(behavior) |
||
53 | generic map ( name => "queue1", |
||
54 | time_unit => ns, |
||
55 | info_file_name => "queue1.dat" ) |
||
56 | port map ( in_arc => source_arc, |
||
57 | out_arc => queue_arc, out_ready => server_ready, |
||
58 | info_detail => info_detail ); |
||
59 | |||
60 | server1 : entity qsim.server(behavior) |
||
61 | generic map ( name => "server1", |
||
62 | distribution => fixed, mean_service_time => 120 ns, |
||
63 | seed => sample_seeds(2), |
||
64 | time_unit => ns, |
||
65 | info_file_name => "server1.dat" ) |
||
66 | port map ( in_arc => queue_arc, in_ready => server_ready, |
||
67 | out_arc => server_arc, |
||
68 | info_detail => info_detail ); |
||
69 | |||
70 | sink1 : entity qsim.sink(behavior) |
||
71 | generic map ( name => "sink1", |
||
72 | time_unit => ns, |
||
73 | info_file_name => "sink1.dat" ) |
||
74 | port map ( in_arc => server_arc, |
||
75 | info_detail => info_detail ); |
||
76 | |||
77 | |||
78 | source_monitor : process is |
||
79 | variable L : line; |
||
80 | begin |
||
81 | wait on source_arc; |
||
82 | write(L, string'("source_monitor: at ")); |
||
83 | write(L, now, unit => ns); |
||
84 | write(L, string'(", ")); |
||
85 | write(L, source_arc.token, ns); |
||
86 | writeline(output, L); |
||
87 | end process source_monitor; |
||
88 | |||
89 | queue_monitor : process is |
||
90 | variable L : line; |
||
91 | begin |
||
92 | wait on queue_arc; |
||
93 | write(L, string'("queue_monitor: at ")); |
||
94 | write(L, now, unit => ns); |
||
95 | write(L, string'(", ")); |
||
96 | write(L, queue_arc.token, ns); |
||
97 | writeline(output, L); |
||
98 | end process queue_monitor; |
||
99 | |||
100 | server_monitor : process is |
||
101 | variable L : line; |
||
102 | begin |
||
103 | wait on server_arc; |
||
104 | write(L, string'("server_monitor: at ")); |
||
105 | write(L, now, unit => ns); |
||
106 | write(L, string'(", ")); |
||
107 | write(L, server_arc.token, ns); |
||
108 | writeline(output, L); |
||
109 | end process server_monitor; |
||
110 | |||
111 | |||
112 | end architecture queue_server; |