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: tc865.vhd,v 1.2 2001-10-26 16:30:04 paw Exp $ 27-- $Revision: 1.2 $ 28-- 29-- --------------------------------------------------------------------- 30 31package c01s03b01x00p12n01i00865pkg is 32 constant low_number : integer := 0; 33 constant hi_number : integer := 3; 34 subtype hi_to_low_range is integer range low_number to hi_number; 35 type boolean_vector is array (natural range <>) of boolean; 36 type severity_level_vector is array (natural range <>) of severity_level; 37 type integer_vector is array (natural range <>) of integer; 38 type real_vector is array (natural range <>) of real; 39 type time_vector is array (natural range <>) of time; 40 type natural_vector is array (natural range <>) of natural; 41 type positive_vector is array (natural range <>) of positive; 42 type record_std_package is record 43 a: boolean; 44 b: bit; 45 c:character; 46 d:severity_level; 47 e:integer; 48 f:real; 49 g:time; 50 h:natural; 51 i:positive; 52 end record; 53 type array_rec_std is array (natural range <>) of record_std_package; 54 type four_value is ('Z','0','1','X'); 55--enumerated type 56 constant C1 : boolean := true; 57 constant C2 : bit := '1'; 58 constant C3 : character := 's'; 59 constant C4 : severity_level := note; 60 constant C5 : integer := 3; 61 constant C6 : real := 3.0; 62 constant C7 : time := 3 ns; 63 constant C8 : natural := 1; 64 constant C9 : positive := 1; 65 signal dumy : bit_vector(0 to 3); 66 signal Sin1 : bit_vector(0 to 5) ; 67 signal Sin2 : boolean_vector(0 to 5) ; 68 signal Sin4 : severity_level_vector(0 to 5) ; 69 signal Sin5 : integer_vector(0 to 5) ; 70 signal Sin6 : real_vector(0 to 5) ; 71 signal Sin7 : time_vector(0 to 5) ; 72 signal Sin8 : natural_vector(0 to 5) ; 73 signal Sin9 : positive_vector(0 to 5) ; 74 signal Sin10: array_rec_std(0 to 5) ; 75end c01s03b01x00p12n01i00865pkg; 76 77use work.c01s03b01x00p12n01i00865pkg.all; 78entity test is 79 port( 80 sigin1 : in boolean ; 81 sigout1 : out boolean ; 82 sigin2 : in bit ; 83 sigout2 : out bit ; 84 sigin4 : in severity_level ; 85 sigout4 : out severity_level ; 86 sigin5 : in integer ; 87 sigout5 : out integer ; 88 sigin6 : in real ; 89 sigout6 : out real ; 90 sigin7 : in time ; 91 sigout7 : out time ; 92 sigin8 : in natural ; 93 sigout8 : out natural ; 94 sigin9 : in positive ; 95 sigout9 : out positive ; 96 sigin10 : in record_std_package ; 97 sigout10 : out record_std_package 98 ); 99end; 100 101architecture test of test is 102begin 103 sigout1 <= sigin1; 104 sigout2 <= sigin2; 105 sigout4 <= sigin4; 106 sigout5 <= sigin5; 107 sigout6 <= sigin6; 108 sigout7 <= sigin7; 109 sigout8 <= sigin8; 110 sigout9 <= sigin9; 111 sigout10 <= sigin10; 112end; 113 114configuration testbench of test is 115 for test 116 end for; 117end; 118 119use work.c01s03b01x00p12n01i00865pkg.all; 120ENTITY c01s03b01x00p12n01i00865ent IS 121 generic( 122 zero : integer := 0; 123 one : integer := 1; 124 two : integer := 2; 125 three: integer := 3; 126 four : integer := 4; 127 five : integer := 5; 128 six : integer := 6; 129 seven: integer := 7; 130 eight: integer := 8; 131 nine : integer := 9; 132 fifteen:integer:= 15); 133END c01s03b01x00p12n01i00865ent; 134 135ARCHITECTURE c01s03b01x00p12n01i00865arch OF c01s03b01x00p12n01i00865ent IS 136 component test 137 port( 138 sigin1 : in boolean ; 139 sigout1 : out boolean ; 140 sigin2 : in bit ; 141 sigout2 : out bit ; 142 sigin4 : in severity_level ; 143 sigout4 : out severity_level ; 144 sigin5 : in integer ; 145 sigout5 : out integer ; 146 sigin6 : in real ; 147 sigout6 : out real ; 148 sigin7 : in time ; 149 sigout7 : out time ; 150 sigin8 : in natural ; 151 sigout8 : out natural ; 152 sigin9 : in positive ; 153 sigout9 : out positive ; 154 sigin10 : in record_std_package ; 155 sigout10 : out record_std_package 156 ); 157 end component; 158begin 159 Sin1(zero) <='1'; 160 Sin2(zero) <= true; 161 Sin4(zero) <= note; 162 Sin5(zero) <= 3; 163 Sin6(zero) <= 3.0; 164 Sin7(zero) <= 3 ns; 165 Sin8(zero) <= 1; 166 Sin9(zero) <= 1; 167 Sin10(zero) <= (C1,C2,C3,C4,C5,C6,C7,C8,C9); 168 K:block 169 component test 170 port( 171 sigin1 : in boolean ; 172 sigout1 : out boolean ; 173 sigin2 : in bit ; 174 sigout2 : out bit ; 175 sigin4 : in severity_level ; 176 sigout4 : out severity_level ; 177 sigin5 : in integer ; 178 sigout5 : out integer ; 179 sigin6 : in real ; 180 sigout6 : out real ; 181 sigin7 : in time ; 182 sigout7 : out time ; 183 sigin8 : in natural ; 184 sigout8 : out natural ; 185 sigin9 : in positive ; 186 sigout9 : out positive ; 187 sigin10 : in record_std_package ; 188 sigout10 : out record_std_package 189 ); 190 end component; 191 192 BEGIN 193 T5 : test 194 port map 195 ( 196 Sin2(4),Sin2(5), 197 Sin1(4),Sin1(5), 198 Sin4(4),Sin4(5), 199 Sin5(4),Sin5(5), 200 Sin6(4),Sin6(5), 201 Sin7(4),Sin7(5), 202 Sin8(4),Sin8(5), 203 Sin9(4),Sin9(5), 204 Sin10(4),Sin10(5) 205 ); 206 G: for i in zero to three generate 207 T1:test 208 port map 209 ( 210 Sin2(i),Sin2(i+1), 211 Sin1(i),Sin1(i+1), 212 Sin4(i),Sin4(i+1), 213 Sin5(i),Sin5(i+1), 214 Sin6(i),Sin6(i+1), 215 Sin7(i),Sin7(i+1), 216 Sin8(i),Sin8(i+1), 217 Sin9(i),Sin9(i+1), 218 Sin10(i),Sin10(i+1) 219 ); 220 end generate; 221 end block; 222 TESTING: PROCESS 223 BEGIN 224 wait for 1 ns; 225 assert Sin1(0) = Sin1(5) report "assignment of Sin1(0) to Sin1(4) is invalid through entity port" severity failure; 226 assert Sin2(0) = Sin2(5) report "assignment of Sin2(0) to Sin2(4) is invalid through entity port" severity failure; 227 assert Sin4(0) = Sin4(5) report "assignment of Sin4(0) to Sin4(4) is invalid through entity port" severity failure; 228 assert Sin5(0) = Sin5(5) report "assignment of Sin5(0) to Sin5(4) is invalid through entity port" severity failure; 229 assert Sin6(0) = Sin6(5) report "assignment of Sin6(0) to Sin6(4) is invalid through entity port" severity failure; 230 assert Sin7(0) = Sin7(5) report "assignment of Sin7(0) to Sin7(4) is invalid through entity port" severity failure; 231 assert Sin8(0) = Sin8(5) report "assignment of Sin8(0) to Sin8(4) is invalid through entity port" severity failure; 232 assert Sin9(0) = Sin9(5) report "assignment of Sin9(0) to Sin9(4) is invalid through entity port" severity failure; 233 assert Sin10(0) = Sin10(5) report "assignment of Sin10(0) to Sin10(4) is invalid through entity port" severity failure; 234 assert NOT( Sin1(0) = sin1(5) and 235 Sin2(0) = Sin2(5) and 236 Sin4(0) = Sin4(5) and 237 Sin5(0) = Sin5(5) and 238 Sin6(0) = Sin6(5) and 239 Sin7(0) = Sin7(5) and 240 Sin8(0) = Sin8(5) and 241 Sin9(0) = Sin9(5) and 242 Sin10(0)= Sin10(0) ) 243 report "***PASSED TEST: c01s03b01x00p12n01i00865" 244 severity NOTE; 245 assert ( Sin1(0) = sin1(5) and 246 Sin2(0) = Sin2(5) and 247 Sin4(0) = Sin4(5) and 248 Sin5(0) = Sin5(5) and 249 Sin6(0) = Sin6(5) and 250 Sin7(0) = Sin7(5) and 251 Sin8(0) = Sin8(5) and 252 Sin9(0) = Sin9(5) and 253 Sin10(0)= Sin10(0) ) 254 report "***FAILED TEST: c01s03b01x00p12n01i00865 - If such a block configuration contains an index specification that is a discrete range, then the block configuration applies to those implicit block statements that are generated for the specified range of values of the corresponding generate index." 255 severity ERROR; 256 wait; 257 END PROCESS TESTING; 258 259END c01s03b01x00p12n01i00865arch; 260 261configuration c01s03b01x00p12n01i00865cfg of c01s03b01x00p12n01i00865ent is 262 for c01s03b01x00p12n01i00865arch 263 for K 264 for T5:test use configuration work.testbench; 265 end for; 266 for G(zero to one) 267 for T1:test 268 use configuration work.testbench; 269 end for; 270 end for; 271 for G(three downto two) 272 for T1:test 273 use configuration work.testbench; 274 end for; 275 end for; 276 end for; 277 end for; 278end; 279