read input file in vhdl !

Joined
Apr 21, 2010
Messages
10
Reaction score
0
Hi! I am new for the vhdl and i want to know how i can test reading input file.
I write this code to read an input file but i don't have idea to write a test bench for the simulation.
Thank you for your help!
Charko

NB: Sorry for my bad english!

You can find following the code vhdl for reading input file :
library std;
use std.textio.all;

entity lecture is end;

architecture arch of lecture is
begin
read_imput_file : process
variable inline: line;
variable character_variable:character;
variable end_of_line: boolean ;
file myfile: text is "data.txt";
begin
while not endfile(myfile ) loop -- tant qu'on a pas la fin du fichier on fait une boucle
readline(myfile,inline); -- on lit tout le fichier
read(inline,character_variable,end_of_line);
--end_of_line is EOLN Boolean flag
while end_of_line loop -- tant qu'on atteint la fin du fichier
read(inline,character_variable,end_of_line);
end loop;
end loop;
wait; -- ne rien faire lorsque c'est fini
end process read_imput_file;
end arch;
 
Last edited:
Joined
Apr 21, 2010
Messages
10
Reaction score
0
hi everybody!

Please can you help, i want to know how i can write a vhdl code for binary file.
Thank you very munch!

Charko
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top