PlTbUtils  1.3
PlTbUtils is a collection of functions, procedures and components for easily creating stimuli and checking response in automatic self-checking testbenches.
pltbutils_func_pkg.vhd
Go to the documentation of this file.
1 
36 
37 library ieee;
38  use ieee.std_logic_1164.all;
39  use ieee.numeric_std.all;
40  use std.textio.all;
41  use work.txt_util.all;
42  use work.pltbutils_user_cfg_pkg.all;
43 
47 
48  constant C_PLTBUTILS_STRLEN : natural := 80;
49  constant C_PLTBUTILS_SKIPTESTLEN : natural := 512;
50  constant C_PLTBUTILS_TIMEOUT : time := 10 sec;
51  constant C_WAIT_BEFORE_STOP_TIME : time := 1 us;
52 
53  constant EMPTY_CHR : character := ' ';
54 
72  type pltbv_t is record
73  testcase_name : string(1 to C_PLTBUTILS_STRLEN);
74  testcase_name_len : integer;
75  test_num : integer;
76  test_name : string(1 to C_PLTBUTILS_STRLEN);
77  test_name_len : integer;
78  skiptests : std_logic_vector(0 to C_PLTBUTILS_SKIPTESTLEN-1);
79  test_active : boolean;
80  info : string(1 to C_PLTBUTILS_STRLEN);
81  info_len : integer;
82  test_cnt : integer;
83  skiptest_cnt : integer;
84  chk_cnt : integer;
85  err_cnt : integer;
86  chk_cnt_in_test : integer;
87  err_cnt_in_test : integer;
88  stop_sim : std_logic;
89  end record;
90 
91  constant C_PLTBV_INIT : pltbv_t := (
92  testcase_name => (others => EMPTY_CHR),
93  testcase_name_len => 1,
94  test_num => 0,
95  test_name => (others => EMPTY_CHR),
96  test_name_len => 1,
97  skiptests => (others => '0'),
98  test_active => true,
99  info => (others => EMPTY_CHR),
100  info_len => 1,
101  test_cnt => 0,
102  skiptest_cnt => 0,
103  chk_cnt => 0,
104  err_cnt => 0,
105  chk_cnt_in_test => 0,
106  err_cnt_in_test => 0,
107  stop_sim => '0'
108  );
109 
117  type pltbs_t is
118  record
119  test_num : natural;
120  test_name : string(1 to C_PLTBUTILS_STRLEN);
121  info : string(1 to C_PLTBUTILS_STRLEN);
122  chk_cnt : natural;
123  err_cnt : natural;
124  stop_sim : std_logic;
125  end record;
126 
127  constant C_PLTBS_INIT : pltbs_t := (
128  test_num => 0,
129  test_name => (others => EMPTY_CHR),
130  info => (others => EMPTY_CHR),
131  chk_cnt => 0,
132  err_cnt => 0,
133  stop_sim => '0'
134  );
135 
175  procedure startsim(
176  constant testcase_name : in string;
177  constant skiptests : in std_logic_vector;
178  variable pltbv : inout pltbv_t;
179  signal pltbs : out pltbs_t
180  );
181 
229  procedure endsim(
230  variable pltbv : inout pltbv_t;
231  signal pltbs : out pltbs_t;
232  constant show_success_fail : in boolean := false;
233  constant force_stop : in boolean := false
234  );
235 
252  procedure starttest(
253  constant name : in string;
254  variable pltbv : inout pltbv_t;
255  signal pltbs : out pltbs_t
256  );
257 
276 - procedure starttest(
277  constant num : in integer := 1;
278  constant name : in string;
279  variable pltbv : inout pltbv_t;
280  signal pltbs : out pltbs_t
281  );
282 
295  function is_test_active(
296  constant pltbv : in pltbv_t
297  ) return boolean;
298 
308  procedure endtest(
309  variable pltbv : inout pltbv_t;
310  signal pltbs : out pltbs_t
311  );
312 
335  procedure print(
336  constant active : in boolean;
337  variable pltbv : inout pltbv_t;
338  signal pltbs : out pltbs_t;
339  constant txt : in string
340  );
341 
349  procedure print(
350  constant active : in boolean;
351  signal s : out string;
352  constant txt : in string
353  );
354 
360  procedure print(
361  signal s : out string;
362  constant txt : in string
363  );
364 
377  procedure printv(
378  constant active : in boolean;
379  variable s : out string;
380  constant txt : in string
381  );
382 
388  procedure printv(
389  variable s : out string;
390  constant txt : in string
391  );
392 
397  procedure print(
398  variable pltbv : inout pltbv_t;
399  signal pltbs : out pltbs_t;
400  constant txt : in string
401  );
402 
412  procedure print2(
413  constant active : in boolean;
414  variable pltbv : inout pltbv_t;
415  signal pltbs : out pltbs_t;
416  constant txt : in string
417  );
418 
420  procedure print2(
421  constant active : in boolean;
422  signal s : out string;
423  constant txt : in string
424  );
425 
427  procedure print2(
428  signal s : out string;
429  constant txt : in string
430  );
431 
433  procedure print2(
434  variable pltbv : inout pltbv_t;
435  signal pltbs : out pltbs_t;
436  constant txt : in string
437  );
438 
463  procedure waitclks(
464  constant N : in natural;
465  signal clk : in std_logic;
466  variable pltbv : inout pltbv_t;
467  signal pltbs : out pltbs_t;
468  constant falling : in boolean := false;
469  constant timeout : in time := C_PLTBUTILS_TIMEOUT
470  );
471 
499  procedure waitsig(
500  signal s : in integer;
501  constant value : in integer;
502  signal clk : in std_logic;
503  variable pltbv : inout pltbv_t;
504  signal pltbs : out pltbs_t;
505  constant falling : in boolean := false;
506  constant timeout : in time := C_PLTBUTILS_TIMEOUT
507  );
508 
510  procedure waitsig(
511  signal s : in std_logic;
512  constant value : in std_logic;
513  signal clk : in std_logic;
514  variable pltbv : inout pltbv_t;
515  signal pltbs : out pltbs_t;
516  constant falling : in boolean := false;
517  constant timeout : in time := C_PLTBUTILS_TIMEOUT
518  );
519 
521  procedure waitsig(
522  signal s : in std_logic;
523  constant value : in integer;
524  signal clk : in std_logic;
525  variable pltbv : inout pltbv_t;
526  signal pltbs : out pltbs_t;
527  constant falling : in boolean := false;
528  constant timeout : in time := C_PLTBUTILS_TIMEOUT
529  );
530 
532  procedure waitsig(
533  signal s : in std_logic_vector;
534  constant value : in std_logic_vector;
535  signal clk : in std_logic;
536  variable pltbv : inout pltbv_t;
537  signal pltbs : out pltbs_t;
538  constant falling : in boolean := false;
539  constant timeout : in time := C_PLTBUTILS_TIMEOUT
540  );
541 
543  procedure waitsig(
544  signal s : in std_logic_vector;
545  constant value : in integer;
546  signal clk : in std_logic;
547  variable pltbv : inout pltbv_t;
548  signal pltbs : out pltbs_t;
549  constant falling : in boolean := false;
550  constant timeout : in time := C_PLTBUTILS_TIMEOUT
551  );
552 
554  procedure waitsig(
555  signal s : in unsigned;
556  constant value : in unsigned;
557  signal clk : in std_logic;
558  variable pltbv : inout pltbv_t;
559  signal pltbs : out pltbs_t;
560  constant falling : in boolean := false;
561  constant timeout : in time := C_PLTBUTILS_TIMEOUT
562  );
563 
565  procedure waitsig(
566  signal s : in unsigned;
567  constant value : in integer;
568  signal clk : in std_logic;
569  variable pltbv : inout pltbv_t;
570  signal pltbs : out pltbs_t;
571  constant falling : in boolean := false;
572  constant timeout : in time := C_PLTBUTILS_TIMEOUT
573  );
574 
576  procedure waitsig(
577  signal s : in signed;
578  constant value : in signed;
579  signal clk : in std_logic;
580  variable pltbv : inout pltbv_t;
581  signal pltbs : out pltbs_t;
582  constant falling : in boolean := false;
583  constant timeout : in time := C_PLTBUTILS_TIMEOUT
584  );
585 
587  procedure waitsig(
588  signal s : in signed;
589  constant value : in integer;
590  signal clk : in std_logic;
591  variable pltbv : inout pltbv_t;
592  signal pltbs : out pltbs_t;
593  constant falling : in boolean := false;
594  constant timeout : in time := C_PLTBUTILS_TIMEOUT
595  );
596 
598  procedure waitsig(
599  signal s : in std_logic;
600  constant value : in std_logic;
601  variable pltbv : inout pltbv_t;
602  signal pltbs : out pltbs_t;
603  constant timeout : in time := C_PLTBUTILS_TIMEOUT
604  );
605 
609  procedure waitsig(
610  signal s : in std_logic;
611  variable pltbv : inout pltbv_t;
612  signal pltbs : out pltbs_t;
613  constant falling : in boolean := false;
614  constant timeout : in time := C_PLTBUTILS_TIMEOUT
615  );
616 
654  procedure check(
655  constant rpt : in string;
656  constant actual : in std_logic_vector;
657  constant expected : in std_logic_vector;
658  constant mask : in std_logic_vector;
659  variable pltbv : inout pltbv_t;
660  signal pltbs : out pltbs_t
661  );
662 
664  procedure check(
665  constant rpt : in string;
666  constant actual : in integer;
667  constant expected : in integer;
668  variable pltbv : inout pltbv_t;
669  signal pltbs : out pltbs_t
670  );
671 
673  procedure check(
674  constant rpt : in string;
675  constant actual : in std_logic;
676  constant expected : in std_logic;
677  variable pltbv : inout pltbv_t;
678  signal pltbs : out pltbs_t
679  );
680 
682  procedure check(
683  constant rpt : in string;
684  constant actual : in std_logic;
685  constant expected : in integer;
686  variable pltbv : inout pltbv_t;
687  signal pltbs : out pltbs_t
688  );
689 
691  procedure check(
692  constant rpt : in string;
693  constant actual : in std_logic_vector;
694  constant expected : in std_logic_vector;
695  variable pltbv : inout pltbv_t;
696  signal pltbs : out pltbs_t
697  );
698 
700  procedure check(
701  constant rpt : in string;
702  constant actual : in std_logic_vector;
703  constant expected : in integer;
704  variable pltbv : inout pltbv_t;
705  signal pltbs : out pltbs_t
706  );
707 
709  procedure check(
710  constant rpt : in string;
711  constant actual : in std_logic_vector;
712  constant expected : in integer;
713  constant mask : in std_logic_vector;
714  variable pltbv : inout pltbv_t;
715  signal pltbs : out pltbs_t
716  );
717 
719  procedure check(
720  constant rpt : in string;
721  constant actual : in unsigned;
722  constant expected : in unsigned;
723  variable pltbv : inout pltbv_t;
724  signal pltbs : out pltbs_t
725  );
726 
728  procedure check(
729  constant rpt : in string;
730  constant actual : in unsigned;
731  constant expected : in integer;
732  variable pltbv : inout pltbv_t;
733  signal pltbs : out pltbs_t
734  );
735 
737  procedure check(
738  constant rpt : in string;
739  constant actual : in signed;
740  constant expected : in signed;
741  variable pltbv : inout pltbv_t;
742  signal pltbs : out pltbs_t
743  );
744 
746  procedure check(
747  constant rpt : in string;
748  constant actual : in signed;
749  constant expected : in integer;
750  variable pltbv : inout pltbv_t;
751  signal pltbs : out pltbs_t
752  );
753 
755  procedure check(
756  constant rpt : in string;
757  constant actual : in boolean;
758  constant expected : in boolean;
759  variable pltbv : inout pltbv_t;
760  signal pltbs : out pltbs_t
761  );
762 
764  procedure check(
765  constant rpt : in string;
766  constant actual : in boolean;
767  constant expected : in integer;
768  variable pltbv : inout pltbv_t;
769  signal pltbs : out pltbs_t
770  );
771 
773  procedure check(
774  constant rpt : in string;
775  constant actual : in time;
776  constant expected : in time;
777  variable pltbv : inout pltbv_t;
778  signal pltbs : out pltbs_t
779  );
780 
805  procedure check(
806  constant rpt : in string;
807  constant actual : in time;
808  constant expected : in time;
809  constant tolerance : in time;
810  variable pltbv : inout pltbv_t;
811  signal pltbs : out pltbs_t
812  );
813 
815  procedure check(
816  constant rpt : in string;
817  constant actual : in string;
818  constant expected : in string;
819  variable pltbv : inout pltbv_t;
820  signal pltbs : out pltbs_t
821  );
822 
824  procedure check(
825  constant rpt : in string;
826  constant expr : in boolean;
827  variable pltbv : inout pltbv_t;
828  signal pltbs : out pltbs_t
829  );
830 
869  procedure check(
870  constant rpt : in string;
871  constant expr : in boolean;
872  constant actual : in string;
873  constant expected : in string;
874  constant mask : in string;
875  variable pltbv : inout pltbv_t;
876  signal pltbs : out pltbs_t
877  );
878 
924  procedure check_binfile(
925  constant rpt : in string;
926  constant filename1 : in string;
927  constant filename2 : in string;
928  constant verbosity : in integer;
929  variable pltbv : inout pltbv_t;
930  signal pltbs : out pltbs_t
931  );
932 
968  procedure check_txtfile(
969  constant rpt : in string;
970  constant filename1 : in string;
971  constant filename2 : in string;
972  constant verbosity : in integer;
973  variable pltbv : inout pltbv_t;
974  signal pltbs : out pltbs_t
975  );
976 
1023  procedure check_datfile(
1024  constant rpt : in string;
1025  constant filename1 : in string;
1026  constant filename2 : in string;
1027  constant verbosity : in integer;
1028  variable pltbv : inout pltbv_t;
1029  signal pltbs : out pltbs_t;
1030  constant skip_init_items : in integer := 0
1031  );
1032 
1048  function to_ascending(
1049  constant s : std_logic_vector
1050  ) return std_logic_vector;
1051 
1053  function to_ascending(
1054  constant s : unsigned
1055  ) return unsigned;
1056 
1058  function to_ascending(
1059  constant s : signed
1060  ) return signed;
1061 
1077  function to_descending(
1078  constant s : std_logic_vector
1079  ) return std_logic_vector;
1080 
1082  function to_descending(
1083  constant s : unsigned
1084  ) return unsigned;
1085 
1087  function to_descending(
1088  constant s : signed
1089  ) return signed;
1090 
1110 """" function hxstr(
1111  constant s : std_logic_vector;
1112  constant prefix : string := ;
1113  constant postfix : string :=
1114  ) return string;
1115 
1119 """" function hxstr(
1120  constant s : unsigned;
1121  constant prefix : string := ;
1122  constant postfix : string :=
1123  ) return string;
1124 
1128 """" function hxstr(
1129  constant s : signed;
1130  constant prefix : string := ;
1131  constant postfix : string :=
1132  ) return string;
1133 
1135  procedure pltbs_update(
1136  variable pltbv : inout pltbv_t;
1137  signal pltbs : out pltbs_t
1138  );
1139 
1142  function str(
1143  constant n : integer;
1144  constant len : integer;
1145  constant fillchar : character := ' '
1146  ) return string;
1147 
1152  function str_equal (
1153  constant s1 : STRING;
1154  constant s2 : STRING
1155  ) return boolean;
1156 
1157 end package pltbutils_func_pkg;
1158 
1159 package body pltbutils_func_pkg is
1160 
1161  procedure starttest_msg(
1162  constant test_num : in integer;
1163  constant test_name : in string;
1164  constant timestamp : in time
1165  ) is
1166  begin
1167  print(lf & "Test " & str(test_num) & ": " & test_name & " (" & time'image(timestamp) & ")");
1168  end procedure starttest_msg;
1169 
1170  procedure skiptest_msg(
1171  constant test_num : in integer;
1172  constant test_name : in string;
1173  constant timestamp : in time
1174  ) is
1175  begin
1176  print(lf & "Skipping Test " & str(test_num) & ": " & test_name & " (" & time'image(timestamp) & ")");
1177  end procedure skiptest_msg;
1178 
1179  procedure endtest_msg(
1180  constant test_num : in integer;
1181  constant test_name : in string;
1182  constant timestamp : in time;
1183  constant test_active : in boolean;
1184  constant num_checks_in_test : in integer;
1185  constant num_errors_in_test : in integer
1186  ) is
1187  begin
1188  if test_active then
1189  print("Done with test " & str(test_num) & ": " & test_name & " (" & time'image(timestamp) & ")");
1190  end if;
1191  end procedure endtest_msg;
1192 
1193  procedure check_msg(
1194  constant rpt : in string;
1195  constant timestamp : in time;
1196  constant expr : in boolean;
1197  constant actual : in string;
1198  constant expected : in string;
1199  constant mask : in string;
1200  constant test_num : in integer;
1201  constant test_name : in string;
1202  constant check_num : in integer;
1203  constant err_cnt_in_test : in integer
1204  ) is
1205  variable actual_str_len : integer := 1;
1206  variable actual_str : string(1 to actual'length+8) := (others => ' ');
1207  variable expected_str : string(1 to expected'length+10) := (others => ' ');
1208  variable expected_str_len : integer := 1;
1209  variable mask_str : string(1 to mask'length+6) := (others => ' ');
1210  variable mask_str_len : integer := 1;
1211  constant C_ACTUAL_PREFIX : string := " Actual=";
1212  constant C_ACTUAL_POSTFIX : string := "";
1213  constant C_EXPECTED_PREFIX : string := " Expected=";
1214  constant C_EXPECTED_POSTFIX : string := "";
1215  constant C_MASK_PREFIX : string := " Mask=";
1216  constant C_MASK_POSTFIX : string := "";
1217  begin
1218  if not expr then -- Output message only if the check fails
1219  if str_equal(mask, "!NO_TAGS!") then
1220  -- if mask=!NO_TAGS!, then do not add Actual= and Expected=" tags to strings
1221  actual_str_len := actual'length;
1222  actual_str(1 to actual_str_len) := actual;
1223  expected_str_len := expected'length;
1224  expected_str(1 to expected_str_len) := expected;
1225  mask_str_len := 1;
1226  else
1227  -- Add Actual= and Expected= tags to strings
1228  if actual /= "" then
1229  --actual_str_len := 8 + actual'length;
1230  --actual_str := " Actual=" & actual;
1231  actual_str_len := C_ACTUAL_PREFIX'length + actual'length + C_ACTUAL_POSTFIX'length;
1232  actual_str(1 to actual_str_len) := C_ACTUAL_PREFIX & tcfilter(actual) & C_ACTUAL_POSTFIX;
1233  end if;
1234  if expected /= "" then
1235  --expected_str_len := 10 + expected'length;
1236  --expected_str := " Expected=" & expected;
1237  expected_str_len := C_EXPECTED_PREFIX'length + expected'length + C_EXPECTED_POSTFIX'length;
1238  expected_str(1 to expected_str_len) := C_EXPECTED_PREFIX & tcfilter(expected) & C_EXPECTED_POSTFIX;
1239  end if;
1240  if mask /= "" then
1241  --mask_str_len := 6 + mask'length;
1242  --mask_str := " Mask=" & mask;
1243  mask_str_len := C_MASK_PREFIX'length + mask'length + C_MASK_POSTFIX'length;
1244  mask_str(1 to mask_str_len) := C_MASK_PREFIX & tcfilter(mask) & C_MASK_POSTFIX;
1245  end if;
1246  end if;
1247  assert false
1248  report "Check " & str(check_num) & "; " & rpt & "; " &
1249  actual_str(1 to actual_str_len) &
1250  expected_str(1 to expected_str_len) &
1251  mask_str(1 to mask_str_len) &
1252  " in test " & str(test_num) & " " & test_name
1253  severity error;
1254  end if;
1255  end procedure check_msg;
1256 
1257  procedure error_msg(
1258  constant rpt : in string;
1259  constant timestamp : in time;
1260  constant test_num : in integer;
1261  constant test_name : in string;
1262  constant err_cnt_in_test : in integer
1263  ) is
1264  begin
1265  assert false
1266  report rpt & " in test " & str(test_num) & ": " & test_name
1267  severity error;
1268  end procedure error_msg;
1269 
1270  procedure stopsim(
1271  constant timestamp : in time
1272  ) is
1273  begin
1274  assert false
1275  report "--- FORCE END OF SIMULATION ---" &
1276  " (ignore this false failure message, it's not a real failure)"
1277  severity failure;
1278  end procedure stopsim;
1279 
1280  procedure startsim_msg(
1281  constant testcase_name : in string;
1282  constant timestamp : in time
1283  ) is
1284  begin
1285  print(lf & "--- START OF SIMULATION ---");
1286  print("Testcase: " & testcase_name);
1287  print(time'image(timestamp));
1288  end procedure startsim_msg;
1289 
1290  procedure endsim_msg(
1291  constant testcase_name : in string;
1292  constant timestamp : in time;
1293  constant num_tests : in integer;
1294  constant num_skiptests : in integer;
1295  constant num_checks : in integer;
1296  constant num_errors : in integer;
1297  constant show_success_fail : in boolean
1298  ) is
1299  variable l : line;
1300  begin
1301  print(lf & "--- END OF SIMULATION ---");
1302  print("Note: the results presented below are based on the PlTbUtil's check() procedure calls.");
1303  print(" The design may contain more errors, for which there are no check() calls.");
1304  write(l, timestamp, right, 14);
1305  writeline(output, l);
1306  write(l, num_tests, right, 11);
1307  write(l, string'(" Tests"));
1308  writeline(output, l);
1309  write(l, num_skiptests, right, 11);
1310  write(l, string'(" Skipped tests"));
1311  writeline(output, l);
1312  write(l, num_checks, right, 11);
1313  write(l, string'(" Checks"));
1314  writeline(output, l);
1315  write(l, num_errors, right, 11);
1316  write(l, string'(" Errors"));
1317  writeline(output, l);
1318  if show_success_fail then
1319  if num_errors = 0 and num_checks > 0 then
1320  print("*** SUCCESS ***");
1321  elsif num_checks > 0 then
1322  print("*** FAIL ***");
1323  else
1324  print("*** NO CHECKS ***");
1325  end if;
1326  end if;
1327  end procedure endsim_msg;
1328 
1329 
1330 
1331  -- Get next item (word) in a file
1332  procedure get_file_item(
1333  file f : text;
1334  variable l : inout line;
1335  variable item : out string;
1336  variable item_len : out integer;
1337  variable line_num : inout integer;
1338  variable item_num : inout integer
1339  ) is
1340  variable c : character := ' ';
1341  variable c_good : boolean := true;
1342  variable i : integer := 0;
1343  begin
1344  item := (item'low to item'high => ' ');
1345  item_len := 0;
1346  while i = 0 loop
1347  -- Get next line, unless we're already processing a line
1348  if l = null then
1349  exit when endfile(f);
1350  readline(f, l);
1351  line_num := line_num + 1;
1352  elsif l'length = 0 then
1353  exit when endfile(f);
1354  readline(f, l);
1355  line_num := line_num + 1;
1356  end if;
1357 
1358  -- Find next item on the line
1359  read(l, c, c_good);
1360  -- Skip leading whitespace characters
1361  while c_good and (c = ' ' or c = ht or c = cr or c = lf) loop
1362  read(l, c, c_good);
1363  end loop;
1364  -- Read item until next whitespace, comment character or end-of-line
1365  while c_good and c /= ' ' and c /= ht and c /= cr and c /= lf and c /= '#' loop
1366  -- If i >= item'length, an error will occur. We don't try to do anything
1367  -- about that here, because it is probably better that the user
1368  -- find out the hard way, instead of trying to hide the problem.
1369  item(item'low + i) := c;
1370  i := i + 1;
1371  read(l, c, c_good);
1372  end loop;
1373 
1374  -- If a comment character was found, absorb the rest of the comment
1375  if c_good and c = '#' then
1376  while l'length > 0 loop
1377  read(l, c, c_good);
1378  end loop;
1379  end if;
1380  -- Update output values if item was found
1381  if i > 0 then
1382  item_len := i;
1383  item_num := item_num + 1;
1384  end if;
1385  end loop;
1386  end procedure get_file_item;
1387 
1388  procedure pltbutils_error(
1389  constant rpt : in string;
1390  variable pltbv : inout pltbv_t;
1391  signal pltbs : out pltbs_t
1392  ) is
1393  begin
1394  pltbv.err_cnt := pltbv.err_cnt + 1;
1395  pltbv.err_cnt_in_test := pltbv.err_cnt_in_test + 1;
1396  pltbs_update(pltbv, pltbs);
1397 
1398  if (C_PLTBUTILS_USE_STD_ERROR_MSG) then
1399  error_msg(rpt, now, pltbv.test_num,
1400  pltbv.test_name(1 to pltbv.test_name_len), pltbv.err_cnt_in_test);
1401  end if;
1402 
1403  if (C_PLTBUTILS_USE_CUSTOM_ERROR_MSG) then
1404  custom_error_msg(rpt, now, pltbv.test_num,
1405  pltbv.test_name(1 to pltbv.test_name_len), pltbv.err_cnt_in_test);
1406  end if;
1407 
1408  end procedure pltbutils_error;
1409 
1410 
1411 
1412  --==========================================================================
1413  -- pltbutils external (public) procedures
1414  -- To be called from the user's code.
1415  --==========================================================================
1416 
1417  procedure startsim(
1418  constant testcase_name : in string;
1419  constant skiptests : in std_logic_vector;
1420  variable pltbv : inout pltbv_t;
1421  signal pltbs : out pltbs_t
1422  ) is
1423  variable timestamp : time;
1424  variable v_ignored_skiptest : boolean := false;
1425  begin
1426  timestamp := now;
1427  pltbv := C_PLTBV_INIT;
1428  printv(pltbv.testcase_name, testcase_name);
1429  pltbv.testcase_name_len := testcase_name'length;
1430  printv(pltbv.test_name, "START OF SIMULATION");
1431  pltbv.test_name_len := 19;
1432  printv(pltbv.info, testcase_name);
1433 
1434  if (skiptests'length > 0) then
1435  for i in skiptests'low to skiptests'high loop
1436  if (i >= pltbv.skiptests'low and i <= pltbv.skiptests'high) then
1437  pltbv.skiptests(i) := skiptests(i);
1438  else
1439  if (pltbv.skiptests(i) = '1') then
1440  v_ignored_skiptest := true;
1441  end if;
1442  end if;
1443  end loop;
1444  if (v_ignored_skiptest) then
1445  assert false
1446  report "Some SKIPTESTS flags ignored. Max " &
1447  integer'image(pltbv.skiptests'length) & " flag bits supported."
1448  severity warning;
1449  end if;
1450  end if;
1451 
1452  pltbv.info_len := testcase_name'length;
1453  pltbs_update(pltbv, pltbs);
1454 
1455  if (C_PLTBUTILS_USE_STD_STARTSIM_MSG) then
1456  startsim_msg(testcase_name, timestamp);
1457  end if;
1458 
1459  if (C_PLTBUTILS_USE_CUSTOM_STARTSIM_MSG) then
1460  custom_startsim_msg(testcase_name, timestamp);
1461  end if;
1462 
1463  end procedure startsim;
1464 
1466  procedure endsim(
1467  variable pltbv : inout pltbv_t;
1468  signal pltbs : out pltbs_t;
1469  constant show_success_fail : in boolean := false;
1470  constant force_stop : in boolean := false
1471  ) is
1472  variable timestamp : time;
1473  begin
1474  timestamp := now;
1475 
1476  if (C_PLTBUTILS_USE_STD_ENDSIM_MSG) then
1477  endsim_msg(pltbv.testcase_name(1 to pltbv.testcase_name_len), timestamp,
1478  pltbv.test_cnt, pltbv.skiptest_cnt, pltbv.chk_cnt, pltbv.err_cnt,
1479  show_success_fail);
1480  end if;
1481 
1482  if (C_PLTBUTILS_USE_CUSTOM_ENDSIM_MSG) then
1483  custom_endsim_msg(pltbv.testcase_name(1 to pltbv.testcase_name_len), timestamp,
1484  pltbv.test_cnt, pltbv.skiptest_cnt, pltbv.chk_cnt, pltbv.err_cnt,
1485  show_success_fail);
1486  end if;
1487 
1488  pltbv.test_num := 0;
1489  printv(pltbv.test_name, "END OF SIMULATION");
1490  pltbv.test_name_len := 17;
1491  pltbv.stop_sim := '1';
1492  pltbs_update(pltbv, pltbs);
1493  wait for C_WAIT_BEFORE_STOP_TIME;
1494 
1495  if (force_stop) then
1496  if (C_PLTBUTILS_USE_STD_STOPSIM) then
1497  stopsim(now);
1498  end if;
1499  if (C_PLTBUTILS_USE_CUSTOM_STOPSIM) then
1500  custom_stopsim(now);
1501  end if;
1502  end if;
1503 
1504  wait;
1505  end procedure endsim;
1506 
1507  procedure starttest(
1508  constant num : in integer := -1;
1509  constant name : in string;
1510  variable pltbv : inout pltbv_t;
1511  signal pltbs : out pltbs_t
1512  ) is
1513  variable timestamp : time;
1514  begin
1515  timestamp := now;
1516 
1517  if (num = -1) then
1518  pltbv.test_num := pltbv.test_num + 1;
1519  else
1520  pltbv.test_num := num;
1521  end if;
1522 
1523  printv(pltbv.test_name, name);
1524  pltbv.test_name_len := name'length;
1525  pltbv.chk_cnt_in_test := 0;
1526  pltbv.err_cnt_in_test := 0;
1527  pltbv.test_active := true;
1528 
1529  if (pltbv.test_num >= pltbv.skiptests'low and pltbv.test_num <= pltbv.skiptests'high) then
1530  if (pltbv.skiptests(pltbv.test_num) = '1') then
1531  pltbv.test_active := false;
1532  end if;
1533  end if;
1534 
1535  if (pltbv.test_active) then
1536  pltbv.test_cnt := pltbv.test_cnt + 1;
1537  pltbs_update(pltbv, pltbs);
1538  if (C_PLTBUTILS_USE_STD_STARTTEST_MSG) then
1539  starttest_msg(pltbv.test_num, name, timestamp);
1540  end if;
1541  if (C_PLTBUTILS_USE_CUSTOM_STARTTEST_MSG) then
1542  custom_starttest_msg(pltbv.test_num, name, timestamp);
1543  end if;
1544  else
1545  pltbv.skiptest_cnt := pltbv.skiptest_cnt + 1;
1546  pltbs_update(pltbv, pltbs);
1547  if (C_PLTBUTILS_USE_STD_SKIPTEST_MSG) then
1548  skiptest_msg(pltbv.test_num, name, timestamp);
1549  end if;
1550  if (C_PLTBUTILS_USE_CUSTOM_SKIPTEST_MSG) then
1551  custom_skiptest_msg(pltbv.test_num, name, timestamp);
1552  end if;
1553  end if;
1554 
1555  end procedure starttest;
1556 
1557  procedure starttest(
1558  constant name : in string;
1559  variable pltbv : inout pltbv_t;
1560  signal pltbs : out pltbs_t
1561  ) is
1562  begin
1563  starttest(-1, name, pltbv, pltbs);
1564  end procedure starttest;
1565 
1566  function is_test_active(
1567  constant pltbv : in pltbv_t
1568 ) return boolean is
1569  begin
1570  return pltbv.test_active;
1571  end function is_test_active;
1572 
1574  procedure endtest(
1575  variable pltbv : inout pltbv_t;
1576  signal pltbs : out pltbs_t
1577  ) is
1578  variable timestamp : time;
1579  begin
1580  timestamp := now;
1581 
1582  if (C_PLTBUTILS_USE_STD_ENDTEST_MSG) then
1583  endtest_msg(pltbv.test_num, pltbv.test_name(1 to pltbv.test_name_len),
1584  timestamp, pltbv.test_active, pltbv.chk_cnt_in_test, pltbv.err_cnt_in_test);
1585  end if;
1586 
1587  if (C_PLTBUTILS_USE_CUSTOM_ENDTEST_MSG) then
1588  custom_endtest_msg(pltbv.test_num, pltbv.test_name(1 to pltbv.test_name_len),
1589  timestamp, pltbv.test_active, pltbv.chk_cnt_in_test, pltbv.err_cnt_in_test);
1590  end if;
1591 
1592  pltbv.test_active := true;
1593  printv(pltbv.test_name, " ");
1594  pltbv.test_name_len := 1;
1595  pltbs_update(pltbv, pltbs);
1596  end procedure endtest;
1597 
1598  procedure print(
1599  constant active : in boolean;
1600  signal s : out string;
1601  constant txt : in string
1602  ) is
1603  variable j : positive := txt 'low;
1604  begin
1605 
1606  if (active) then
1607  for i in s'range loop
1608  if (j <= txt 'high) then
1609  s(i) <= txt (j);
1610  else
1611  s(i) <= EMPTY_CHR;
1612  end if;
1613  j := j + 1;
1614  end loop;
1615  end if;
1616 
1617  end procedure print;
1618 
1619  procedure print(
1620  signal s : out string;
1621  constant txt : in string
1622  ) is
1623  begin
1624  print(true, s, txt);
1625  end procedure print;
1626 
1627  procedure printv(
1628  constant active : in boolean;
1629  variable s : out string;
1630  constant txt : in string
1631  ) is
1632  variable j : positive := txt 'low;
1633  begin
1634 
1635  if (active) then
1636  for i in s'range loop
1637  if (j <= txt 'high) then
1638  s(i) := txt (j);
1639  else
1640  s(i) := EMPTY_CHR;
1641  end if;
1642  j := j + 1;
1643  end loop;
1644  end if;
1645 
1646  end procedure printv;
1647 
1648  procedure printv(
1649  variable s : out string;
1650  constant txt : in string
1651  ) is
1652  begin
1653  printv(true, s, txt);
1654  end procedure printv;
1655 
1657  procedure print(
1658  constant active : in boolean;
1659  variable pltbv : inout pltbv_t;
1660  signal pltbs : out pltbs_t;
1661  constant txt : in string
1662  ) is
1663  variable j : positive := txt 'low;
1664  begin
1665 
1666  if (active) then
1667  printv(pltbv.info, txt);
1668  pltbv.info_len := txt'length;
1669  pltbs_update(pltbv, pltbs);
1670  end if;
1671 
1672  end procedure print;
1673 
1674  procedure print(
1675  variable pltbv : inout pltbv_t;
1676  signal pltbs : out pltbs_t;
1677  constant txt : in string
1678  ) is
1679  begin
1680  print(true, pltbv, pltbs, txt);
1681  end procedure print;
1682 
1683  procedure print2(
1684  constant active : in boolean;
1685  signal s : out string;
1686  constant txt : in string
1687  ) is
1688  begin
1689 
1690  if (active) then
1691  print(s, txt);
1692  print(txt);
1693  end if;
1694 
1695  end procedure print2;
1696 
1697  procedure print2(
1698  signal s : out string;
1699  constant txt : in string
1700  ) is
1701  begin
1702  print2(true, s, txt);
1703  end procedure print2;
1704 
1705  procedure print2(
1706  constant active : in boolean;
1707  variable pltbv : inout pltbv_t;
1708  signal pltbs : out pltbs_t;
1709  constant txt : in string
1710  ) is
1711  begin
1712  print(active, pltbv, pltbs, txt);
1713  print(active, txt);
1714  end procedure print2;
1715 
1716  procedure print2(
1717  variable pltbv : inout pltbv_t;
1718  signal pltbs : out pltbs_t;
1719  constant txt : in string
1720  ) is
1721  begin
1722  print2(true, pltbv, pltbs, txt);
1723  end procedure print2;
1724 
1726  procedure waitclks(
1727  constant n : in natural;
1728  signal clk : in std_logic;
1729  variable pltbv : inout pltbv_t;
1730  signal pltbs : out pltbs_t;
1731  constant falling : in boolean := false;
1732  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1733  ) is
1734  variable i : natural := n;
1735  variable v_timeout_time : time;
1736  begin
1737  v_timeout_time := now + timeout;
1738  while i > 0 loop
1739 
1740  if (falling) then
1741  wait until falling_edge(clk) for timeout / n;
1742  else
1743  wait until rising_edge(clk) for timeout / n;
1744  end if;
1745 
1746  i := i - 1;
1747  end loop;
1748 
1749  if (now >= v_timeout_time) then
1750  pltbutils_error("waitclks() timeout", pltbv, pltbs);
1751  end if;
1752 
1753  end procedure waitclks;
1754 
1756  procedure waitsig(
1757  signal s : in integer;
1758  constant value : in integer;
1759  signal clk : in std_logic;
1760  variable pltbv : inout pltbv_t;
1761  signal pltbs : out pltbs_t;
1762  constant falling : in boolean := false;
1763  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1764  ) is
1765  variable v_timeout_time : time;
1766  begin
1767  v_timeout_time := now + timeout;
1768  l1 : loop
1769  waitclks(1, clk, pltbv, pltbs, falling, timeout);
1770  exit l1 when s = value or now >= v_timeout_time;
1771  end loop;
1772 
1773  if (now >= v_timeout_time) then
1774  pltbutils_error("waitsig() timeout", pltbv, pltbs);
1775  end if;
1776 
1777  end procedure waitsig;
1778 
1780  procedure waitsig(
1781  signal s : in std_logic;
1782  constant value : in std_logic;
1783  signal clk : in std_logic;
1784  variable pltbv : inout pltbv_t;
1785  signal pltbs : out pltbs_t;
1786  constant falling : in boolean := false;
1787  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1788  ) is
1789  variable v_timeout_time : time;
1790  begin
1791  v_timeout_time := now + timeout;
1792  l1 : loop
1793  waitclks(1, clk, pltbv, pltbs, falling, timeout);
1794  exit l1 when s = value or now >= v_timeout_time;
1795  end loop;
1796 
1797  if (now >= v_timeout_time) then
1798  pltbutils_error("waitsig() timeout", pltbv, pltbs);
1799  end if;
1800 
1801  end procedure waitsig;
1802 
1804  procedure waitsig(
1805  signal s : in std_logic;
1806  constant value : in integer;
1807  signal clk : in std_logic;
1808  variable pltbv : inout pltbv_t;
1809  signal pltbs : out pltbs_t;
1810  constant falling : in boolean := false;
1811  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1812  ) is
1813  variable v_value : std_logic;
1814  variable v_timeout_time : time;
1815  begin
1816 
1817  case value is
1818 
1819  when 0 =>
1820  v_value := '0';
1821  when 1 =>
1822  v_value := '1';
1823  when others =>
1824  v_value := 'X';
1825 
1826  end case;
1827 
1828  if (v_value /= 'X') then
1829  waitsig(s, v_value, clk, pltbv, pltbs, falling, timeout);
1830  else
1831  pltbutils_error("waitsig() timeout", pltbv, pltbs);
1832  end if;
1833 
1834  end procedure waitsig;
1835 
1837  procedure waitsig(
1838  signal s : in std_logic_vector;
1839  constant value : in std_logic_vector;
1840  signal clk : in std_logic;
1841  variable pltbv : inout pltbv_t;
1842  signal pltbs : out pltbs_t;
1843  constant falling : in boolean := false;
1844  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1845  ) is
1846  variable v_timeout_time : time;
1847  begin
1848  v_timeout_time := now + timeout;
1849  l1 : loop
1850  waitclks(1, clk, pltbv, pltbs, falling, timeout);
1851  exit l1 when s = value or now >= v_timeout_time;
1852  end loop;
1853 
1854  if (now >= v_timeout_time) then
1855  pltbutils_error("waitsig() timeout", pltbv, pltbs);
1856  end if;
1857 
1858  end procedure waitsig;
1859 
1861  procedure waitsig(
1862  signal s : in std_logic_vector;
1863  constant value : in integer;
1864  signal clk : in std_logic;
1865  variable pltbv : inout pltbv_t;
1866  signal pltbs : out pltbs_t;
1867  constant falling : in boolean := false;
1868  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1869  ) is
1870  variable v_timeout_time : time;
1871  begin
1872  waitsig(s, std_logic_vector(to_unsigned(value, s'length)), clk,
1873  pltbv, pltbs, falling, timeout);
1874  end procedure waitsig;
1875 
1877  procedure waitsig(
1878  signal s : in unsigned;
1879  constant value : in unsigned;
1880  signal clk : in std_logic;
1881  variable pltbv : inout pltbv_t;
1882  signal pltbs : out pltbs_t;
1883  constant falling : in boolean := false;
1884  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1885  ) is
1886  variable v_timeout_time : time;
1887  begin
1888  v_timeout_time := now + timeout;
1889  l1 : loop
1890  waitclks(1, clk, pltbv, pltbs, falling, timeout);
1891  exit l1 when s = value or now >= v_timeout_time;
1892  end loop;
1893 
1894  if (now >= v_timeout_time) then
1895  pltbutils_error("waitsig() timeout", pltbv, pltbs);
1896  end if;
1897 
1898  end procedure waitsig;
1899 
1901  procedure waitsig(
1902  signal s : in unsigned;
1903  constant value : in integer;
1904  signal clk : in std_logic;
1905  variable pltbv : inout pltbv_t;
1906  signal pltbs : out pltbs_t;
1907  constant falling : in boolean := false;
1908  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1909  ) is
1910  variable v_timeout_time : time;
1911  begin
1912  waitsig(s, to_unsigned(value, s'length), clk,
1913  pltbv, pltbs, falling, timeout);
1914  end procedure waitsig;
1915 
1917  procedure waitsig(
1918  signal s : in signed;
1919  constant value : in signed;
1920  signal clk : in std_logic;
1921  variable pltbv : inout pltbv_t;
1922  signal pltbs : out pltbs_t;
1923  constant falling : in boolean := false;
1924  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1925  ) is
1926  variable v_timeout_time : time;
1927  begin
1928  v_timeout_time := now + timeout;
1929  l1 : loop
1930  waitclks(1, clk, pltbv, pltbs, falling, timeout);
1931  exit l1 when s = value or now >= v_timeout_time;
1932  end loop;
1933 
1934  if (now >= v_timeout_time) then
1935  pltbutils_error("waitsig() timeout", pltbv, pltbs);
1936  end if;
1937 
1938  end procedure waitsig;
1939 
1941  procedure waitsig(
1942  signal s : in signed;
1943  constant value : in integer;
1944  signal clk : in std_logic;
1945  variable pltbv : inout pltbv_t;
1946  signal pltbs : out pltbs_t;
1947  constant falling : in boolean := false;
1948  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1949  ) is
1950  variable v_timeout_time : time;
1951  begin
1952  waitsig(s, to_signed(value, s'length), clk,
1953  pltbv, pltbs, falling, timeout);
1954  end procedure waitsig;
1955 
1957  procedure waitsig(
1958  signal s : in std_logic;
1959  constant value : in std_logic;
1960  variable pltbv : inout pltbv_t;
1961  signal pltbs : out pltbs_t;
1962  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1963  ) is
1964  begin
1965 
1966  if (s /= value) then
1967  wait until s = value for timeout;
1968  if (s /= value) then
1969  pltbutils_error("waitsig() timeout", pltbv, pltbs);
1970  end if;
1971  end if;
1972 
1973  end procedure waitsig;
1974 
1976  procedure waitsig(
1977  signal s : in std_logic;
1978  variable pltbv : inout pltbv_t;
1979  signal pltbs : out pltbs_t;
1980  constant falling : in boolean := false;
1981  constant timeout : in time := C_PLTBUTILS_TIMEOUT
1982  ) is
1983  variable v_timeout_time : time;
1984  begin
1985  if falling then
1986  wait until falling_edge(s) for timeout;
1987  else
1988  wait until rising_edge(s) for timeout;
1989  end if;
1990  if (not ((falling and (s = '0' or s = 'L')) or ((not falling) and (s = '1' or s = 'H')))) then
1991  pltbutils_error("waitsig() timeout", pltbv, pltbs);
1992  end if;
1993  end procedure waitsig;
1994 
1996  procedure check(
1997  constant rpt : in string;
1998  constant actual : in integer;
1999  constant expected : in integer;
2000  variable pltbv : inout pltbv_t;
2001  signal pltbs : out pltbs_t
2002  ) is
2003  begin
2004  check(rpt, actual = expected, str(actual), str(expected), "", pltbv, pltbs);
2005  end procedure check;
2006 
2008  procedure check(
2009  constant rpt : in string;
2010  constant actual : in std_logic;
2011  constant expected : in std_logic;
2012  variable pltbv : inout pltbv_t;
2013  signal pltbs : out pltbs_t
2014  ) is
2015  begin
2016  check(rpt, actual = expected, str(actual), str(expected), "", pltbv, pltbs);
2017  end procedure check;
2018 
2020  procedure check(
2021  constant rpt : in string;
2022  constant actual : in std_logic;
2023  constant expected : in integer;
2024  variable pltbv : inout pltbv_t;
2025  signal pltbs : out pltbs_t
2026  ) is
2027  begin
2028  check(rpt, ((actual = '0' and expected = 0) or (actual = '1' and expected = 1)),
2029  str(actual), str(expected), "", pltbv, pltbs);
2030  end procedure check;
2031 
2033  procedure check(
2034  constant rpt : in string;
2035  constant actual : in std_logic_vector;
2036  constant expected : in std_logic_vector;
2037  variable pltbv : inout pltbv_t;
2038  signal pltbs : out pltbs_t
2039  ) is
2040  begin
2041  check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbv, pltbs);
2042  end procedure check;
2043 
2045  procedure check(
2046  constant rpt : in string;
2047  constant actual : in std_logic_vector;
2048  constant expected : in std_logic_vector;
2049  constant mask : in std_logic_vector;
2050  variable pltbv : inout pltbv_t;
2051  signal pltbs : out pltbs_t
2052  ) is
2053  begin
2054  check(rpt, (actual and mask) = (expected and mask),
2055  hxstr(actual, "0x"), hxstr(expected, "0x"), hxstr(mask, "0x"), pltbv, pltbs);
2056  end procedure check;
2057 
2059  procedure check(
2060  constant rpt : in string;
2061  constant actual : in std_logic_vector;
2062  constant expected : in integer;
2063  variable pltbv : inout pltbv_t;
2064  signal pltbs : out pltbs_t
2065  ) is
2066  begin
2067  check(rpt, actual, std_logic_vector(to_signed(expected, actual'length)), pltbv, pltbs);
2068  end procedure check;
2069 
2071  procedure check(
2072  constant rpt : in string;
2073  constant actual : in std_logic_vector;
2074  constant expected : in integer;
2075  constant mask : in std_logic_vector;
2076  variable pltbv : inout pltbv_t;
2077  signal pltbs : out pltbs_t
2078  ) is
2079  begin
2080  check(rpt, actual, std_logic_vector(to_signed(expected, actual'length)), mask, pltbv, pltbs);
2081  end procedure check;
2082 
2084  procedure check(
2085  constant rpt : in string;
2086  constant actual : in unsigned;
2087  constant expected : in unsigned;
2088  variable pltbv : inout pltbv_t;
2089  signal pltbs : out pltbs_t
2090  ) is
2091  begin
2092  check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbv, pltbs);
2093  end procedure check;
2094 
2096  procedure check(
2097  constant rpt : in string;
2098  constant actual : in unsigned;
2099  constant expected : in integer;
2100  variable pltbv : inout pltbv_t;
2101  signal pltbs : out pltbs_t
2102  ) is
2103  begin
2104  check(rpt, actual, to_unsigned(expected, actual'length), pltbv, pltbs);
2105  end procedure check;
2106 
2108  procedure check(
2109  constant rpt : in string;
2110  constant actual : in signed;
2111  constant expected : in signed;
2112  variable pltbv : inout pltbv_t;
2113  signal pltbs : out pltbs_t
2114  ) is
2115  begin
2116  check(rpt, actual = expected, hxstr(actual, "0x"), hxstr(expected, "0x"), "", pltbv, pltbs);
2117  end procedure check;
2118 
2122  procedure check(
2123  constant rpt : in string;
2124  constant actual : in signed;
2125  constant expected : in integer;
2126  variable pltbv : inout pltbv_t;
2127  signal pltbs : out pltbs_t
2128  ) is
2129  begin
2130  check(rpt, actual, to_signed(expected, actual'length), pltbv, pltbs);
2131  end procedure check;
2132 
2134  procedure check(
2135  constant rpt : in string;
2136  constant actual : in boolean;
2137  constant expected : in boolean;
2138  variable pltbv : inout pltbv_t;
2139  signal pltbs : out pltbs_t
2140  ) is
2141  begin
2142  check(rpt, actual = expected, str(actual), str(expected), "", pltbv, pltbs);
2143  end procedure check;
2144 
2146  procedure check(
2147  constant rpt : in string;
2148  constant actual : in boolean;
2149  constant expected : in integer;
2150  variable pltbv : inout pltbv_t;
2151  signal pltbs : out pltbs_t
2152  ) is
2153  begin
2154  check(rpt, ((actual = false and expected = 0) or (actual = true and expected = 1)),
2155  str(actual), str(expected), "", pltbv, pltbs);
2156  end procedure check;
2157 
2159  procedure check(
2160  constant rpt : in string;
2161  constant actual : in time;
2162  constant expected : in time;
2163  variable pltbv : inout pltbv_t;
2164  signal pltbs : out pltbs_t
2165  ) is
2166  begin
2167  check(rpt, actual = expected, time'image(actual), time'image(expected), "", pltbv, pltbs);
2168  end procedure check;
2169 
2171  procedure check(
2172  constant rpt : in string;
2173  constant actual : in time;
2174  constant expected : in time;
2175  constant tolerance : in time;
2176  variable pltbv : inout pltbv_t;
2177  signal pltbs : out pltbs_t
2178  ) is
2179  begin
2180  check(
2181  rpt,
2182  ((actual >= expected-tolerance) and (actual <= expected+tolerance)),
2183  time'image(actual),
2184  time'image(expected) & " +/- " & time'image(tolerance),
2185  "",
2186  pltbv,
2187  pltbs
2188  );
2189  end procedure check;
2190 
2192  procedure check(
2193  constant rpt : in string;
2194  constant actual : in string;
2195  constant expected : in string;
2196  variable pltbv : inout pltbv_t;
2197  signal pltbs : out pltbs_t
2198  ) is
2199  variable mismatch : boolean := false;
2200  begin
2201 
2202  if (actual'length /= expected'length) then
2203  mismatch := true;
2204  else
2205  for i in 0 to actual'length-1 loop
2206  if (actual(i+actual'low) /= expected(i+expected'low)) then
2207  mismatch := true;
2208  exit;
2209  end if;
2210  end loop;
2211  end if;
2212 
2213  check(rpt, not mismatch, actual, expected, "", pltbv, pltbs);
2214  end procedure check;
2215 
2220  procedure check(
2221  constant rpt : in string;
2222  constant expr : in boolean;
2223  variable pltbv : inout pltbv_t;
2224  signal pltbs : out pltbs_t
2225  ) is
2226  begin
2227  check(rpt, expr, "", "", "", pltbv, pltbs);
2228  end procedure check;
2229 
2230 
2232  procedure check_binfile(
2233  constant rpt : in string;
2234  constant filename1 : in string;
2235  constant filename2 : in string;
2236  constant verbosity : in integer;
2237  variable pltbv : inout pltbv_t;
2238  signal pltbs : out pltbs_t
2239  ) is
2240  variable v_file_errors : integer := 0;
2241  type charfile is file of character;
2242  file f1 : charfile;
2243  file f2 : charfile;
2244  variable f1_status : file_open_status;
2245  variable f2_status : file_open_status;
2246  variable c1 : character;
2247  variable c2 : character;
2248  variable offset1 : integer := 0;
2249  variable offset2 : integer := 0;
2250  variable error_line : line;
2251  begin
2252  file_open(f1_status, f1, filename1, read_mode);
2253  if f1_status /= open_ok then
2254  v_file_errors := v_file_errors + 1;
2255  write(error_line, " Could not open file " & filename1 & " for reading.");
2256  else
2257  file_open(f2_status, f2, filename2, read_mode);
2258  if f2_status /= open_ok then
2259  v_file_errors := v_file_errors + 1;
2260  write(error_line, " Could not open file " & filename2 & " for reading. ");
2261  file_close(f1);
2262  end if;
2263  end if;
2264  if f1_status = open_ok and f2_status = open_ok then
2265  while not endfile(f1) and not endfile(f2) loop
2266  read(f1, c1);
2267  read(f2, c2);
2268  if c1 /= c2 then
2269  v_file_errors := v_file_errors + 1;
2270  if ((verbosity >= 2) or (verbosity = 1 and v_file_errors <= 10)) then
2271  write(error_line, " Diff offset " & integer'image(offset1) & ": " &
2272  integer'image(character'pos(c1)) & " /= " & integer'image(character'pos(c2)) & ".");
2273  end if;
2274  if verbosity = 1 and v_file_errors = 11 then
2275  write(error_line, string'(" Further diffs suppressed."));
2276  end if;
2277  end if;
2278  offset1 := offset1 + 1;
2279  offset2 := offset2 + 1;
2280  end loop;
2281  if v_file_errors > 0 then
2282  write(error_line, " " & integer'image(v_file_errors) & " bytes differ.");
2283  end if;
2284 
2285  -- Now one or both files are at the end.
2286  -- Checking remaining size of possible non-ended file.
2287  while not endfile(f1) loop
2288  read(f1, c1);
2289  offset1 := offset1 + 1;
2290  end loop;
2291  while not endfile(f2) loop
2292  read(f2, c2);
2293  offset2 := offset2 + 1;
2294  end loop;
2295  if offset1 /= offset2 then
2296  v_file_errors := v_file_errors + 1;
2297  write(error_line, " File sizes differ: " & integer'image(offset1) &
2298  " /= " & integer'image(offset2) & " bytes.");
2299  end if;
2300  write(error_line, " (" & filename1 & ", " & filename2 & ")");
2301  end if; -- f1_status, f2_status
2302 
2303  if f1_status = open_ok then
2304  file_close(f1);
2305  end if;
2306  if f2_status = open_ok then
2307  file_close(f2);
2308  end if;
2309 
2310  check(rpt, v_file_errors = 0, error_line.all, "", "!NO_TAGS!", pltbv, pltbs);
2311 
2312  if error_line /= null then
2313  deallocate(error_line);
2314  end if;
2315  end procedure check_binfile;
2316 
2317 
2319  procedure check_txtfile(
2320  constant rpt : in string;
2321  constant filename1 : in string;
2322  constant filename2 : in string;
2323  constant verbosity : in integer;
2324  variable pltbv : inout pltbv_t;
2325  signal pltbs : out pltbs_t
2326  ) is
2327  variable v_file_errors : integer := 0;
2328  file f1 : text;
2329  file f2 : text;
2330  variable f1_status : file_open_status;
2331  variable f2_status : file_open_status;
2332  variable l1 : line;
2333  variable l2 : line;
2334  variable line_num1 : integer := 0;
2335  variable line_num2 : integer := 0;
2336  variable error_line : line;
2337  begin
2338  file_open(f1_status, f1, filename1, read_mode);
2339  if f1_status /= open_ok then
2340  v_file_errors := v_file_errors + 1;
2341  write(error_line, " Could not open file " & filename1 & " for reading.");
2342  else
2343  file_open(f2_status, f2, filename2, read_mode);
2344  if f2_status /= open_ok then
2345  v_file_errors := v_file_errors + 1;
2346  write(error_line, " Could not open file " & filename2 & " for reading. ");
2347  file_close(f1);
2348  end if;
2349  end if;
2350  if f1_status = open_ok and f2_status = open_ok then
2351  while not endfile(f1) and not endfile(f2) loop
2352  readline(f1, l1);
2353  readline(f2, l2);
2354  line_num1 := line_num1 + 1;
2355  line_num2 := line_num2 + 1;
2356  if l1.all /= l2.all then
2357  v_file_errors := v_file_errors + 1;
2358  if ((verbosity >= 2) or (verbosity = 1 and v_file_errors <= 10)) then
2359  write(error_line, " Diff line " & integer'image(line_num1) & ": '" &
2360  l1.all & "'' /= '" & l2.all & "'.");
2361  end if;
2362  if verbosity = 1 and v_file_errors = 11 then
2363  write(error_line, string'(" Further diffs suppressed."));
2364  end if;
2365  end if;
2366  end loop;
2367  if v_file_errors > 0 then
2368  write(error_line, " " & integer'image(v_file_errors) & " lines differ.");
2369  end if;
2370 
2371  -- Now one or both files are at the end.
2372  -- Checking remaining size of possible non-ended file.
2373  while not endfile(f1) loop
2374  readline(f1, l1);
2375  line_num1 := line_num1 + 1;
2376  end loop;
2377  while not endfile(f2) loop
2378  readline(f2, l2);
2379  line_num2 := line_num2 + 1;
2380  end loop;
2381  if line_num1 /= line_num2 then
2382  v_file_errors := v_file_errors + 1;
2383  write(error_line, " File sizes differ: " & integer'image(line_num1) &
2384  " /= " & integer'image(line_num2) & " lines.");
2385  end if;
2386  write(error_line, " (" & filename1 & ", " & filename2 & ")");
2387  end if; -- f1_status, f2_status
2388 
2389  if f1_status = open_ok then
2390  file_close(f1);
2391  end if;
2392  if f2_status = open_ok then
2393  file_close(f2);
2394  end if;
2395 
2396  check(rpt, v_file_errors = 0, error_line.all, "", "!NO_TAGS!", pltbv, pltbs);
2397 
2398  if error_line /= null then
2399  deallocate(error_line);
2400  end if;
2401  end procedure check_txtfile;
2402 
2404  procedure check_datfile(
2405  constant rpt : in string;
2406  constant filename1 : in string;
2407  constant filename2 : in string;
2408  constant verbosity : in integer;
2409  variable pltbv : inout pltbv_t;
2410  signal pltbs : out pltbs_t;
2411  constant skip_init_items : in integer := 0
2412  ) is
2413  variable v_file_errors : integer := 0;
2414  file f1 : text;
2415  file f2 : text;
2416  variable f1_status : file_open_status;
2417  variable f2_status : file_open_status;
2418  variable l1 : line;
2419  variable l2 : line;
2420  variable line_num1 : integer := 0;
2421  variable line_num2 : integer := 0;
2422  variable item1 : string(1 to 256);
2423  variable item2 : string(1 to 256);
2424  variable item_len1 : integer := -1;
2425  variable item_len2 : integer := -1;
2426  variable item_num1 : integer := 0;
2427  variable item_num2 : integer := 0;
2428  variable item_cnt : integer := 0;
2429  variable error_line : line;
2430  begin
2431  file_open(f1_status, f1, filename1, read_mode);
2432  if f1_status /= open_ok then
2433  v_file_errors := v_file_errors + 1;
2434  write(error_line, " Could not open file " & filename1 & " for reading: " & file_open_status'image(f1_status));
2435  else
2436  file_open(f2_status, f2, filename2, read_mode);
2437  if f2_status /= open_ok then
2438  v_file_errors := v_file_errors + 1;
2439  write(error_line, " Could not open file " & filename2 & " for reading: " & file_open_status'image(f2_status));
2440  file_close(f1);
2441  end if;
2442  end if;
2443  if f1_status = open_ok and f2_status = open_ok then
2444  while item_len1 /= 0 or item_len2 /= 0 loop
2445  get_file_item(f1, l1, item1, item_len1, line_num1, item_num1);
2446  get_file_item(f2, l2, item2, item_len2, line_num2, item_num2);
2447  item_cnt := item_cnt + 1;
2448  if item_len1 > 0 and item_len2 > 0 and item_cnt > skip_init_items then
2449  if item1 /= item2 then
2450  v_file_errors := v_file_errors + 1;
2451  if ((verbosity >= 2) or (verbosity = 1 and v_file_errors <= 10)) then
2452  write(error_line, " Diff item " & integer'image(item_num1) & ": '" &
2453  item1(1 to item_len1) & "' /= '" & item2(1 to item_len2) & "'.");
2454  end if;
2455  if verbosity = 1 and v_file_errors = 11 then
2456  write(error_line, string'(" Further diffs suppressed."));
2457  end if;
2458  end if;
2459  end if;
2460  end loop;
2461 
2462  if v_file_errors > 0 then
2463  write(error_line, " " & integer'image(v_file_errors) & " items differ.");
2464  end if;
2465 
2466  -- Now one or both files are at the end.
2467  -- Checking remaining size of possible non-ended file.
2468  while not endfile(f1) loop
2469  get_file_item(f1, l1, item1, item_len1, line_num1, item_num1);
2470  end loop;
2471  while not endfile(f2) loop
2472  get_file_item(f2, l2, item2, item_len2, line_num2, item_num2);
2473  end loop;
2474  if item_num1 /= item_num2 then
2475  v_file_errors := v_file_errors + 1;
2476  write(error_line, " File sizes differ: " & integer'image(item_num1) &
2477  " /= " & integer'image(item_num2) & " items.");
2478  end if;
2479  write(error_line, " (" & filename1 & ", " & filename2 & ")");
2480  end if;
2481 
2482  if f1_status = open_ok then
2483  file_close(f1);
2484  end if;
2485  if f2_status = open_ok then
2486  file_close(f2);
2487  end if;
2488 
2489  check(rpt, v_file_errors = 0, error_line.all, "", "!NO_TAGS!", pltbv, pltbs);
2490 
2491  if error_line /= null then
2492  deallocate(error_line);
2493  end if;
2494  end procedure check_datfile;
2495 
2502  procedure check(
2503  constant rpt : in string;
2504  constant expr : in boolean;
2505  constant actual : in string;
2506  constant expected : in string;
2507  constant mask : in string;
2508  variable pltbv : inout pltbv_t;
2509  signal pltbs : out pltbs_t
2510  ) is
2511  variable timestamp : time;
2512  begin
2513  timestamp := now;
2514  pltbv.chk_cnt := pltbv.chk_cnt + 1;
2515  pltbv.chk_cnt_in_test := pltbv.chk_cnt_in_test + 1;
2516 
2517  if (not is_test_active(pltbv)) then
2518  pltbv.err_cnt := pltbv.err_cnt + 1;
2519  pltbv.err_cnt_in_test := pltbv.err_cnt_in_test + 1;
2520  if (C_PLTBUTILS_USE_STD_CHECK_MSG) then
2521  check_msg("check() executed in skipped test, missing if clause?", timestamp, false, "", "", "", pltbv.test_num,
2522  pltbv.test_name(1 to pltbv.test_name_len), pltbv.chk_cnt, pltbv.err_cnt_in_test);
2523  end if;
2524  if (C_PLTBUTILS_USE_CUSTOM_CHECK_MSG) then
2525  custom_check_msg("check() executed in skipped test, missing if clause?", timestamp, false, "", "", "", pltbv.test_num,
2526  pltbv.test_name(1 to pltbv.test_name_len), pltbv.chk_cnt, pltbv.err_cnt_in_test);
2527  end if;
2528  end if;
2529 
2530  if (not expr) then
2531  pltbv.err_cnt := pltbv.err_cnt + 1;
2532  pltbv.err_cnt_in_test := pltbv.err_cnt_in_test + 1;
2533  end if;
2534 
2535  pltbs_update(pltbv, pltbs);
2536 
2537  if (C_PLTBUTILS_USE_STD_CHECK_MSG) then
2538  check_msg(rpt, timestamp, expr, actual, expected, mask, pltbv.test_num,
2539  pltbv.test_name(1 to pltbv.test_name_len), pltbv.chk_cnt, pltbv.err_cnt_in_test);
2540  end if;
2541 
2542  if (C_PLTBUTILS_USE_CUSTOM_CHECK_MSG) then
2543  custom_check_msg(rpt, timestamp, expr, actual, expected, mask, pltbv.test_num,
2544  pltbv.test_name(1 to pltbv.test_name_len), pltbv.chk_cnt, pltbv.err_cnt_in_test);
2545  end if;
2546 
2547  pltbs_update(pltbv, pltbs);
2548  end procedure check;
2549 
2551  function to_ascending(
2552  constant s : std_logic_vector
2553  ) return std_logic_vector is
2554  variable r : std_logic_vector(s'low to s'high);
2555  begin
2556  for i in r'range loop
2557  r(i) := s(i);
2558  end loop;
2559  return r;
2560  end function to_ascending;
2561 
2562  function to_ascending(
2563  constant s : unsigned
2564  ) return unsigned is
2565  variable r : unsigned(s'low to s'high);
2566  begin
2567  for i in r'range loop
2568  r(i) := s(i);
2569  end loop;
2570  return r;
2571  end function to_ascending;
2572 
2573  function to_ascending(
2574  constant s : signed
2575  ) return signed is
2576  variable r : signed(s'low to s'high);
2577  begin
2578  for i in r'range loop
2579  r(i) := s(i);
2580  end loop;
2581  return r;
2582  end function to_ascending;
2583 
2585 
2586  function to_descending(
2587  constant s : std_logic_vector
2588  ) return std_logic_vector is
2589  variable r : std_logic_vector(s'high downto s'low);
2590  begin
2591  for i in r'range loop
2592  r(i) := s(i);
2593  end loop;
2594  return r;
2595  end function to_descending;
2596 
2597  function to_descending(
2598  constant s : unsigned
2599  ) return unsigned is
2600  variable r : unsigned(s'high downto s'low);
2601  begin
2602  for i in r'range loop
2603  r(i) := s(i);
2604  end loop;
2605  return r;
2606  end function to_descending;
2607 
2608  function to_descending(
2609  constant s : signed
2610  ) return signed is
2611  variable r : signed(s'high downto s'low);
2612  begin
2613  for i in r'range loop
2614  r(i) := s(i);
2615  end loop;
2616  return r;
2617  end function to_descending;
2618 
2619 """" function hxstr(
2620  constant s : std_logic_vector;
2621  constant prefix : string := ;
2622  constant postfix : string :=
2623  ) return string is
2624  variable hexstr : string(1 to (s'length+3)/4);
2625  variable nibble_aligned_s : std_logic_vector(((s'length+3)/4)*4-1 downto 0) := (others => '0');
2626  variable nibble : std_logic_vector(3 downto 0);
2627  begin
2628  nibble_aligned_s(s'length-1 downto 0) := to_descending(s);
2629  for i in 0 to nibble_aligned_s'high/4 loop
2630  nibble := nibble_aligned_s(4*i + 3 downto 4*i);
2631 
2632  case nibble is
2633 
2634  when "0000" =>
2635  hexstr(hexstr'high-i) := '0';
2636  when "0001" =>
2637  hexstr(hexstr'high-i) := '1';
2638  when "0010" =>
2639  hexstr(hexstr'high-i) := '2';
2640  when "0011" =>
2641  hexstr(hexstr'high-i) := '3';
2642  when "0100" =>
2643  hexstr(hexstr'high-i) := '4';
2644  when "0101" =>
2645  hexstr(hexstr'high-i) := '5';
2646  when "0110" =>
2647  hexstr(hexstr'high-i) := '6';
2648  when "0111" =>
2649  hexstr(hexstr'high-i) := '7';
2650  when "1000" =>
2651  hexstr(hexstr'high-i) := '8';
2652  when "1001" =>
2653  hexstr(hexstr'high-i) := '9';
2654  when "1010" =>
2655  hexstr(hexstr'high-i) := 'A';
2656  when "1011" =>
2657  hexstr(hexstr'high-i) := 'B';
2658  when "1100" =>
2659  hexstr(hexstr'high-i) := 'C';
2660  when "1101" =>
2661  hexstr(hexstr'high-i) := 'D';
2662  when "1110" =>
2663  hexstr(hexstr'high-i) := 'E';
2664  when "1111" =>
2665  hexstr(hexstr'high-i) := 'F';
2666  when "UUUU" =>
2667  hexstr(hexstr'high-i) := 'U';
2668  when "XXXX" =>
2669  hexstr(hexstr'high-i) := 'X';
2670  when "ZZZZ" =>
2671  hexstr(hexstr'high-i) := 'Z';
2672  when "WWWW" =>
2673  hexstr(hexstr'high-i) := 'W';
2674  when "LLLL" =>
2675  hexstr(hexstr'high-i) := 'L';
2676  when "HHHH" =>
2677  hexstr(hexstr'high-i) := 'H';
2678  when "----" =>
2679  hexstr(hexstr'high-i) := '-';
2680  when others =>
2681  hexstr(hexstr'high-i) := '?';
2683 
2684  end case;
2685 
2686  end loop;
2687  return prefix & hexstr & postfix;
2688  end function hxstr;
2689 
2690 """" function hxstr(
2691  constant s : unsigned;
2692  constant prefix : string := ;
2693  constant postfix : string :=
2694  ) return string is
2695  begin
2696  return hxstr(std_logic_vector(s), prefix, postfix);
2697  end function hxstr;
2698 
2699 """" function hxstr(
2700  constant s : signed;
2701  constant prefix : string := ;
2702  constant postfix : string :=
2703  ) return string is
2704  begin
2705  return hxstr(std_logic_vector(s), prefix, postfix);
2706  end function hxstr;
2707 
2711  procedure pltbs_update(
2712  variable pltbv : inout pltbv_t;
2713  signal pltbs : out pltbs_t
2714  ) is
2715  begin
2716  pltbs.test_num <= pltbv.test_num;
2717  print(pltbs.test_name, pltbv.test_name);
2718  print(pltbs.info, pltbv.info);
2719  pltbs.chk_cnt <= pltbv.chk_cnt;
2720  pltbs.err_cnt <= pltbv.err_cnt;
2721  pltbs.stop_sim <= pltbv.stop_sim;
2722  end procedure pltbs_update;
2723 
2725  function str(
2726  constant n : integer;
2727  constant len : integer;
2728  constant fillchar : character := ' '
2729  ) return string is
2730  variable s : string(1 to len) := (others => fillchar);
2731  variable val : integer := n;
2732  variable digit : integer;
2733  begin
2734  for i in 0 to len-1 loop
2735  if val > 0 then
2736  digit := val mod 10;
2737  val := val / 10;
2738  s(len - i) := character'val(character'pos('0') + digit);
2739  end if;
2740  end loop;
2741  assert val = 0
2742  report "str: value " & integer'image(n) & " does not fit in string with length " & integer'image(len)
2743  severity error;
2744  return s;
2745  end function str;
2746 
2748  function str_equal (
2749  constant s1 : STRING;
2750  constant s2 : STRING
2751  ) return boolean is
2752  begin
2753  if s1'length /= s2'length then
2754  return FALSE;
2755  else
2756  return (s1 = s2);
2757  end if;
2758  end function str_equal;
2759 
2760 end package body pltbutils_func_pkg;
This package defines fuctions and procedures for controlling stimuli to a DUT and checking response.
pltbv_t
Type for status- and control variable.
pltbs_updatepltbv,pltbs,
pltbutils internal procedure(s), do not call from user's code
checkrpt,actual,expected,mask,pltbv,pltbs,
Checks that the value of a signal or variable is equal to expected.
natural := 512 C_PLTBUTILS_SKIPTESTLEN
endsimpltbv,pltbs,show_success_fail,force_stop,
Displays a message at end of simulation message, presents the simulation results, and stops the simul...
time := 1 us C_WAIT_BEFORE_STOP_TIME
endtestpltbv,pltbs,
Prints an end-of-test message to the screen.
waitclksN,clk,pltbv,pltbs,falling,timeout,
Waits specified amount of clock cycles of the specified clock.
boolean str_equals1,s2,
Function str_equal returns true if strings s1 and s2 are equal, otherwise false.
check_txtfilerpt,filename1,filename2,verbosity,pltbv,pltbs,
check_txtfile compares two text files.
natural := 80 C_PLTBUTILS_STRLEN
string hxstrs,prefix,postfix,
Converts a vector to a string in hexadecimal format.
character := ' ' EMPTY_CHR
check_binfilerpt,filename1,filename2,verbosity,pltbv,pltbs,
Checks that the contents of a file is equal to expected contents, by comparing with a reference file.
string strn,len,fillchar,
pltbs_t :=( test_num=> 0, test_name=>( others => EMPTY_CHR), info=>( others => EMPTY_CHR), chk_cnt=> 0, err_cnt=> 0, stop_sim=> '0') C_PLTBS_INIT
pltbv_t :=( testcase_name=>( others => EMPTY_CHR), testcase_name_len=> 1, test_num=> 0, test_name=>( others => EMPTY_CHR), test_name_len=> 1, skiptests=>( others => '0'), test_active=> true, info=>( others => EMPTY_CHR), info_len=> 1, test_cnt=> 0, skiptest_cnt=> 0, chk_cnt=> 0, err_cnt=> 0, chk_cnt_in_test=> 0, err_cnt_in_test=> 0, stop_sim=> '0') C_PLTBV_INIT
waitsigs,value,clk,pltbv,pltbs,falling,timeout,
Waits until a signal has reached a specified value after specified clock edge.
boolean is_test_activepltbv,
Returns true if a test is active (not skipped), otherwise false.
std_logic_vector to_ascendings,
Converts a vector to ascending range ("to-range").
printactive,pltbv,pltbs,txt,
Prints text messages to a signal for viewing in the simulator's waveform window.
starttestname,pltbv,pltbs,
Sets a number (optional) and a name for a test. The number and name will be printed to the screen,...
pltbs_t
Status- and control signal (subset of pltbv_t)
startsimtestcase_name,skiptests,pltbv,pltbs,
Displays a message at start of simulation message, and initializes PlTbUtils' status and control vari...
check_datfilerpt,filename1,filename2,verbosity,pltbv,pltbs,skip_init_items,
check_datfile compares two files with data formatted as follows. The files contain a sequence of data...
std_logic_vector to_descendings,
Converts a vector to descending range ("downto-range").
time := 10 sec C_PLTBUTILS_TIMEOUT
print2active,pltbv,pltbs,txt,
PlTbUtils User Configuration Package: User's function and procedure declarations.
Defines useful functions an procedures for text handling text in VHDL.
Definition: txt_util.vhd:31