data/full_repos/permissive/46625639/pong.v
1: b'%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:438: Operator ADD expects 11 bits on the RHS, but RHS\'s VARREF \'speed\' generates 5 bits.\n                                                              : ... In instance pong.gl.bp\n    value_x <= value_x + speed;\n                       ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:442: Operator SUB expects 11 bits on the RHS, but RHS\'s VARREF \'speed\' generates 5 bits.\n                                                              : ... In instance pong.gl.bp\n    value_x <= value_x - speed;\n                       ^\n%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:448: Operator ADD expects 11 bits on the RHS, but RHS\'s VARREF \'speed\' generates 5 bits.\n                                                              : ... In instance pong.gl.bp\n    value_y <= value_y + speed;\n                       ^\n%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:452: Operator SUB expects 11 bits on the RHS, but RHS\'s VARREF \'speed\' generates 5 bits.\n                                                              : ... In instance pong.gl.bp\n    value_y <= value_y - speed;\n                       ^\n%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:388: Operator SUB expects 11 bits on the RHS, but RHS\'s VARREF \'speed\' generates 5 bits.\n                                                              : ... In instance pong.gl.b2\n     value <= value - speed;\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:386: Operator SUB expects 32 or 11 bits on the RHS, but RHS\'s VARREF \'speed\' generates 5 bits.\n                                                              : ... In instance pong.gl.b2\n    if ((value - speed) > 3) begin\n               ^\n%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:395: Operator ADD expects 11 bits on the RHS, but RHS\'s VARREF \'speed\' generates 5 bits.\n                                                              : ... In instance pong.gl.b2\n     value <= value + speed;\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:393: Operator ADD expects 32 or 11 bits on the RHS, but RHS\'s VARREF \'speed\' generates 5 bits.\n                                                              : ... In instance pong.gl.b2\n    if ((value + speed) < (1024 - 128)) begin\n               ^\n%Warning-WIDTH: data/full_repos/permissive/46625639/pong.v:647: Operator ASSIGN expects 2 bits on the Assign RHS, but Assign RHS\'s CONST \'1\'h0\' generates 1 bits.\n                                                              : ... In instance pong.gl\n   count_secs = 1\'b0;\n              ^\n%Error: data/full_repos/permissive/46625639/pong.v:116: Cannot find file containing module: \'pll108MHz\'\n pll108MHz pll(.inclk0(CLOCK_27), .c0(video_clock));\n ^~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/46625639,data/full_repos/permissive/46625639/pll108MHz\n             data/full_repos/permissive/46625639,data/full_repos/permissive/46625639/pll108MHz.v\n             data/full_repos/permissive/46625639,data/full_repos/permissive/46625639/pll108MHz.sv\n             pll108MHz\n             pll108MHz.v\n             pll108MHz.sv\n             obj_dir/pll108MHz\n             obj_dir/pll108MHz.v\n             obj_dir/pll108MHz.sv\n%Error: data/full_repos/permissive/46625639/pong.v:203: Cannot find file containing module: \'keyboard\'\n keyboard keybd(\n ^~~~~~~~\n%Error: data/full_repos/permissive/46625639/pong.v:215: Cannot find file containing module: \'oneshot\'\n oneshot pulser(\n ^~~~~~~\n%Error: Exiting due to 3 error(s), 9 warning(s)\n'
module pong(
	CLOCK_27,
	CLOCK_50,
	KEY,
	SW,
	PS2_CLK,
	PS2_DAT,
	VGA_R,
	VGA_G,
	VGA_B,
	VGA_CLK,
	VGA_BLANK,
	VGA_HS,
	VGA_VS,
	VGA_SYNC,
	TD_RESET,
	LEDR,
	HEX0, HEX1, HEX2, HEX3, HEX4, HEX5, HEX6, HEX7
	);
	
	input CLOCK_27, CLOCK_50;
	input PS2_CLK, PS2_DAT;
	input [3:0] KEY;
	input [17:0] SW;
	output [9:0] VGA_R, VGA_G, VGA_B;
	output VGA_CLK, VGA_BLANK, VGA_HS, VGA_VS, VGA_SYNC;
	output TD_RESET;
	output [17:0] LEDR;
	output [6:0] HEX0, HEX1, HEX2, HEX3, HEX4, HEX5, HEX6, HEX7;
	
	wire video_clock;

	pll108MHz pll(.inclk0(CLOCK_27), .c0(video_clock));
	
	assign VGA_CLK = video_clock;
	assign VGA_SYNC = 0;
	
	wire candraw;
	wire start;
 	
 	wire ball_on;
 	

	wire [10:0] x;
	wire [10:0] y;

	wire [10:0] p1_y;
	wire [10:0] p2_y;

	wire [10:0] ball_x;
	wire [10:0] ball_y;

	wire [3:0] p1_score;
	wire [3:0] p2_score;
	wire [1:0] winner;
	assign LEDR[17] = (winner > 0);
		

	wire [7:0] scan_code;
	wire read, scan_ready;
	reg [7:0] scan_history[1:2];
	always @ (posedge scan_ready)
	begin	
		scan_history[2] <= scan_history[1];
		scan_history[1] <= scan_code;
	end
		
	assign TD_RESET = 1'b1;


	vga v(
		.clk(video_clock),
		.vsync(VGA_VS),
		.hsync(VGA_HS),
		.x(x),
		.y(y),
		.can_draw(candraw),
		.start_of_frame(start)
		);


	graphics g(
		.clk(video_clock),
		.candraw(candraw),
		.x(x),
		.y(y),
		.p1_y(p1_y),
		.p2_y(p2_y),
		.ball_on(ball_on),
		.ball_x(ball_x),
		.ball_y(ball_y),
		.red(VGA_R),
		.green(VGA_G),
		.blue(VGA_B),
		.vga_blank(VGA_BLANK)
		);
	

	gamelogic gl(
		.clock50(CLOCK_50),
		.video_clock(video_clock),
		.start(start),
		.reset(SW[17]),
		.p1_up((scan_history[1] == 'h1d) && (scan_history[2][7:4] != 'hF)),
		.p1_down((scan_history[1] == 'h1b) && (scan_history[2][7:4] != 'hF)),
		.p2_up(~KEY[3]),
		.p2_down(~KEY[0]),
		.p1_y(p1_y),
		.p2_y(p2_y),
		.ball_on(ball_on),
		.ball_x(ball_x),
		.ball_y(ball_y),
		.p1_score(p1_score),
		.p2_score(p2_score),
		.winner(winner)
		);
	


	keyboard keybd(
		.keyboard_clk(PS2_CLK),
		.keyboard_data(PS2_DAT),
		.clock50(CLOCK_50),
		.reset(0),
		.read(read),
		.scan_ready(scan_ready),
		.scan_code(scan_code)
		);
	


	oneshot pulser(
		.pulse_out(read),
		.trigger_in(scan_ready),
		.clk(CLOCK_50)
		);
	

	sevenseg ss(
		.seg0(HEX0),
		.seg1(HEX1),
		.seg2(HEX2),
		.seg3(HEX3),
		.seg4(HEX4),
		.seg5(HEX5),
		.seg6(HEX6),
		.seg7(HEX7),
		.score_p1(p1_score),
		.score_p2(p2_score),
		.winner(winner)
		);
	
