Project

General

Profile

Download (2.35 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2
-- Copyright (C) 2001 Bill Billowitch.
3

    
4
-- Some of the work to develop this test suite was done with Air Force
5
-- support.  The Air Force and Bill Billowitch assume no
6
-- responsibilities for this software.
7

    
8
-- This file is part of VESTs (Vhdl tESTs).
9

    
10
-- VESTs is free software; you can redistribute it and/or modify it
11
-- under the terms of the GNU General Public License as published by the
12
-- Free Software Foundation; either version 2 of the License, or (at
13
-- your option) any later version. 
14

    
15
-- VESTs is distributed in the hope that it will be useful, but WITHOUT
16
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18
-- for more details. 
19

    
20
-- You should have received a copy of the GNU General Public License
21
-- along with VESTs; if not, write to the Free Software Foundation,
22
-- Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
23

    
24
-- ---------------------------------------------------------------------
25
--
26
-- $Id: tc147.vhd,v 1.2 2001-10-26 16:29:41 paw Exp $
27
-- $Revision: 1.2 $
28
--
29
-- ---------------------------------------------------------------------
30

    
31
ENTITY c04s03b02x02p14n01i00147ent IS
32
  PORT ( ii: INOUT integer);
33
  FUNCTION addup (i1,i2,i3:INTEGER:=5) RETURN INTEGER IS
34
  BEGIN
35
    IF (i1 = 0) THEN
36
      RETURN (i2+i3);
37
    ELSE
38
      RETURN addup(i2=>i1*3,i1=>0,i3=>0)+i2+i3;
39
    END IF;
40
  END;
41
END c04s03b02x02p14n01i00147ent;
42

    
43
ARCHITECTURE c04s03b02x02p14n01i00147arch OF c04s03b02x02p14n01i00147ent IS
44
  SIGNAL a1 : INTEGER := 57;
45
  SIGNAL a2 : INTEGER := 68;
46
  SIGNAL a3 : INTEGER := 77;
47
BEGIN
48
  TESTING: PROCESS
49
  BEGIN
50
    WAIT FOR 1 ns;
51
    ii <= addup(
52
      i3=>addup(i3=>-8,i1=>addup(4,2,2),i2=>addup(i1=>0,i2=>0,i3=>0)),
53
      i1=>addup(
54
        i2=>addup(
55
          i2=>addup(i2=>6,i3=>7),
56
          i1=>addup(i3=>3,i1=>1,i2=>2),
57
          i3=>addup(i2=>8,i3=>9,i1=>7)
58
          ),
59
        i1=>addup(i2=>2,i1=>1,i3=>3),
60
        i3=>addup(i2=>a2,i3=>a3,i1=>a1)
61
        ),
62
      i2=>addup(i3=>-8,i2=>0,i1=>8)
63
      );
64
    WAIT FOR 1 ns;
65
    assert NOT(ii=1346) 
66
      report "***PASSED TEST: c04s03b02x02p14n01i00147"
67
      severity NOTE;
68
    assert (ii=1346) 
69
      report "***FAILED TEST: c04s03b02x02p14n01i00147 - Function call does not use function call in parameter list." 
70
      severity ERROR;
71
    wait;
72
  END PROCESS TESTING;
73

    
74
END c04s03b02x02p14n01i00147arch;
(190-190/2088)