data/full_repos/permissive/167856740/vga/vga_generator.v
1: b'%Warning-IMPLICIT: data/full_repos/permissive/167856740/vga/vga_generator.v:52: Signal definition not found, creating implicitly: \'screenend\'\n assign screenend = ((v_count == SCREEN - 1) & (h_count == LINE));\n        ^~~~~~~~~\n                   ... Use "/* verilator lint_off IMPLICIT */" and lint_on around source to disable this message.\n%Warning-IMPLICIT: data/full_repos/permissive/167856740/vga/vga_generator.v:55: Signal definition not found, creating implicitly: \'animate\'\n assign animate = ((v_count == VSYNC_ACTIVE - 1) & (h_count == LINE));\n        ^~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/167856740/vga/vga_generator.v:40: Operator ASSIGNW expects 9 bits on the Assign RHS, but Assign RHS\'s COND generates 32 or 10 bits.\n                                                                           : ... In instance vga_generator\n assign y = (v_count >= VSYNC_ACTIVE) ? (VSYNC_ACTIVE - 1): (v_count) >> mode;\n          ^\n%Error: Exiting due to 3 warning(s)\n'
module vga_generator(
    input wire clk,
    input wire pixel_strobe,
    input wire reset,
    input wire mode,
    output wire hsync,
    output wire vsync,
    output wire blanking,
    output wire active,


    output wire [9:0] x,
    output wire [8:0] y
    );


	localparam HSYNC_START = 16;
	localparam HSYNC_END = 16 + 96;
	localparam HSYNC_ACTIVE = 16 + 96 + 48;

	localparam VSYNC_START = 480 + 11;
	localparam VSYNC_END = 480 + 11 + 2;
	localparam VSYNC_ACTIVE = 480;

	localparam LINE = 800;
	localparam SCREEN = 524;


	reg [9:0] h_count;
	reg [9:0] v_count;


	assign hsync = ~((h_count >= HSYNC_START) & (h_count < HSYNC_END));
	assign vsync = ~((v_count >= VSYNC_START) & (v_count < VSYNC_END));


	assign x = (h_count < HSYNC_ACTIVE) ? 0 : (h_count - HSYNC_ACTIVE) >> mode;
	assign y = (v_count >= VSYNC_ACTIVE) ? (VSYNC_ACTIVE - 1): (v_count) >> mode;



    

    assign blanking = ((h_count == 0) & (v_count == VSYNC_ACTIVE + 1));


	assign active = ~((h_count < HSYNC_ACTIVE) | (v_count > VSYNC_ACTIVE - 1));


	assign screenend = ((v_count == SCREEN - 1) & (h_count == LINE));


	assign animate = ((v_count == VSYNC_ACTIVE - 1) & (h_count == LINE));

    initial begin
    	h_count = 0;
        v_count = 0;
    end


	always @ (posedge clk) begin
	   $display("hcount = %d", h_count);
	   $display("vcount = %d", v_count);
	   
		if (reset) begin
			h_count <= 0;
			v_count <= 0;
		end
		if (pixel_strobe) begin
			if (h_count == LINE) begin
				h_count <= 0;
				v_count <= v_count + 1;
			end
			else begin
				h_count <= h_count + 1;
			end
			if (v_count == SCREEN) begin
				v_count <= 0;
			end
		end
	end
endmodule
module vga_generator(
    input wire clk,
    input wire pixel_strobe,
    input wire reset,
    input wire mode,
    output wire hsync,
    output wire vsync,
    output wire blanking,
    output wire active,


    output wire [9:0] x,
    output wire [8:0] y
    );



	localparam HSYNC_START = 16;
	localparam HSYNC_END = 16 + 96;
	localparam HSYNC_ACTIVE = 16 + 96 + 48;

	localparam VSYNC_START = 480 + 11;
	localparam VSYNC_END = 480 + 11 + 2;
	localparam VSYNC_ACTIVE = 480;

	localparam LINE = 800;
	localparam SCREEN = 524;


	reg [9:0] h_count;
	reg [9:0] v_count;


	assign hsync = ~((h_count >= HSYNC_START) & (h_count < HSYNC_END));
	assign vsync = ~((v_count >= VSYNC_START) & (v_count < VSYNC_END));


	assign x = (h_count < HSYNC_ACTIVE) ? 0 : (h_count - HSYNC_ACTIVE) >> mode;
	assign y = (v_count >= VSYNC_ACTIVE) ? (VSYNC_ACTIVE - 1): (v_count) >> mode;



    

    assign blanking = ((h_count == 0) & (v_count == VSYNC_ACTIVE + 1));


	assign active = ~((h_count < HSYNC_ACTIVE) | (v_count > VSYNC_ACTIVE - 1));


	assign screenend = ((v_count == SCREEN - 1) & (h_count == LINE));


	assign animate = ((v_count == VSYNC_ACTIVE - 1) & (h_count == LINE));

    initial begin
    	h_count = 0;
        v_count = 0;
    end


	always @ (posedge clk) begin
	   $display("hcount = %d", h_count);
	   $display("vcount = %d", v_count);
	   
		if (reset) begin
			h_count <= 0;
			v_count <= 0;
		end
		if (pixel_strobe) begin
			if (h_count == LINE) begin
				h_count <= 0;
				v_count <= v_count + 1;
			end
			else begin
				h_count <= h_count + 1;
			end
			if (v_count == SCREEN) begin
				v_count <= 0;
			end
		end
	end
endmodule