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_05_ch_05_23.vhd,v 1.2 2001-10-24 23:30:59 paw Exp $
|
23
|
-- $Revision: 1.2 $
|
24
|
--
|
25
|
-- ---------------------------------------------------------------------
|
26
|
|
27
|
-- code from book:
|
28
|
|
29
|
entity and_or_inv is
|
30
|
port ( a1, a2, b1, b2 : in bit := '1';
|
31
|
y : out bit );
|
32
|
end entity and_or_inv;
|
33
|
|
34
|
-- end of code from book
|
35
|
|
36
|
architecture functional of and_or_inv is
|
37
|
begin
|
38
|
|
39
|
func : y <= not ((a1 and a2) or (b1 and b2));
|
40
|
|
41
|
end architecture functional;
|
42
|
|
43
|
entity ch_05_23 is
|
44
|
|
45
|
end entity ch_05_23;
|
46
|
|
47
|
library stimulus;
|
48
|
|
49
|
architecture test of ch_05_23 is
|
50
|
|
51
|
signal A, B, C, F : bit;
|
52
|
signal test_input : bit_vector(2 downto 0);
|
53
|
|
54
|
use stimulus.stimulus_generators.all;
|
55
|
|
56
|
begin
|
57
|
|
58
|
-- code from book:
|
59
|
|
60
|
f_cell : entity work.and_or_inv
|
61
|
port map (a1 => A, a2 => B, b1 => C, b2 => open, y => F);
|
62
|
|
63
|
-- end of code from book
|
64
|
|
65
|
stimulus_proc : all_possible_values( bv => test_input,
|
66
|
delay_between_values => 10 ns );
|
67
|
|
68
|
(A, B, C) <= test_input;
|
69
|
|
70
|
verifier :
|
71
|
postponed assert F = not ((A and B) or C)
|
72
|
report "function model produced unexpected result";
|
73
|
|
74
|
end architecture test;
|