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.
Use readmemh/readmemb system functions to read from the .raw file. To confirm what is read is correct or simply see the hex contents of the raw file, use a hex editor where you can simply open the raw file and see the hex numbers.
you're welcome,
just go through how they're doing it here:
essentially they create a memory inside the verilog .
the width of the memory word is depending on your pixel format which you working with (RGB, YCbCr etc.).
i have one text file which is the output of unsigned value of character of one .raw image file.
can you please tell me which function can i use to read that file?
i used "readmemh" but its only for hex value but i have unsigned character value.
please tell me how can i proceed to read that file?
say unsigned character is 'A', looking up the ASCII table, it will have a hex value. That is what will be read by the hex editor. If you want the character back, you'll just have to implement some script in perl or tcl where the conversion back to characters is done.
this seems like a rather roundabout method though, but the only one which to mind from my experience.
initial begin
file = $fopen("cur_img.txt","rb");
char =$fgetc(file);
while (char!=`EOF)
begin
char =$fgetc(file);
$display("%d", char);
end
end
endmodule
now it gives some interger value in output.
i have attached my .txt file.
it has many characters so i am wondering is my output is true or not?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.