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: tc872.vhd,v 1.2 2001-10-26 16:30:01 paw Exp $ 27-- $Revision: 1.2 $ 28-- 29-- --------------------------------------------------------------------- 30 31package c01s03b01x00p12n01i00872pkg 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 subtype dumy is integer range 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 c01s03b01x00p12n01i00872pkg; 76 77use work.c01s03b01x00p12n01i00872pkg.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.c01s03b01x00p12n01i00872pkg.all; 120entity test1 is 121 port( 122 sigin1 : in boolean ; 123 sigout1 : out boolean ; 124 sigin2 : in bit ; 125 sigout2 : out bit ; 126 sigin4 : in severity_level ; 127 sigout4 : out severity_level ; 128 sigin5 : in integer ; 129 sigout5 : out integer ; 130 sigin6 : in real ; 131 sigout6 : out real ; 132 sigin7 : in time ; 133 sigout7 : out time ; 134 sigin8 : in natural ; 135 sigout8 : out natural ; 136 sigin9 : in positive ; 137 sigout9 : out positive ; 138 sigin10 : in record_std_package ; 139 sigout10 : out record_std_package 140 ); 141end; 142 143architecture test1 of test1 is 144begin 145 sigout1 <= false; 146 sigout2 <= '0'; 147 sigout4 <= error; 148 sigout5 <= 6; 149 sigout6 <= 6.0; 150 sigout7 <= 6 ns; 151 sigout8 <= 6; 152 sigout9 <= 6; 153 sigout10 <= (false,'0','h',error,6,6.0,6 ns,6,6); 154end; 155 156configuration test1bench of test1 is 157 for test1 158 end for; 159end; 160 161use work.c01s03b01x00p12n01i00872pkg.all; 162ENTITY c01s03b01x00p12n01i00872ent IS 163 generic( 164 zero : integer := 0; 165 one : integer := 1; 166 two : integer := 2; 167 three: integer := 3; 168 four : integer := 4; 169 five : integer := 5; 170 six : integer := 6; 171 seven: integer := 7; 172 eight: integer := 8; 173 nine : integer := 9; 174 fifteen:integer:= 15); 175 port( 176 dumy : inout bit_vector(zero to three)); 177END c01s03b01x00p12n01i00872ent; 178 179ARCHITECTURE c01s03b01x00p12n01i00872arch OF c01s03b01x00p12n01i00872ent IS 180 component test 181 port( 182 sigin1 : in boolean ; 183 sigout1 : out boolean ; 184 sigin2 : in bit ; 185 sigout2 : out bit ; 186 sigin4 : in severity_level ; 187 sigout4 : out severity_level ; 188 sigin5 : in integer ; 189 sigout5 : out integer ; 190 sigin6 : in real ; 191 sigout6 : out real ; 192 sigin7 : in time ; 193 sigout7 : out time ; 194 sigin8 : in natural ; 195 sigout8 : out natural ; 196 sigin9 : in positive ; 197 sigout9 : out positive ; 198 sigin10 : in record_std_package ; 199 sigout10 : out record_std_package 200 ); 201 end component; 202begin 203 Sin1(zero) <='1'; 204 Sin2(zero) <= true; 205 Sin4(zero) <= note; 206 Sin5(zero) <= 3; 207 Sin6(zero) <= 3.0; 208 Sin7(zero) <= 3 ns; 209 Sin8(zero) <= 1; 210 Sin9(zero) <= 1; 211 Sin10(zero) <= (C1,C2,C3,C4,C5,C6,C7,C8,C9); 212 K:block 213 component test1 214 port( 215 sigin1 : in boolean ; 216 sigout1 : out boolean ; 217 sigin2 : in bit ; 218 sigout2 : out bit ; 219 sigin4 : in severity_level ; 220 sigout4 : out severity_level ; 221 sigin5 : in integer ; 222 sigout5 : out integer ; 223 sigin6 : in real ; 224 sigout6 : out real ; 225 sigin7 : in time ; 226 sigout7 : out time ; 227 sigin8 : in natural ; 228 sigout8 : out natural ; 229 sigin9 : in positive ; 230 sigout9 : out positive ; 231 sigin10 : in record_std_package ; 232 sigout10 : out record_std_package 233 ); 234 end component; 235 236 BEGIN 237 T5 : test1 238 port map 239 ( 240 Sin2(4),Sin2(5), 241 Sin1(4),Sin1(5), 242 Sin4(4),Sin4(5), 243 Sin5(4),Sin5(5), 244 Sin6(4),Sin6(5), 245 Sin7(4),Sin7(5), 246 Sin8(4),Sin8(5), 247 Sin9(4),Sin9(5), 248 Sin10(4),Sin10(5) 249 ); 250 G: for i in zero to three generate 251 T1:test 252 port map 253 ( 254 Sin2(i),Sin2(i+1), 255 Sin1(i),Sin1(i+1), 256 Sin4(i),Sin4(i+1), 257 Sin5(i),Sin5(i+1), 258 Sin6(i),Sin6(i+1), 259 Sin7(i),Sin7(i+1), 260 Sin8(i),Sin8(i+1), 261 Sin9(i),Sin9(i+1), 262 Sin10(i),Sin10(i+1) 263 ); 264 end generate; 265 end block; 266 TESTING: PROCESS 267 variable dumb : bit_vector(zero to three); 268 BEGIN 269 wait for 1 ns; 270 assert Sin1(0) = Sin1(4) report "assignment of Sin1(0) to Sin1(4) is invalid through entity port" severity failure; 271 assert Sin2(0) = Sin2(4) report "assignment of Sin2(0) to Sin2(4) is invalid through entity port" severity failure; 272 assert Sin4(0) = Sin4(4) report "assignment of Sin4(0) to Sin4(4) is invalid through entity port" severity failure; 273 assert Sin5(0) = Sin5(4) report "assignment of Sin5(0) to Sin5(4) is invalid through entity port" severity failure; 274 assert Sin6(0) = Sin6(4) report "assignment of Sin6(0) to Sin6(4) is invalid through entity port" severity failure; 275 assert Sin7(0) = Sin7(4) report "assignment of Sin7(0) to Sin7(4) is invalid through entity port" severity failure; 276 assert Sin8(0) = Sin8(4) report "assignment of Sin8(0) to Sin8(4) is invalid through entity port" severity failure; 277 assert Sin9(0) = Sin9(4) report "assignment of Sin9(0) to Sin9(4) is invalid through entity port" severity failure; 278 assert Sin10(0) = Sin10(4) report "assignment of Sin10(0) to Sin10(4) is invalid through entity port" severity failure; 279 assert Sin1(5) = '0' report "assignment of Sin1(5) to Sin1(4) is invalid through entity port" severity failure; 280 assert Sin2(5) = false report "assignment of Sin2(5) to Sin2(4) is invalid through entity port" severity failure; 281 assert Sin4(5) = error report "assignment of Sin4(5) to Sin4(4) is invalid through entity port" severity failure; 282 assert Sin5(5) = 6 report "assignment of Sin5(5) to Sin5(4) is invalid through entity port" severity failure; 283 assert Sin6(5) = 6.0 report "assignment of Sin6(5) to Sin6(4) is invalid through entity port" severity failure; 284 assert Sin7(5) = 6 ns report "assignment of Sin7(5) to Sin7(4) is invalid through entity port" severity failure; 285 assert Sin8(5) = 6 report "assignment of Sin8(5) to Sin8(4) is invalid through entity port" severity failure; 286 assert Sin9(5) = 6 report "assignment of Sin9(5) to Sin9(4) is invalid through entity port" severity failure; 287 assert Sin10(5) = (false,'0','h',error,6,6.0,6 ns,6,6) report "assignment of Sin15(5) to Sin15(4) is invalid through entity port" severity failure; 288 289 assert NOT( Sin1(0) = sin1(4) and 290 Sin2(0) = Sin2(4) and 291 Sin4(0) = Sin4(4) and 292 Sin5(0) = Sin5(4) and 293 Sin6(0) = Sin6(4) and 294 Sin7(0) = Sin7(4) and 295 Sin8(0) = Sin8(4) and 296 Sin9(0) = Sin9(4) and 297 Sin10(0)= Sin10(4) and 298 Sin1(5) = '0' and 299 Sin2(5) = FALSE and 300 Sin4(5) = error and 301 Sin5(5) = 6 and 302 Sin6(5) = 6.0 and 303 Sin7(5) = 6 ns and 304 Sin8(5) = 6 and 305 Sin9(5) = 6 and 306 Sin10(5)=(False,'0','h',error,6,6.0,6 ns,6,6)) 307 report "***PASSED TEST: c01s03b01x00p12n01i00872" 308 severity NOTE; 309 assert ( Sin1(0) = sin1(4) and 310 Sin2(0) = Sin2(4) and 311 Sin4(0) = Sin4(4) and 312 Sin5(0) = Sin5(4) and 313 Sin6(0) = Sin6(4) and 314 Sin7(0) = Sin7(4) and 315 Sin8(0) = Sin8(4) and 316 Sin9(0) = Sin9(4) and 317 Sin10(0)= Sin10(4) and 318 Sin1(5) = '0' and 319 Sin2(5) = FALSE and 320 Sin4(5) = error and 321 Sin5(5) = 6 and 322 Sin6(5) = 6.0 and 323 Sin7(5) = 6 ns and 324 Sin8(5) = 6 and 325 Sin9(5) = 6 and 326 Sin10(5)=(False,'0','h',error,6,6.0,6 ns,6,6)) 327 report "***FAILED TEST: c01s03b01x00p12n01i00872 - 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." 328 severity ERROR; 329 wait; 330 END PROCESS TESTING; 331 332END c01s03b01x00p12n01i00872arch; 333 334configuration c01s03b01x00p12n01i00872cfg of c01s03b01x00p12n01i00872ent is 335 for c01s03b01x00p12n01i00872arch 336 for K 337 for all:test1 use configuration work.test1bench; 338 end for; 339 for G(0 to 3) 340 for others :test 341 use configuration work.testbench; 342 end for; 343 end for; 344 end for; 345 end for; 346end; 347