cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
4,789 Views
Registered: ‎08-26-2016

Read Image File - Different Simulation results in ISim 13.2 and Vivado 2016.2

Hello,
I have written a simple test bench code in Verilog to read a "raw" image file and store the pixel values in a text file. I am getting different results when I simulate in Xilinx ISim 13.1 (x64) and Vivado 2016.2 (x64). Here's my code:


module test_image_read_write;

reg [7:0] InputImage [0:1023];

integer ReadPointer;
integer WritePointer;
integer i;

initial
begin
ReadPointer = $fopen("1.raw","rb+");
$fread(InputImage,ReadPointer);

WritePointer = $fopen("InputImageText.txt","wb+");

for(i = 0; i < 1024; i = i + 1)
begin
$fwrite(WritePointer,InputImage[i]);
$fwrite(WritePointer,",");
end

$fclose(WritePointer);
end

endmodule


The relevant files are attached. Can someone point out the reason for the different results ?

0 Kudos
1 Reply
Highlighted
Visitor
Visitor
4,760 Views
Registered: ‎08-26-2016

Re: Read Image File - Different Simulation results in ISim 13.2 and Vivado 2016.2

I think it should have been posted under "Simulation and Verification." I did it mistakenly. Any moderators, please move the post to the relevant topic.

0 Kudos