How can I flush file input buffers?

A

Anon Anon

Guest
I have written a test script that takes its input from a simple text
file that I am then running inside Xilinx ISE 9.1.

Unfortunately, editing this file using Wordpad etc has no effect on my
application, unless I force ISE to re-generate the simulation - i.e. by
selecting the 'Simulate Behavioural Model' option from the processes
menu tree.

Simply restarting the current simulation seems to cause it to use the
previous state of the data file - which has led to no end of confusion
on my part.

Is there any way either in ISE or my application that I can force the
simulator to reload its file cache?

Thanks.
 
You may find that closing the file helps:
file_close(file_name) ;

OTOH, some of these things are tool/OS dependent, so YMMV.

Cheers,
Jim


I have written a test script that takes its input from a simple text
file that I am then running inside Xilinx ISE 9.1.

Unfortunately, editing this file using Wordpad etc has no effect on my
application, unless I force ISE to re-generate the simulation - i.e. by
selecting the 'Simulate Behavioural Model' option from the processes
menu tree.

Simply restarting the current simulation seems to cause it to use the
previous state of the data file - which has led to no end of confusion
on my part.

Is there any way either in ISE or my application that I can force the
simulator to reload its file cache?

Thanks.
 
Anon Anon wrote:
I have written a test script that takes its input from a simple text
file that I am then running inside Xilinx ISE 9.1.

Unfortunately, editing this file using Wordpad etc has no effect on my
application, unless I force ISE to re-generate the simulation - i.e. by
selecting the 'Simulate Behavioural Model' option from the processes
menu tree.

Simply restarting the current simulation seems to cause it to use the
previous state of the data file - which has led to no end of confusion
on my part.
Did you restart using the command "restart -f"?
 
Duane Clark wrote:
Anon Anon wrote:
I have written a test script that takes its input from a simple text
file that I am then running inside Xilinx ISE 9.1.

Unfortunately, editing this file using Wordpad etc has no effect on my
application, unless I force ISE to re-generate the simulation - i.e.
by selecting the 'Simulate Behavioural Model' option from the
processes menu tree.

Simply restarting the current simulation seems to cause it to use the
previous state of the data file - which has led to no end of confusion
on my part.

Did you restart using the command "restart -f"?
That did it! Many thanks.

Quick question though - what does this do and where is it documented?
I'm guessing the 'f' is for flush, but I can't find any mention of it in
the Xilinx docs - in fact, they indicate that restart doesn't take any
options at all.

2nd follow-on question - can I perform the same operation somewhere in
my test code, just to avoid me forgetting to use the -f option?

Thanks once again!
 
Anon Anon wrote:
Duane Clark wrote:
Did you restart using the command "restart -f"?

That did it! Many thanks.

Quick question though - what does this do and where is it documented?
Let's see...

100 Tue May 29 /evtfs/home/tres> vsim -c

ModelSim> help restart

# The restart command reloads the design elements
# and resets the simulation time to zero.
# Only design elements that have changed are reloaded.
# Note that SDF files are always reread during a restart.)
# Usage: restart [-force] [-nobreakpoint] [-nolist] [-nolog] [-nowave]


2nd follow-on question - can I perform the same operation somewhere in
my test code, just to avoid me forgetting to use the -f option?
You can put it in a tcl script.
Here's an example
http://home.comcast.net/~mike_treseler/uart.do

-- Mike Treseler
 

Welcome to EDABoard.com

Sponsor

Back
Top