entity test is
end entity ;
architecture arch of test is
impure function from_file(fname : in string) return real is
use std.textio.all ;
file f : text ;
variable s : file_open_status ;
variable l : line ;
variable r : real ;
begin
file_open(s, f, fname, READ_MODE) ;
if s /= OPEN_OK then
report "Could not open: " & fname severity failure ;
end if ;
readline(f, l) ;
read(l, r) ;
return r ;
end function ;
constant r : real := from_file("./nonexistent.txt") ;
begin
tb : process
begin
std.env.stop ;
end process ;
end architecture ;
Riviera fails with the following:
# EXECUTION:: FAILURE: Could not open: ./nonexistant.txt
nvc fails with the following:
** Fatal: ENDFILE called on closed file
Procedure READLINE [TEXT, LINE] at ../lib/std/textio-body.vhd:632
Function FROM_FILE [STRING return REAL] at nonexistent_file.vhdl:17
Process (init) at nonexistent_file.vhdl:22
Riviera supplies the status as NAME_ERROR whereas nvc incorrectly states OPEN_OK.
Riviera fails with the following:
nvc fails with the following:
Riviera supplies the status as
NAME_ERROR
whereas nvc incorrectly statesOPEN_OK
.