Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - problem with VHDL 93 style file_open

 
Thread Tools Search this Thread
Old 09-13-2007, 09:01 PM   #1
Default problem with VHDL 93 style file_open


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-


skiggeboi
skiggeboi is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL problem with variables krkrkr Hardware 0 10-16-2009 07:36 PM
vhdl std_logic_vector slice access problem topi1234 Software 0 04-18-2008 12:07 PM
VHDL problem - Signal counter cannot be synthesized, bad synchronous description. shipacpoloy Software 0 08-14-2007 07:26 AM
Problem in VHDL code. caylakprogramci Hardware 2 05-07-2007 07:30 PM
Re: Serious Computer Problem hootnholler A+ Certification 1 11-24-2003 12:18 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46