data/full_repos/permissive/143278/ivltests/fileio.v
1: b'%Error: data/full_repos/permissive/143278/ivltests/fileio.v:6: Unsupported or unknown PLI call: $fopenr\n    fp = $fopenr("read");\n         ^~~~~~~\n%Error: data/full_repos/permissive/143278/ivltests/fileio.v:9: Unsupported or unknown PLI call: $fopenw\n    fp = $fopenw("work/test.txt");\n         ^~~~~~~\n%Error: data/full_repos/permissive/143278/ivltests/fileio.v:13: Unsupported or unknown PLI call: $fopena\n    fp = $fopena("work/test.txt");\n         ^~~~~~~\n%Error: data/full_repos/permissive/143278/ivltests/fileio.v:17: Unsupported or unknown PLI call: $fopenr\n    fp = $fopenr("work/test.txt");\n         ^~~~~~~\n%Error: Exiting due to 4 error(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module top;
  reg [20*8-1:0] var;
  integer fp, code;
  initial begin
    fp = $fopenr("read");
    if (fp != 0) $display("Read of empty file failed.");

    fp = $fopenw("work/test.txt");
    $fdisplay(fp, "From the write.");
    $fclose(fp);

    fp = $fopena("work/test.txt");
    $fdisplay(fp, "From the append.");
    $fclose(fp);

    fp = $fopenr("work/test.txt");
    code = $fgets(var, fp);
    $display("%0s", var[20*8-1:8]);
    code = $fgets(var, fp);
    $display("%0s", var[20*8-1:8]);
    $fclose(fp);
  end
endmodule
module top;

  reg [20*8-1:0] var;
  integer fp, code;
  initial begin
    fp = $fopenr("read");
    if (fp != 0) $display("Read of empty file failed.");

    fp = $fopenw("work/test.txt");
    $fdisplay(fp, "From the write.");
    $fclose(fp);

    fp = $fopena("work/test.txt");
    $fdisplay(fp, "From the append.");
    $fclose(fp);

    fp = $fopenr("work/test.txt");
    code = $fgets(var, fp);
    $display("%0s", var[20*8-1:8]);
    code = $fgets(var, fp);
    $display("%0s", var[20*8-1:8]);
    $fclose(fp);
  end
endmodule