Hi all ,
I’m Trying to read a file information in SV ,
But i’m getting some junk data(unwanted data) ,
function get_mcu_data; // function to read the file and store the contents in the array.
reg[31:0] s;
integer i;
in1 = $fopen("/home/shtsai/work/camel/versic_libs/vlog/proj/hpc_ethash/hardware/test/hpc/mcu_data.txt","r");
//$readmemh("/home/shtsai/work/camel/versic_libs/vlog/proj/hpc_ethash/hardware/test/hpc/mcu_data.txt" ,mcu_wr_data);
while ( !$feof(in1)) begin
$fgets(line,in1);
$display(" Prashu :%0h", line);
end
input of this file
80
14
34
24
24
24
ac
24
ac
ac
ac
43
45
ac
00
01
23
00
00
00
00
24
0c
ac
00
01
23
01
23
01
23
After running the simulation the output which i’m getting is below
Prashu :383020202020200a
Prashu :31340a
Prashu :33340a
Prashu :32340a
Prashu :32340a
Prashu :323420200a
Prashu :61630a
Prashu :32340a
Prashu :61630a
Prashu :61630a
Prashu :61630a
Prashu :34330a
Prashu :34350a
Prashu :61630a
Prashu :30300a
Prashu :30310a
Prashu :32330a
Prashu :30300a
Prashu :30300a
Prashu :30300a
Prashu :30300a
Kindly please help to read the file information correcly .