Write file at real-time 
Author Message
 Write file at real-time

Hello,

We are trying to pass some information from the VHDL world
to the outside world (using files).

The problem is that the textio.writeline procedure does
not update the file immediatelly when it is invoked. Instead
the data are buffered somwhere and are written to the file
when the simulation is interrupted/stopped.

(We are using Synopsys Simulator under Solaris. I do not know
if all simulators behave the same.)

Does anyone know a way to overcome this?

Thanks,
Kostas

-----------------------------------------------------------------------
 Kostas C. Pramataris,
 Telecommunication Laboratory, Computer Science Division
 National Technical University of Athens

 9 Heroon Politehniou St.,        Phone : (301) 7721479, Fax: 7722530

 Greece.                           http://www.*-*-*.com/ ~kpram/
-----------------------------------------------------------------------



Sun, 19 Mar 2000 03:00:00 GMT  
 Write file at real-time

This is a multi-part message in MIME format.

--------------315313F23D99
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Quote:

> Hello,

> We are trying to pass some information from the VHDL world
> to the outside world (using files).

> The problem is that the textio.writeline procedure does
> not update the file immediatelly when it is invoked. Instead
> the data are buffered somwhere and are written to the file
> when the simulation is interrupted/stopped.

> (We are using Synopsys Simulator under Solaris. I do not know
> if all simulators behave the same.)

> Does anyone know a way to overcome this?

> Thanks,
> Kostas

        Kostas,

this seems not that strange to me. Files are under Unix mostly
buffered up to a few Kbytes. Standard output, 'the screen' mostly
buffered up to a newline.

I would think that your simulator has a switch to 'unbuffered'.
In my Leapfrog f.i. it is called -UNBUFFERED. This changes the
filebuffering mode to unbuffered.

If not, I think you have not a good chance to change this behaviour.

Hope it helps anyway,

Kind regards

--------------315313F23D99

Content-Transfer-Encoding: 7bit

     \\\|///      ir. Jos De Laender
     ( 0 0 )      Alcatel - SSD (Switching Systems Division)
   oo0-(_)-0oo    ASIC design - VH14                
  _\   ' `   /_
  \ \ALCATEL/ /   F. Wellesplein 1, B-2018 Antwerp, Belgium
   \ \     / /                                

     \ \ / /                                                                
     o0 Y 0o      Alcatel Bell    : http://www.bel.alcatel.be
       \|/        Alcatel Telecom : http://www.alcatelecom.be
        *         Phone           : (32)(0) 3 240 74 61
                  Fax             : (32)(0) 3 240 99 47

--------------315313F23D99--



Sun, 19 Mar 2000 03:00:00 GMT  
 Write file at real-time

Quote:

> Hello,

> We are trying to pass some information from the VHDL world
> to the outside world (using files).

> The problem is that the textio.writeline procedure does
> not update the file immediatelly when it is invoked. Instead
> the data are buffered somwhere and are written to the file
> when the simulation is interrupted/stopped.

> (We are using Synopsys Simulator under Solaris. I do not know
> if all simulators behave the same.)

> Does anyone know a way to overcome this?

If the file variable is defined inside a process, the file
is opened at the simulation start and closed with the
simulation ends.

If you define the file inside a function or procedure, the
file is opened when the function/procedure is called and
closed when the function/procedure exits.  Most times
this will cause the file to be updated at that time.

--

Efficient Networks, Inc                 'ATM for the Desktop'
4201 Spring Valley, Suite 1200          http://www.efficient.com/
Dallas,  TX  75244                      (972) 991-3884



Sun, 19 Mar 2000 03:00:00 GMT  
 Write file at real-time

It's not elegant, but I use the sequence:

  open the file in APPEND_MODE
  write out my stuff
  close the file

to output stuff I don't want buffered. For the simulations I run, it hasn't
slowed things things down noticeably.

Good luck,
- john



Quote:
> Hello,

> We are trying to pass some information from the VHDL world
> to the outside world (using files).

> The problem is that the textio.writeline procedure does
> not update the file immediatelly when it is invoked. Instead
> the data are buffered somwhere and are written to the file
> when the simulation is interrupted/stopped.

---SNIP---


Mon, 20 Mar 2000 03:00:00 GMT  
 Write file at real-time

Quote:

> We are trying to pass some information from the VHDL world
> to the outside world (using files).

> The problem is that the textio.writeline procedure does
> not update the file immediatelly when it is invoked. Instead
> the data are buffered somwhere and are written to the file
> when the simulation is interrupted/stopped.

VSS has no clean solution for this. Try opening the file
in a procedure and calling the procedure each time you
want to to write a line, which works just fine, but I guess
could slow things down if you're writing a lot of data.

If you're truly fearless, you could build your own libc.so
and link that to the simulator at runtime. I guess GNU's
C library would work. There's also an extra runtime shared
library variable that you can use to bootstrap a
single function. I forget what it is, but it's documented
in the change-hostid package that floats about on the
net for all you host-id hackers.
--
"I don't have to take this abuse from you -- I've got hundreds of people
waiting to abuse me."
    -- Bill Murray, "Ghostbusters"


WWW    : http://homepages.munich.netsurf.de/Jonathan.Connell/
Fax    : +49 89 636-82692      |     Tel : +49 89 636-82687



Mon, 20 Mar 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Time to REAL & REAL to time

2. new real-time tool written in Ada

3. Please help Visual Basic Programer with simple read/write text file routine---Real Basic 2.1

4. writing about 100 colomns of real data into text file

5. txt file in real time

6. Plotting a graph in real-time without reading from a file

7. real time sharing of files by Ada and C on DEC system

8. Real-time file browser.

9. real time dispaly of time.

10. Help!: problem with fast timing for real-time application on PC

11. Help!: problem with fast timing for real-time application on PC

12. DOS compressed date/time into real date/time

 

 
Powered by phpBB® Forum Software