1 |
d93979b7
|
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_07_fg_07_14.vhd,v 1.1.1.1 2001-08-22 18:20:48 paw Exp $
|
23 |
|
|
-- $Revision: 1.1.1.1 $
|
24 |
|
|
--
|
25 |
|
|
-- ---------------------------------------------------------------------
|
26 |
|
|
|
27 |
|
|
entity fg_07_14 is
|
28 |
|
|
end entity fg_07_14;
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
architecture test of fg_07_14 is
|
33 |
|
|
|
34 |
|
|
-- code from book
|
35 |
|
|
|
36 |
|
|
procedure check_setup ( signal data, clock : in bit;
|
37 |
|
|
constant Tsu : in time ) is
|
38 |
|
|
begin
|
39 |
|
|
if clock'event and clock = '1' then
|
40 |
|
|
assert data'last_event >= Tsu
|
41 |
|
|
report "setup time violation" severity error;
|
42 |
|
|
end if;
|
43 |
|
|
end procedure check_setup;
|
44 |
|
|
|
45 |
|
|
-- end code from book
|
46 |
|
|
|
47 |
|
|
signal ready, phi2 : bit := '0';
|
48 |
|
|
constant Tsu_rdy_clk : delay_length := 4 ns;
|
49 |
|
|
|
50 |
|
|
begin
|
51 |
|
|
|
52 |
|
|
-- code from book (in text)
|
53 |
|
|
|
54 |
|
|
check_ready_setup : check_setup ( data => ready, clock => phi2,
|
55 |
|
|
Tsu => Tsu_rdy_clk );
|
56 |
|
|
|
57 |
|
|
-- end code from book
|
58 |
|
|
|
59 |
|
|
clock_gen : phi2 <= '1' after 10 ns, '0' after 20 ns when phi2 = '0';
|
60 |
|
|
|
61 |
|
|
stimulus : ready <= '1' after 4 ns,
|
62 |
|
|
'0' after 56 ns,
|
63 |
|
|
'1' after 87 ns,
|
64 |
|
|
'0' after 130 ns;
|
65 |
|
|
|
66 |
|
|
end architecture test;
|