Read some hex value in a file for test bench

T

Teten

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;
 
A

Ajeetha

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Vhdl testbench with textio package 0
read input file in vhdl ! 1
read from a file 2
HELP!a bug in testbench 4
SRAM Hread problem 0
file read in Virtex II board 0
READ FROM FILE 2
SRAM "Hread" problem 0

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top