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

Reply

VHDL - Reading/Writing pure binary files

 
Thread Tools Search this Thread
Old 05-27-2004, 05:07 PM   #1
Default Reading/Writing pure binary files


I am looking for a way to read and write pure binary files in VHDL.
I have a device that takes real-time snapshots of data streams in
PCM (binary) format. I want to read this file, send it through a design
to process it, and have the testbench spit the results back into a
binary like the incoming. Any tips would be appreciated.

Thanks!


Daniel Gowans
  Reply With Quote
Old 05-27-2004, 05:52 PM   #2
Tuukka Toivonen
 
Posts: n/a
Default Re: Reading/Writing pure binary files
In article <Xns94F667078C658chlumpyahoocom@198.60.22.31>, Daniel Gowans wrote:
> I am looking for a way to read and write pure binary files in VHDL.
> I have a device that takes real-time snapshots of data streams in
> PCM (binary) format. I want to read this file, send it through a design
> to process it, and have the testbench spit the results back into a
> binary like the incoming. Any tips would be appreciated.


I'm doing some image processing design but using a slightly
different approach: instead of VHDL code reading directly images
(.png), I wrote a small script in Perl to convert these into
files containing pixel values in ASCII, which are read into
memory in the beginning. After simulation, there's another
script to convert output ASCII values back into binary
(or in my case to a file suitable for being read by Matlab).

Maybe you could use similar approach, writing couple of
converters.


Tuukka Toivonen
  Reply With Quote
Old 06-12-2004, 02:25 AM   #3
lsha
 
Posts: n/a
Default Re: Reading/Writing pure binary files
The following is a partial VHDL code that works for me (at least for
reading raw data file).

-- in the architecture declaration part
-- raw DV file
type intFileType is file of natural;
file fileRawDV: intFileType open read_mode is "D:\video\DV\test.DV" ;

-- in the procedure declaration part
variable rawDV: natural; -- 32-bit raw DV from the file
variable leData: std_logic_vector(31 downto 0); -- data from the file
is little-endian

-- in the procedure

read(fileRawDV, rawDV);
leData := conv_std_logic_vector(rawDV,32);

Hope this helps.




lsha
  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
Convert Video files to PSP ivan DVD Video 4 06-17-2008 11:16 AM
Convert Video files to MP4 for iPod ivan DVD Video 0 04-26-2006 08:38 AM
Very slow recognising DVD disc Terry Pinnell DVD Video 1 03-28-2006 06:53 PM
Now I introduce some popular software of multimedia eightsome@gmail.com DVD Video 0 03-28-2006 02:29 PM
DVD-Player divx mpeg4 should play pure mpeg files from disc adsci DVD Video 2 03-24-2006 07:43 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