Error: (vsim-3341) Cannot open file

Hi there! I'm getting the following error when I'm simulating with Modelsim:

# ** Error: (vsim-3341) Cannot open file "outDataFile.txt". File is already open. # Time: 4993405 ns Iteration: 1 Instance: /testbench/dut

Simulating the same design with NCSim works out fine. The file "outDataFile.txt" is correctly written. But why is Modelsim refusing this? The following part is the code for the file I/O:

file_open (outDataFile,"outDataFile.txt" , write_mode); for i in memory_matrix'range loop data_file:=memory_matrix(i); hwrite (outline,data_file); writeline (outDataFile, outline); end loop; file_close (outDataFile);

I have set a breakpoint at the first line. It appears that the error occurs already at the very first time this statement is invoked. There is no other file_open command in the model. Why does Modelsim think this file already open?

Thanks in advance for your help. Henning

Reply to
Henning Bahr
Loading thread data ...

Maybe your file declaration says "open".

-- Mike Treseler

Reply to
Mike Treseler

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.