Line 171... |
Line 171... |
variable v_expected_checks_cnt : integer := 0;
|
variable v_expected_checks_cnt : integer := 0;
|
variable v_expected_errors_cnt : integer := 0;
|
variable v_expected_errors_cnt : integer := 0;
|
variable v_expected_data : integer;
|
variable v_expected_data : integer;
|
variable v_actual_data : integer;
|
variable v_actual_data : integer;
|
variable f_status : file_open_status;
|
variable f_status : file_open_status;
|
|
file txtfile : text;
|
type charfile is file of character;
|
type charfile is file of character;
|
file binfile : charfile;
|
file binfile : charfile;
|
|
variable l : line;
|
variable c : character;
|
variable c : character;
|
variable i : integer;
|
variable i : integer;
|
variable v_errcnt : integer;
|
variable v_errcnt : integer;
|
|
variable msg : line;
|
|
variable line_num : integer := 0;
|
begin
|
begin
|
|
|
print(lf & "<Testing startsim()>");
|
print(lf & "<Testing startsim()>");
|
startsim("tc1", G_SKIPTESTS, pltbv, pltbs);
|
startsim("tc1", G_SKIPTESTS, pltbv, pltbs);
|
wait until rising_edge(clk);
|
wait until rising_edge(clk);
|
Line 528... |
Line 532... |
wait until rising_edge(clk);
|
wait until rising_edge(clk);
|
check("Testing incorrect boolean expression 47 < 16#10#", s_i < 16#10#, pltbv, pltbs);
|
check("Testing incorrect boolean expression 47 < 16#10#", s_i < 16#10#, pltbv, pltbs);
|
check_cnt(C_EXPECTED_FAIL, v_expected_checks_cnt, v_expected_errors_cnt, expected_checks_cnt, expected_errors_cnt);
|
check_cnt(C_EXPECTED_FAIL, v_expected_checks_cnt, v_expected_errors_cnt, expected_checks_cnt, expected_errors_cnt);
|
print("<Done testing check() boolean expresson>");
|
print("<Done testing check() boolean expresson>");
|
|
|
|
print(lf & "<Test readline() behaviour of the current simulator>");
|
|
print("Some simulators seem to handle CR and LF differently from others.");
|
|
file_open(f_status, txtfile, G_TEXTTESTFILE_REFERENCE, read_mode);
|
|
print("DEBUG: file_open_status: " & file_open_status'image(f_status));
|
|
if f_status /= open_ok then
|
|
print("Failed to open " & G_TEXTTESTFILE_REFERENCE & " for reading: " & file_open_status'image(f_status));
|
|
else
|
|
while not endfile(txtfile) loop
|
|
readline(txtfile, l);
|
|
line_num := line_num + 1;
|
|
write(msg, "Line " & str(line_num) & ": " & str(l'length) & " characters: ");
|
|
for i in l'range loop
|
|
write(msg, character'pos(l(i)));
|
|
write(msg, string'(" "));
|
|
end loop;
|
|
writeline(output, msg);
|
|
end loop;
|
|
end if;
|
|
print("<Done testing readline() behaviour>");
|
|
|
print(lf & "<Test reading binary files>");
|
print(lf & "<Test reading binary files>");
|
-- Check if the current simulator running on the current operating system supports
|
-- Check if the current simulator running on the current operating system supports
|
-- reading binary files as file of character.
|
-- reading binary files as file of character.
|
-- That is a requirement for check_binfile().
|
-- That is a requirement for check_binfile().
|
file_open(f_status, binfile, G_BINTESTFILE_REFERENCE, read_mode);
|
file_open(f_status, binfile, G_BINTESTFILE_REFERENCE, read_mode);
|
Line 559... |
Line 583... |
check("Number of errors while reading binary file", v_errcnt, 0, pltbv, pltbs);
|
check("Number of errors while reading binary file", v_errcnt, 0, pltbv, pltbs);
|
check_cnt(C_EXPECTED_SUCCESS, v_expected_checks_cnt, v_expected_errors_cnt, expected_checks_cnt, expected_errors_cnt);
|
check_cnt(C_EXPECTED_SUCCESS, v_expected_checks_cnt, v_expected_errors_cnt, expected_checks_cnt, expected_errors_cnt);
|
check("Number of bytes read from binary file", i, G_BINTESTFILE_LEN, pltbv, pltbs);
|
check("Number of bytes read from binary file", i, G_BINTESTFILE_LEN, pltbv, pltbs);
|
check_cnt(C_EXPECTED_SUCCESS, v_expected_checks_cnt, v_expected_errors_cnt, expected_checks_cnt, expected_errors_cnt);
|
check_cnt(C_EXPECTED_SUCCESS, v_expected_checks_cnt, v_expected_errors_cnt, expected_checks_cnt, expected_errors_cnt);
|
end if;
|
end if;
|
print("<Done testing reading binary files");
|
print("<Done testing reading binary files>");
|
|
|
print(lf & "<Testing check_binfile()");
|
print(lf & "<Testing check_binfile()");
|
check_binfile("Testing correct binary file", G_BINTESTFILE_CORRECT, G_BINTESTFILE_REFERENCE, G_CHECKFILE_VERBOSITY, pltbv, pltbs);
|
check_binfile("Testing correct binary file", G_BINTESTFILE_CORRECT, G_BINTESTFILE_REFERENCE, G_CHECKFILE_VERBOSITY, pltbv, pltbs);
|
check_cnt(C_EXPECTED_SUCCESS, v_expected_checks_cnt, v_expected_errors_cnt, expected_checks_cnt, expected_errors_cnt);
|
check_cnt(C_EXPECTED_SUCCESS, v_expected_checks_cnt, v_expected_errors_cnt, expected_checks_cnt, expected_errors_cnt);
|
check_binfile("Testing binary file with error", G_BINTESTFILE_ERROR, G_BINTESTFILE_REFERENCE, G_CHECKFILE_VERBOSITY, pltbv, pltbs);
|
check_binfile("Testing binary file with error", G_BINTESTFILE_ERROR, G_BINTESTFILE_REFERENCE, G_CHECKFILE_VERBOSITY, pltbv, pltbs);
|