data/full_repos/permissive/117026779/src/VGA.v
1: b"%Error: data/full_repos/permissive/117026779/src/VGA.v:93: syntax error, unexpected '(', expecting IDENTIFIER\n    .clk(clk),\n    ^\n%Error: Exiting due to 1 error(s)\n"
module VGA(
    input wire pclk,
    input wire rst,
    output reg hsync,
    output reg vsync,
    output reg [31:0] hcount,
    output reg [31:0] vcount,
    output reg hblank,
    output reg vblank
);




parameter SCREEN_WIDTH 	 = 640;
parameter SCREEN_HEIGHT	 = 480;
parameter DISPLAY_WIDTH  = SCREEN_WIDTH-1;
parameter DISPLAY_HEIGHT = SCREEN_HEIGHT-1;
parameter HORIZONTAL_FRONT_PORCH = 16;
parameter HORIZONTAL_SYNC_PULSE = 96;
parameter HORIZONTAL_BACK_PORCH = 48;
parameter VERTICAL_FRONT_PORCH = 11;
parameter VERTICAL_SYNC_PULSE = 2;
parameter VERTICAL_BACK_PORCH = 31;






wire hsyncon, hsyncoff, hreset, hblankon;
wire vsyncon, vsyncoff, vreset, vblankon;



assign hblankon = (hcount == DISPLAY_WIDTH);
assign hsyncon  = (hcount == DISPLAY_WIDTH+HORIZONTAL_FRONT_PORCH);
assign hsyncoff = (hcount == DISPLAY_WIDTH+HORIZONTAL_FRONT_PORCH+HORIZONTAL_SYNC_PULSE);
assign hreset   = (hcount == DISPLAY_WIDTH+HORIZONTAL_FRONT_PORCH+HORIZONTAL_SYNC_PULSE+HORIZONTAL_BACK_PORCH);

assign vblankon = (hreset & (vcount == DISPLAY_HEIGHT));
assign vsyncon  = (hreset & (vcount == DISPLAY_HEIGHT+VERTICAL_FRONT_PORCH));
assign vsyncoff = (hreset & (vcount == DISPLAY_HEIGHT+VERTICAL_FRONT_PORCH+VERTICAL_SYNC_PULSE));
assign vreset   = (hreset & (vcount == DISPLAY_HEIGHT+VERTICAL_FRONT_PORCH+VERTICAL_SYNC_PULSE+VERTICAL_BACK_PORCH));






always @(posedge pclk or posedge rst)
begin
    if (rst)
    begin
        hcount = 0;
        vcount = 0;
        hblank = 0;
        hsync  = 0;
        vblank = 0;
        vsync  = 0;
    end
    else
    begin
        hcount = hreset  ? 0 :  hcount   + 1;
        hblank = hreset  ? 0 : (hblankon ? 1 : hblank);
        hsync  = hsyncon ? 0 : (hsyncoff ? 1 : hsync);

        vcount = hreset  ? (vreset ? 0 : vcount + 1) : vcount;
        vblank = vreset  ? 0 : (vblankon ? 1 : vblank);
        vsync  = vsyncon ? 0 : (vsyncoff ? 1 : vsync);
    end
end

endmodule
module VGA(
    input wire pclk,
    input wire rst,
    output reg hsync,
    output reg vsync,
    output reg [31:0] hcount,
    output reg [31:0] vcount,
    output reg hblank,
    output reg vblank
);





parameter SCREEN_WIDTH 	 = 640;
parameter SCREEN_HEIGHT	 = 480;
parameter DISPLAY_WIDTH  = SCREEN_WIDTH-1;
parameter DISPLAY_HEIGHT = SCREEN_HEIGHT-1;
parameter HORIZONTAL_FRONT_PORCH = 16;
parameter HORIZONTAL_SYNC_PULSE = 96;
parameter HORIZONTAL_BACK_PORCH = 48;
parameter VERTICAL_FRONT_PORCH = 11;
parameter VERTICAL_SYNC_PULSE = 2;
parameter VERTICAL_BACK_PORCH = 31;






wire hsyncon, hsyncoff, hreset, hblankon;
wire vsyncon, vsyncoff, vreset, vblankon;



assign hblankon = (hcount == DISPLAY_WIDTH);
assign hsyncon  = (hcount == DISPLAY_WIDTH+HORIZONTAL_FRONT_PORCH);
assign hsyncoff = (hcount == DISPLAY_WIDTH+HORIZONTAL_FRONT_PORCH+HORIZONTAL_SYNC_PULSE);
assign hreset   = (hcount == DISPLAY_WIDTH+HORIZONTAL_FRONT_PORCH+HORIZONTAL_SYNC_PULSE+HORIZONTAL_BACK_PORCH);

assign vblankon = (hreset & (vcount == DISPLAY_HEIGHT));
assign vsyncon  = (hreset & (vcount == DISPLAY_HEIGHT+VERTICAL_FRONT_PORCH));
assign vsyncoff = (hreset & (vcount == DISPLAY_HEIGHT+VERTICAL_FRONT_PORCH+VERTICAL_SYNC_PULSE));
assign vreset   = (hreset & (vcount == DISPLAY_HEIGHT+VERTICAL_FRONT_PORCH+VERTICAL_SYNC_PULSE+VERTICAL_BACK_PORCH));






always @(posedge pclk or posedge rst)
begin
    if (rst)
    begin
        hcount = 0;
        vcount = 0;
        hblank = 0;
        hsync  = 0;
        vblank = 0;
        vsync  = 0;
    end
    else
    begin
        hcount = hreset  ? 0 :  hcount   + 1;
        hblank = hreset  ? 0 : (hblankon ? 1 : hblank);
        hsync  = hsyncon ? 0 : (hsyncoff ? 1 : hsync);

        vcount = hreset  ? (vreset ? 0 : vcount + 1) : vcount;
        vblank = vreset  ? 0 : (vblankon ? 1 : vblank);
        vsync  = vsyncon ? 0 : (vsyncoff ? 1 : vsync);
    end
end

endmodule