problem with VHDL 93 style file_open

Joined
Sep 13, 2007
Messages
1
Reaction score
0
Hi,

Is it possible to open a file inside a VHDL process let say like this:
...
...
architecture problem of io is
begin
process (clk, reset_ax, manual_reset) is
-- file declarations
file dataout :text;
variable v : integer;
variable buf: line; -- buffer to file
variable fstatus: FILE_OPEN_STATUS;
begin
if(reset_ax, manual_reset) then
--reset some signals here
..
file_open(fstatus,dataout,"mytext.txt",write_mode); -- open the file
elsif(rising_edge(clk)
..
..
if(pulse is valid then write value to a file) then
v:= put valid value to v;
write(buf,v);
writeline(dataout,buf);
end if;

if(when all samples collected) then
file_close(dataout);
end if;
end if;
end process;
..
..
My problem is that I want to reset this file writing in some point(don't ask why =)) and start writing new samples to empty file(overwrite the old file).But it seems that after manual_reset signal, file is opened but it's in append_mode - so it continues to write end of this "old" file. I wonder why ? I have understood that opening the file in write_mode clears the "old" file and starts to write on a empty file...
I'm using Modelsim 6.1 and operating system is Unix.
Does anybody knows what I am missing here ? Appreciating any help..

-Skiggeboi-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

pls help me ; vhdl; 0
2 JK Circuit in VHDL 0
Problem with I/O files. 0
VHDL Subtraction two’s complement 0
Problem With Mealy Sequence Detector 1
code vhdl 1
racing condition in vhdl 0
Vhdl problem with integers 1

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top