Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Read some hex value in a file for test bench

Reply
Thread Tools

Read some hex value in a file for test bench

 
 
Teten
Guest
Posts: n/a
 
      09-03-2005
Hi,

I have a file which contain a lot of hex values 0x47 0x20 0x57 . . . .

I mus program a testbench which read these values to inject them in a
vhdl module (to validate it).

I use the textio package without any good results.

It is the fist time that i use it and have some difficulties.

Can you help me ?

I thank you a lot !

Teten

-- my source code which may that (no correct functionning ...)

PROCESS
FILE fichier : text IS IN fichier_TS_in;

VARIABLE ligne : line;
VARIABLE data_int : STD_LOGIC_VECTOR(7 downto 0);
VARIABLE good: boolean; -- Status of the read operations
BEGIN


WHILE NOT ENDFILE(fichier) LOOP

readline(fichier, ligne); -- ouverture du fichier ts
hread(ligne,data_int,good); -- Read the B argumen
WHILE good LOOP
WAIT UNTIL rising_edge(CLK_TS); -- pour synchroniser
DATA_TS <= data_int;
hread(ligne,data_int,good);
END LOOP;
END LOOP;
END PROCESS;

 
Reply With Quote
 
 
 
 
Ajeetha
Guest
Posts: n/a
 
      09-03-2005
Hi,
What exactly is the problem here? Do you get wrong values being read
in? Do you see a crash? Please explain and if you like, send me a
working code (with sample text file) via email @ gmail.com @ ajeetha.

Good Luck
www.noveldv.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hex Color Codes - Hex 6 <=> Hex 3 lucanos@gmail.com HTML 10 08-18-2005 11:21 PM
How do I read binary file data in a test bench? Pete Fraser VHDL 4 11-04-2004 02:51 AM
hex value in string back to real hex value jack Python 4 09-08-2004 07:11 AM
hex(-5) => Futurewarning: ugh, can't we have a better hex than '-'[:n<0]+hex(abs(n)) ?? Bengt Richter Python 6 08-19-2003 07:33 AM
test test test test test test test Computer Support 2 07-02-2003 06:02 PM



Advertisments