URL
https://opencores.org/ocsvn/pltbutils/pltbutils/trunk
Subversion Repositories pltbutils
Compare Revisions
- This comparison shows the changes necessary to convert path
/pltbutils/trunk/bench/vhdl
- from Rev 107 to Rev 109
- ↔ Reverse comparison
Rev 107 → Rev 109
/tb_pltbutils.vhd
173,11 → 173,15
variable v_expected_data : integer; |
variable v_actual_data : integer; |
variable f_status : file_open_status; |
type charfile is file of character; |
file txtfile : text; |
type charfile is file of character; |
file binfile : charfile; |
variable l : line; |
variable c : character; |
variable i : integer; |
variable v_errcnt : integer; |
variable msg : line; |
variable line_num : integer := 0; |
begin |
|
print(lf & "<Testing startsim()>"); |
530,6 → 534,26
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(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>"); |
-- Check if the current simulator running on the current operating system supports |
-- reading binary files as file of character. |
561,7 → 585,7
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); |
end if; |
print("<Done testing reading binary files"); |
print("<Done testing reading binary files>"); |
|
print(lf & "<Testing check_binfile()"); |
check_binfile("Testing correct binary file", G_BINTESTFILE_CORRECT, G_BINTESTFILE_REFERENCE, G_CHECKFILE_VERBOSITY, pltbv, pltbs); |