Skip to content

write to file failed STD_OUTPUT #1079

@mar2345

Description

@mar2345

Hi,
like to share this problem when logging / writing to STD_OUTPUT
simulation aborts with fatal
first write OK, second write aborts with fatal "write to file failed"

** Fatal: 0ms+0: write to file failed
Procedure WRITELINE [TEXT, LINE] at ../lib/std/textio-body.vhd:654
Procedure LOG [STRING] at test_write_std_out.vhd:15
Process :test_write_std_out:main at test_write_std_out.vhd:23

test file to reproduce:

test_write_std_out.vhd

library std;
use std.textio.all;

entity test_write_std_out is
end entity;

architecture tb of test_write_std_out is

procedure log(msg : string) is
variable o : line;
file OUTPUT: TEXT open WRITE_MODE is "STD_OUTPUT";
begin
write(o,string'("::"));
write(o,msg);
writeline(output,o);
end procedure;

begin

main: process
begin
log ("hello world 1"); -- OK
log ("hello world 2"); -- abort with fatal
log ("hello world 3");
log ("hello world 4");
log ("hello world 5");
wait;

 end process;

end architecture;
<<<<<

test run :
nvc --version
nvc 1.14-devel (1.13.0.r134.g89e8d452) (Using LLVM 10.0.0)
Copyright (C) 2011-2024 Nick Gasson
...

nvc -a test_write_std_out.vhd
nvc -e test_write_std_out
nvc -r test_write_std_out

::hello world 1
** Fatal: 0ms+0: write to file failed
Procedure WRITELINE [TEXT, LINE] at ../lib/std/textio-body.vhd:654
Procedure LOG [STRING] at test_write_std_out.vhd:15
Process :test_write_std_out:main at test_write_std_out.vhd:23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions