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

Reply

VHDL - How do I read binary file data in a test bench?

 
Thread Tools Search this Thread
Old 10-29-2004, 05:41 PM   #1
Default How do I read binary file data in a test bench?


Say I have a binary file containing compressed video.
I want to present the dut in my test bench with a byte
from the file at the dut's standard_logic_vector input,
every clock period.

What's the cleanest way to do this?
Can I use a binary file, or do I need to convert it to:

"xxxxxxxx"
"xxxxxxxx"
"xxxxxxxx"

with one 8-bit slv per line.

Is this simulator specific (I'll be using Modelim PE).

Thanks




Pete Fraser
  Reply With Quote
Old 10-30-2004, 01:04 AM   #2
mike_treseler
 
Posts: n/a
Default Re: How do I read binary file data in a test bench?


mike_treseler
  Reply With Quote
Old 11-01-2004, 09:09 PM   #3
Pete Fraser
 
Posts: n/a
Default Re: How do I read binary file data in a test bench?
"mike_treseler" <tres@fl_ke.com> wrote in message
news: lkaboutprogramming.com...
> http://groups.google.com/groups?q=vhdl+sim+char_file
>

Thanks Mike.
Exactly the start I needed.




Pete Fraser
  Reply With Quote
Old 11-03-2004, 07:35 PM   #4
Pete Fraser
 
Posts: n/a
Default Re: How do I read binary file data in a test bench?

"mike_treseler" <tres@fl_ke.com> wrote in message
news: lkaboutprogramming.com...
> http://groups.google.com/groups?q=vhdl+sim+char_file
>
> -- Mike Treseler


That worked nicely, but I can't work out how to
convert from character to std_logic_vector.

test_sig <= conv_std_logic_vector(my_char_v,
doesn't work.

The FAQ suggests it's possible, and gives some hints, but I still don't get
it.

Thanks

Pete




Pete Fraser
  Reply With Quote
Old 11-04-2004, 02:51 AM   #5
Mike Treseler
 
Posts: n/a
Default Re: How do I read binary file data in a test bench?
Pete Fraser wrote:

> That worked nicely, but I can't work out how to
> convert from character to std_logic_vector.


function char2std(arg:character)
return std_logic_vector is begin
return std_logic_vector(to_unsigned(character'pos(arg), );
end char2std;

-- Mike Treseler


Mike Treseler
  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
Java read xml file java_newbie General Help Related Topics 1 06-04-2009 02:30 AM
how to set clock in xilinx test bench shyams82 Software 0 09-24-2008 05:51 PM
A+ Test is unfair Scott Davies A+ Certification 25 02-16-2004 03:18 PM
Pioneer A05 Problems Bill Stock DVD Video 8 11-28-2003 05:03 AM
Re: A+ Test Info (June) RussS A+ Certification 0 08-04-2003 01:16 AM




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