Error (vsim-8323) scoreboard.sv(59): $fscanf : Argument number 3 is an unpacked type, and may only be printed with the '%p' format

Hello everyone,

when I launch simulation Questa give me this error:
“(vsim-8323) scoreboard.sv(59): $fscanf : Argument number 3 is an unpacked type, and may only be printed with the ‘%p’ format.”

I use in scoreboard a function that reads 19 bits outputs from a txt file that contains them in this mode :

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

My function is:

forever begin
  data_out = $fopen("out.txt", "r");
  if (data_out == `NULL) begin
    $display("data_out handle was NULL");
    $finish;
  end
end

@(posedge bfm.clk) 

begin

 
while(!$feof)

begin
scan_file = $fscanf(data_out, "%b\n", expected_output);
count = count++;
end

end 


This must read txt file “out” and must enter the read data output (19 lines) in expected_output that is this queue:

parameter n_pixel_total = 1049088;
logic   unsigned [18:0] expected_output [$:n_pixel_total];

What is the problem?

Thank you all

In reply to vinzciotoli:
There error message is not correct, probably because it is sharing some type checking code from $display. In any case, you are specifying an argument to be read using the “%b” format. That requires an integral argument, not an unpacked array. What you need to do is

parameter n_pixel_total = 1049088;
logic   unsigned [18:0] pixel, expected_output [$:n_pixel_total];
string errormess; int errorno;
begin
  data_out = $fopen("out.txt", "r");
  if (data_out == 0) begin
    errorno = $ferror(data_out, errormess);
    $fatal(0, "data_out handle was NULL:Error number %0d, %s",errorno,errormes);
  end
  while($fscanf(data_out, "%b\n", pixel)) begin
       expected_output.push_back(pixel);
       count++;
     end
end


Not sure what you were trying to do with the forever loop.

In reply to dave_59:
it work now!
Thank you so much!!!