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

Reply

VHDL - are there FILE I/O in VHDL?

 
Thread Tools Search this Thread
Old 08-11-2003, 05:26 AM   #1
Default are there FILE I/O in VHDL?


Dear all,

I want to ask a question about FILE I/O using VHDL during
simulation. My project requires a close collaboration between matlab
and VHDL simulation. I need to import data generated from matlab
into VHDL program and then execute and get results exported into
matlab for further analysis.

Is there a way to open/save file for exchanging data in VHDL?

Thanks a lot,

-Walala


walala
  Reply With Quote
Old 08-11-2003, 10:28 AM   #2
Egbert Molenkamp
 
Posts: n/a
Default Re: are there FILE I/O in VHDL?
Yes,
It is possible to read and write files within VHDL.
See for more informatie the FAQ:
http://www.vhdl.org/vi/comp.lang.vhdl/FAQ1.html#files

Depending on your simulator it is probably possible to
start the VHDL simulation from the MatLab environment.
We use this apporach in combination with ModelSim.
Here an example how we used it for a fft implementaion.

A part of the matlab script is:
%--> Start ModelSim and start simulation
dos('M:\win32\vsim -do V:/testbench/fft1024/fft1024.do');

where de script file "fft1024.do" contains the ModelSim commands.
e.g.:
cd W:/
vcom V:/testbench/fft1024/fft1024_tester.vhd
vcom V:/testbench/tp_testbench.vhd
vsim tp_testbench
run -all
quit -f

Using this approach we automatically can compare the VHDL simulation
results (results are written in a file in ModelSim) with the MatLab results.

Egbert Molenkamp

"walala" <> wrote in message
news: om...
> Dear all,
>
> I want to ask a question about FILE I/O using VHDL during
> simulation. My project requires a close collaboration between matlab
> and VHDL simulation. I need to import data generated from matlab
> into VHDL program and then execute and get results exported into
> matlab for further analysis.
>
> Is there a way to open/save file for exchanging data in VHDL?
>
> Thanks a lot,
>
> -Walala





Egbert Molenkamp
  Reply With Quote
Old 08-11-2003, 10:34 AM   #3
Jonathan Bromley
 
Posts: n/a
Default Re: are there FILE I/O in VHDL?
"walala" <> wrote in message
news: om...
> Dear all,
>
> I want to ask a question about FILE I/O using VHDL during
> simulation. My project requires a close collaboration between matlab
> and VHDL simulation. I need to import data generated from matlab
> into VHDL program and then execute and get results exported into
> matlab for further analysis.
>
> Is there a way to open/save file for exchanging data in VHDL?


VHDL has reasonable file I/O facilities, described in any
good textbook (try Peter Ashenden, Designer's Guide to VHDL).

Standard file I/O will work fine if you can run your MATLAB
program, generate a file of data and then read that file into
your VHDL simulation; similarly you can get VHDL to dump some
output to a file and then post-process with MATLAB.

If you need on-the-fly interaction between MATLAB and VHDL,
things are more difficult. There is no easy way to open
a pipe from VHDL. However, we've had quite good success
by using Tcl to glue a VHDL simulation to another running
program. Use VHDL's console I/O (INPUT and OUTPUT channels),
and then use Tcl to open the simulator as a bidirectional
command pipeline. Similarly Tcl can then open a MATLAB
program as a bidi command pipe. You can then manage the
interaction between simulation and MATLAB, using Tcl.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.





Jonathan Bromley
  Reply With Quote
Old 08-18-2003, 03:50 PM   #4
Hans
 
Posts: n/a
Default Re: are there FILE I/O in VHDL?
Hi Walala,

Instead of files you might also want to have a look at using sockets.
Sockets are surprisingly easy to use especially under Linux

If you have access to Modelsim PE you can use TCL to support sockets. If you
have Modelsim SE you can also use the excellent FLI (C/C++) interface.


Hans

www.ht-lab.com

"walala" <> wrote in message
news: om...
> Dear all,
>
> I want to ask a question about FILE I/O using VHDL during
> simulation. My project requires a close collaboration between matlab
> and VHDL simulation. I need to import data generated from matlab
> into VHDL program and then execute and get results exported into
> matlab for further analysis.
>
> Is there a way to open/save file for exchanging data in VHDL?
>
> Thanks a lot,
>
> -Walala





Hans
  Reply With Quote
Old 08-24-2003, 08:22 AM   #5
Arvind Kumar
 
Posts: n/a
Default Re: are there FILE I/O in VHDL?
Hi,
Any pointer to how the socket which you mentioned and what can it do???
Regards,
Arvind Kumar



> Instead of files you might also want to have a look at using sockets.
> Sockets are surprisingly easy to use especially under Linux
>
> If you have access to Modelsim PE you can use TCL to support sockets. If you
> have Modelsim SE you can also use the excellent FLI (C/C++) interface.
>
>



Arvind Kumar
  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 file IO (using file as variable) veevee1 VHDL 0 03-07-2007 11:56 AM
SONY DVD RW DW-G120A SOMETIMES FAILS...... atlantic965 DVD Video 0 06-18-2006 10:36 PM
problems backing up dvds Lawrence Traub DVD Video 11 09-27-2005 07:34 PM
Re: Ripping DVDs. Please answer the attached question. - Question.txt Stan Brown DVD Video 19 02-09-2005 11:19 PM
Burn process failed - help! Log file posted for help troubleshooting Michael Mason DVD Video 1 08-16-2004 09:24 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