Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > read input file in vhdl !

Reply
Thread Tools

read input file in vhdl !

 
 
charko charko is offline
Junior Member
Join Date: Apr 2010
Posts: 10
 
      05-19-2010
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 by charko; 05-19-2010 at 08:31 AM..
Reply With Quote
 
 
 
 
charko charko is offline
Junior Member
Join Date: Apr 2010
Posts: 10
 
      05-19-2010
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
 
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
File.read(fname) vs. File.read(fname,File.size(fname)) Alex Dowad Ruby 4 05-01-2010 08:20 AM
Input from file and output to file - VHDL Emel VHDL 2 01-29-2010 08:01 AM
how read content from file in form input type=file Rafal\(sxat\) Javascript 5 05-26-2009 04:07 AM
Read input value from dynamic created input controls Melissa ASP .Net 2 12-26-2008 07:48 AM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM



Advertisments