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_03_ch_03_01.vhd,v 1.3 2001-10-26 16:29:33 paw Exp $
|
23
|
-- $Revision: 1.3 $
|
24
|
--
|
25
|
-- ---------------------------------------------------------------------
|
26
|
|
27
|
entity ch_03_01 is
|
28
|
end entity ch_03_01;
|
29
|
|
30
|
architecture test of ch_03_01 is
|
31
|
|
32
|
signal en : bit := '0';
|
33
|
signal data_in : integer := 0;
|
34
|
|
35
|
begin
|
36
|
|
37
|
process_3_1_a : process (en, data_in) is
|
38
|
|
39
|
variable stored_value : integer := 0;
|
40
|
|
41
|
begin
|
42
|
|
43
|
-- code from book:
|
44
|
|
45
|
if en = '1' then
|
46
|
stored_value := data_in;
|
47
|
end if;
|
48
|
|
49
|
-- end of code from book
|
50
|
|
51
|
end process process_3_1_a;
|
52
|
|
53
|
stimulus : process is
|
54
|
begin
|
55
|
en <= '1' after 10 ns, '0' after 20 ns;
|
56
|
data_in <= 1 after 5 ns, 2 after 15 ns, 3 after 25 ns;
|
57
|
wait;
|
58
|
end process stimulus;
|
59
|
|
60
|
end architecture test;
|