How can I flush file input buffers?

A

Anon Anon

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.
 
J

Jim Lewis

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
 
D

Duane Clark

Anon said:
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"?
 
A

Anon Anon

Duane said:
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!
 
M

Mike Treseler

Anon said:
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
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top