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 021111307 USA

23


24

 

25



26

 $Id: tc1369.vhd,v 1.2 20011026 16:29:40 paw Exp $

27

 $Revision: 1.2 $

28



29

 

30


31

ENTITY c08s05b00x00p03n01i01369ent IS

32

END c08s05b00x00p03n01i01369ent;

33


34

ARCHITECTURE c08s05b00x00p03n01i01369arch OF c08s05b00x00p03n01i01369ent IS

35

BEGIN

36

TESTING: PROCESS

37



38

 Define constants for package

39



40

constant lowb : integer := 1 ;

41

constant highb : integer := 5 ;

42

constant lowb_i2 : integer := 0 ;

43

constant highb_i2 : integer := 1000 ;

44

constant lowb_p : integer := 100 ;

45

constant highb_p : integer := 1000 ;

46

constant lowb_r : real := 0.0 ;

47

constant highb_r : real := 1000.0 ;

48

constant lowb_r2 : real := 8.0 ;

49

constant highb_r2 : real := 80.0 ;

50


51

constant c_boolean_1 : boolean := false ;

52

constant c_boolean_2 : boolean := true ;

53



54

 bit

55

constant c_bit_1 : bit := '0' ;

56

constant c_bit_2 : bit := '1' ;

57


58

 severity_level

59

constant c_severity_level_1 : severity_level := NOTE ;

60

constant c_severity_level_2 : severity_level := WARNING ;

61



62

 character

63

constant c_character_1 : character := 'A' ;

64

constant c_character_2 : character := 'a' ;

65


66

 integer types

67

 predefined

68

constant c_integer_1 : integer := lowb ;

69

constant c_integer_2 : integer := highb ;

70



71

 user defined integer type

72

type t_int1 is range 0 to 100 ;

73

constant c_t_int1_1 : t_int1 := 0 ;

74

constant c_t_int1_2 : t_int1 := 10 ;

75

subtype st_int1 is t_int1 range 8 to 60 ;

76

constant c_st_int1_1 : st_int1 := 8 ;

77

constant c_st_int1_2 : st_int1 := 9 ;

78



79

 physical types

80

 predefined

81

constant c_time_1 : time := 1 ns ;

82

constant c_time_2 : time := 2 ns ;

83



84



85

 floating point types

86

 predefined

87

constant c_real_1 : real := 0.0 ;

88

constant c_real_2 : real := 1.0 ;

89



90

 simple record

91

type t_rec1 is record

92

f1 : integer range lowb_i2 to highb_i2 ;

93

f2 : time ;

94

f3 : boolean ;

95

f4 : real ;

96

end record ;

97

constant c_t_rec1_1 : t_rec1 :=

98

(c_integer_1, c_time_1, c_boolean_1, c_real_1) ;

99

constant c_t_rec1_2 : t_rec1 :=

100

(c_integer_2, c_time_2, c_boolean_2, c_real_2) ;

101

subtype st_rec1 is t_rec1 ;

102

constant c_st_rec1_1 : st_rec1 := c_t_rec1_1 ;

103

constant c_st_rec1_2 : st_rec1 := c_t_rec1_2 ;

104



105

 more complex record

106

type t_rec2 is record

107

f1 : boolean ;

108

f2 : st_rec1 ;

109

f3 : time ;

110

end record ;

111

constant c_t_rec2_1 : t_rec2 :=

112

(c_boolean_1, c_st_rec1_1, c_time_1) ;

113

constant c_t_rec2_2 : t_rec2 :=

114

(c_boolean_2, c_st_rec1_2, c_time_2) ;

115

subtype st_rec2 is t_rec2 ;

116

constant c_st_rec2_1 : st_rec2 := c_t_rec2_1 ;

117

constant c_st_rec2_2 : st_rec2 := c_t_rec2_2 ;

118



119

 simple array

120

type t_arr1 is array (integer range <>) of st_int1 ;

121

subtype t_arr1_range1 is integer range lowb to highb ;

122

subtype st_arr1 is t_arr1 (t_arr1_range1) ;

123

constant c_st_arr1_1 : st_arr1 := (others => c_st_int1_1) ;

124

constant c_st_arr1_2 : st_arr1 := (others => c_st_int1_2) ;

125

constant c_t_arr1_1 : st_arr1 := c_st_arr1_1 ;

126

constant c_t_arr1_2 : st_arr1 := c_st_arr1_2 ;

127



128

 more complex array

129

type t_arr2 is array (integer range <>, boolean range <>) of st_arr1 ;

130

subtype t_arr2_range1 is integer range lowb to highb ;

131

subtype t_arr2_range2 is boolean range false to true ;

132

subtype st_arr2 is t_arr2 (t_arr2_range1, t_arr2_range2);

133

constant c_st_arr2_1 : st_arr2 := (others => (others => c_st_arr1_1)) ;

134

constant c_st_arr2_2 : st_arr2 := (others => (others => c_st_arr1_2)) ;

135

constant c_t_arr2_1 : st_arr2 := c_st_arr2_1 ;

136

constant c_t_arr2_2 : st_arr2 := c_st_arr2_2 ;

137



138

 most complex record

139

type t_rec3 is record

140

f1 : boolean ;

141

f2 : st_rec2 ;

142

f3 : st_arr2 ;

143

end record ;

144

constant c_t_rec3_1 : t_rec3 :=

145

(c_boolean_1, c_st_rec2_1, c_st_arr2_1) ;

146

constant c_t_rec3_2 : t_rec3 :=

147

(c_boolean_2, c_st_rec2_2, c_st_arr2_2) ;

148

subtype st_rec3 is t_rec3 ;

149

constant c_st_rec3_1 : st_rec3 := c_t_rec3_1 ;

150

constant c_st_rec3_2 : st_rec3 := c_t_rec3_2 ;

151



152

 most complex array

153

type t_arr3 is array (integer range <>, boolean range <>) of st_rec3 ;

154

subtype t_arr3_range1 is integer range lowb to highb ;

155

subtype t_arr3_range2 is boolean range true downto false ;

156

subtype st_arr3 is t_arr3 (t_arr3_range1, t_arr3_range2) ;

157

constant c_st_arr3_1 : st_arr3 := (others => (others => c_st_rec3_1)) ;

158

constant c_st_arr3_2 : st_arr3 := (others => (others => c_st_rec3_2)) ;

159

constant c_t_arr3_1 : st_arr3 := c_st_arr3_1 ;

160

constant c_t_arr3_2 : st_arr3 := c_st_arr3_2 ;

161



162

variable v_st_arr2 : st_arr2 := c_st_arr2_1 ;

163



164

BEGIN

165

v_st_arr2(st_arr2'Left(1),st_arr2'Left(2)) :=

166

c_st_arr2_2(st_arr2'Right(1),st_arr2'Right(2)) ;

167

assert NOT(v_st_arr2(st_arr2'Left(1),st_arr2'Left(2)) = c_st_arr1_2)

168

report "***PASSED TEST: c08s05b00x00p03n01i01369"

169

severity NOTE;

170

assert (v_st_arr2(st_arr2'Left(1),st_arr2'Left(2)) = c_st_arr1_2)

171

report "***FAILED TEST: c08s05b00x00p03n01i01369  The types of the variable and the assigned variable must match."

172

severity ERROR;

173

wait;

174

END PROCESS TESTING;

175


176

END c08s05b00x00p03n01i01369arch;