endmodule
module pong(
	CLOCK_27,
	CLOCK_50,
	KEY,
	SW,
	PS2_CLK,
	PS2_DAT,
	VGA_R,
	VGA_G,
	VGA_B,
	VGA_CLK,
	VGA_BLANK,
	VGA_HS,
	VGA_VS,
	VGA_SYNC,
	TD_RESET,
	LEDR,
	HEX0, HEX1, HEX2, HEX3, HEX4, HEX5, HEX6, HEX7
	);

	
	input CLOCK_27, CLOCK_50;
	input PS2_CLK, PS2_DAT;
	input [3:0] KEY;
	input [17:0] SW;
	output [9:0] VGA_R, VGA_G, VGA_B;
	output VGA_CLK, VGA_BLANK, VGA_HS, VGA_VS, VGA_SYNC;
	output TD_RESET;
	output [17:0] LEDR;
	output [6:0] HEX0, HEX1, HEX2, HEX3, HEX4, HEX5, HEX6, HEX7;
	
	wire video_clock;

	pll108MHz pll(.inclk0(CLOCK_27), .c0(video_clock));
	
	assign VGA_CLK = video_clock;
	assign VGA_SYNC = 0;
	
	wire candraw;
	wire start;
 	
 	wire ball_on;
 	

	wire [10:0] x;
	wire [10:0] y;

	wire [10:0] p1_y;
	wire [10:0] p2_y;

	wire [10:0] ball_x;
	wire [10:0] ball_y;

	wire [3:0] p1_score;
	wire [3:0] p2_score;
	wire [1:0] winner;
	assign LEDR[17] = (winner > 0);
		

	wire [7:0] scan_code;
	wire read, scan_ready;
	reg [7:0] scan_history[1:2];
	always @ (posedge scan_ready)
	begin	
		scan_history[2] <= scan_history[1];
		scan_history[1] <= scan_code;
	end
		
	assign TD_RESET = 1'b1;


	vga v(
		.clk(video_clock),
		.vsync(VGA_VS),
		.hsync(VGA_HS),
		.x(x),
		.y(y),
		.can_draw(candraw),
		.start_of_frame(start)
		);


	graphics g(
		.clk(video_clock),
		.candraw(candraw),
		.x(x),
		.y(y),
		.p1_y(p1_y),
		.p2_y(p2_y),
		.ball_on(ball_on),
		.ball_x(ball_x),
		.ball_y(ball_y),
		.red(VGA_R),
		.green(VGA_G),
		.blue(VGA_B),
		.vga_blank(VGA_BLANK)
		);
	

	gamelogic gl(
		.clock50(CLOCK_50),
		.video_clock(video_clock),
		.start(start),
		.reset(SW[17]),
		.p1_up((scan_history[1] == 'h1d) && (scan_history[2][7:4] != 'hF)),
		.p1_down((scan_history[1] == 'h1b) && (scan_history[2][7:4] != 'hF)),
		.p2_up(~KEY[3]),
		.p2_down(~KEY[0]),
		.p1_y(p1_y),
		.p2_y(p2_y),
		.ball_on(ball_on),
		.ball_x(ball_x),
		.ball_y(ball_y),
		.p1_score(p1_score),
		.p2_score(p2_score),
		.winner(winner)
		);
	


	keyboard keybd(
		.keyboard_clk(PS2_CLK),
		.keyboard_data(PS2_DAT),
		.clock50(CLOCK_50),
		.reset(0),
		.read(read),
		.scan_ready(scan_ready),
		.scan_code(scan_code)
		);
	


	oneshot pulser(
		.pulse_out(read),
		.trigger_in(scan_ready),
		.clk(CLOCK_50)
		);
	

	sevenseg ss(
		.seg0(HEX0),
		.seg1(HEX1),
		.seg2(HEX2),
		.seg3(HEX3),
		.seg4(HEX4),
		.seg5(HEX5),
		.seg6(HEX6),
		.seg7(HEX7),
		.score_p1(p1_score),
		.score_p2(p2_score),
		.winner(winner)
		);
	
endmodule