data/full_repos/permissive/162924824/test2/comun/frameutils.v
 line:141 column:2: Illegal character '`'
1: b'%Error: data/full_repos/permissive/162924824/test2/comun/frameutils.v:86: Unsupported or unknown PLI call: $timeformat\n    $timeformat(-3, 2, " ms", 10);    \n    ^~~~~~~~~~~\n%Error: data/full_repos/permissive/162924824/test2/comun/frameutils.v:120: Unsupported or unknown PLI call: $fputc\n        res = $fputc(8\'h40, f);\n              ^~~~~~\n%Error: data/full_repos/permissive/162924824/test2/comun/frameutils.v:121: Unsupported or unknown PLI call: $fputc\n        res = $fputc(8\'h40, f);   \n              ^~~~~~\n%Error: data/full_repos/permissive/162924824/test2/comun/frameutils.v:122: Unsupported or unknown PLI call: $fputc\n        res = $fputc(8\'h40, f);\n              ^~~~~~\n%Error: data/full_repos/permissive/162924824/test2/comun/frameutils.v:125: Unsupported or unknown PLI call: $fputc\n        res = $fputc(r, f);\n              ^~~~~~\n%Error: data/full_repos/permissive/162924824/test2/comun/frameutils.v:126: Unsupported or unknown PLI call: $fputc\n        res = $fputc(g, f);\n              ^~~~~~\n%Error: data/full_repos/permissive/162924824/test2/comun/frameutils.v:127: Unsupported or unknown PLI call: $fputc\n        res = $fputc(b, f);\n              ^~~~~~\n%Error: Exiting due to 7 error(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module framegrabber (
  input wire clk,
	input wire [10:0] hc,
	input wire [10:0] vc,
	input wire [7:0] r,
	input wire [7:0] g,
	input wire [7:0] b,
	input wire hsync,
	input wire vsync
	);
	
	parameter HTOTAL = 800;
  parameter VTOTAL = 525;
  parameter HSYNCPOL = 0;
  parameter VSYNCPOL = 0;
  
  integer nframes;
	integer f;
   initial begin
	  f = $fopen ("fotograma.rgb","wb");
    nframes = 0;
	end
	
	always @(posedge clk) begin
    if (vc == VTOTAL-1 && hc == HTOTAL-1)
      nframes <= nframes + 1;
	  if (nframes > 0) begin
      if (hsync == HSYNCPOL || vsync == VSYNCPOL)
        $fwrite (f, "%c%c%c", 64, 64, 64);
	    else begin
			  $fwrite (f, "%c%c%c", r, g, b);
        if (vc == VTOTAL-1 && hc == HTOTAL-1) begin          
          $fclose (f);
          $display ("Fotograma volcado. Fin de la simulacion");
		      $finish;
        end 
      end
	  end
	end  
endmodule
module framegrabber (
  input wire clk,
	input wire [10:0] hc,
	input wire [10:0] vc,
	input wire [7:0] r,
	input wire [7:0] g,
	input wire [7:0] b,
	input wire hsync,
	input wire vsync
	);

	
	parameter HTOTAL = 800;
  parameter VTOTAL = 525;
  parameter HSYNCPOL = 0;
  parameter VSYNCPOL = 0;
  
  integer nframes;
	integer f;
   initial begin
	  f = $fopen ("fotograma.rgb","wb");
    nframes = 0;
	end
	
	always @(posedge clk) begin
    if (vc == VTOTAL-1 && hc == HTOTAL-1)
      nframes <= nframes + 1;
	  if (nframes > 0) begin
      if (hsync == HSYNCPOL || vsync == VSYNCPOL)
        $fwrite (f, "%c%c%c", 64, 64, 64);
	    else begin
			  $fwrite (f, "%c%c%c", r, g, b);
        if (vc == VTOTAL-1 && hc == HTOTAL-1) begin          
          $fclose (f);
          $display ("Fotograma volcado. Fin de la simulacion");
		      $finish;
        end 
      end
	  end
	end  
endmodule