Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help needed in file reading inVHDL

Status
Not open for further replies.

raghava

Member level 2
Joined
Jul 31, 2008
Messages
51
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
1,870
HI VHDL experts,

I am newbie to VHDL. This task is eating away my time.
I want to read a text file(which consist raster data of an image) and store in memory pixelImage as shown below.
The code is not working.
Please correct it.
Here two for loops are not needed I think. And how to read each pixel. By reading each line then each string from that line. Is it correct.
Any help is appreciated.
******************************
procedure PrepareInput is
variable l: line;
variable s: string;
file file_in : text open read_mode is "lena_64_64.txt";
begin
for i in 0 to IR loop
for j in 0 to IC loop
readline(file_in, l);
read(l, s);
pixelImage(i*IC+j) <= s;
end loop;
end loop;
file_close(file_in);
end PrepareInput;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top