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: ap_a_fg_a_01.vhd,v 1.2 2001-10-26 16:29:33 paw Exp $
|
23
|
-- $Revision: 1.2 $
|
24
|
--
|
25
|
-- ---------------------------------------------------------------------
|
26
|
|
27
|
entity fg_a_01 is
|
28
|
end entity fg_a_01;
|
29
|
|
30
|
|
31
|
|
32
|
library ieee; use ieee.std_logic_1164.all;
|
33
|
|
34
|
architecture test of fg_a_01 is
|
35
|
|
36
|
signal clk, d : std_ulogic;
|
37
|
|
38
|
begin
|
39
|
|
40
|
stimulus : process is
|
41
|
begin
|
42
|
clk <= '0'; d <= '0'; wait for 10 ns;
|
43
|
clk <= '1', '0' after 10 ns; wait for 20 ns;
|
44
|
d <= '1'; wait for 10 ns;
|
45
|
clk <= '1', '0' after 20 ns; d <= '0' after 10 ns;
|
46
|
|
47
|
wait;
|
48
|
end process stimulus;
|
49
|
|
50
|
|
51
|
b1 : block is
|
52
|
signal q : std_ulogic;
|
53
|
begin
|
54
|
|
55
|
-- code from book
|
56
|
|
57
|
process (clk) is
|
58
|
begin
|
59
|
if rising_edge(clk) then
|
60
|
q <= d;
|
61
|
end if;
|
62
|
end process;
|
63
|
|
64
|
-- end code from book
|
65
|
|
66
|
end block b1;
|
67
|
|
68
|
|
69
|
b2 : block is
|
70
|
signal q : std_ulogic;
|
71
|
begin
|
72
|
|
73
|
-- code from book
|
74
|
|
75
|
process is
|
76
|
begin
|
77
|
wait until rising_edge(clk);
|
78
|
q <= d;
|
79
|
end process;
|
80
|
|
81
|
-- end code from book
|
82
|
|
83
|
end block b2;
|
84
|
|
85
|
|
86
|
b3 : block is
|
87
|
signal q : std_ulogic;
|
88
|
begin
|
89
|
|
90
|
-- code from book
|
91
|
|
92
|
q <= d when rising_edge(clk) else
|
93
|
q;
|
94
|
|
95
|
-- end code from book
|
96
|
|
97
|
end block b3;
|
98
|
|
99
|
|
100
|
b4 : block is
|
101
|
signal q : std_ulogic;
|
102
|
begin
|
103
|
|
104
|
-- code from book
|
105
|
|
106
|
b : block ( rising_edge(clk)
|
107
|
and not clk'stable ) is
|
108
|
begin
|
109
|
q <= guarded d;
|
110
|
end block b;
|
111
|
|
112
|
-- end code from book
|
113
|
|
114
|
end block b4;
|
115
|
|
116
|
end architecture test;
|