data/full_repos/permissive/502744275/ball.sv
1: b'%Warning-WIDTH: data/full_repos/permissive/502744275/ball.sv:61: Logical Operator IF expects 1 bit on the If, but If\'s VARREF \'keycode0\' generates 8 bits.\n                                                               : ... In instance ball\n    if (keycode0) begin\n    ^~\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error-PROCASSWIRE: data/full_repos/permissive/502744275/ball.sv:55: Procedural assignment to wire, perhaps intended var (IEEE 1800-2017 6.5): \'Ball_X\'\n                                                                   : ... In instance ball\n   Ball_X <= Ball_X_Center;\n   ^~~~~~\n%Error-PROCASSWIRE: data/full_repos/permissive/502744275/ball.sv:56: Procedural assignment to wire, perhaps intended var (IEEE 1800-2017 6.5): \'Ball_Y\'\n                                                                   : ... In instance ball\n   Ball_Y <= Ball_Y_Center;\n   ^~~~~~\n%Error-PROCASSWIRE: data/full_repos/permissive/502744275/ball.sv:57: Procedural assignment to wire, perhaps intended var (IEEE 1800-2017 6.5): \'Start\'\n                                                                   : ... In instance ball\n   Start <= 0;\n   ^~~~~\n%Error-PROCASSWIRE: data/full_repos/permissive/502744275/ball.sv:62: Procedural assignment to wire, perhaps intended var (IEEE 1800-2017 6.5): \'Start\'\n                                                                   : ... In instance ball\n     Start <= 1;\n     ^~~~~\n%Error-PROCASSWIRE: data/full_repos/permissive/502744275/ball.sv:65: Procedural assignment to wire, perhaps intended var (IEEE 1800-2017 6.5): \'Start\'\n                                                                   : ... In instance ball\n     Start <= 0;\n     ^~~~~\n%Error-PROCASSWIRE: data/full_repos/permissive/502744275/ball.sv:69: Procedural assignment to wire, perhaps intended var (IEEE 1800-2017 6.5): \'Start\'\n                                                                   : ... In instance ball\n    Start <= 1;\n    ^~~~~\n%Error-PROCASSWIRE: data/full_repos/permissive/502744275/ball.sv:154: Procedural assignment to wire, perhaps intended var (IEEE 1800-2017 6.5): \'Ball_X\'\n                                                                    : ... In instance ball\n     Ball_X <= Ball_X + Ball_X_Vel;\n     ^~~~~~\n%Error-PROCASSWIRE: data/full_repos/permissive/502744275/ball.sv:157: Procedural assignment to wire, perhaps intended var (IEEE 1800-2017 6.5): \'Ball_Y\'\n                                                                    : ... In instance ball\n     Ball_Y <= Ball_Y + Ball_Y_Vel;\n     ^~~~~~\n%Error: Exiting due to 8 error(s), 1 warning(s)\n'
module ball (
	input Reset, frame_clk,
	input [7:0] keycode0,
	input [7:0] keycode1,
	input [7:0] keycode2,
	output Start,
	output [9:0] Ball_X,
	output [9:0] Ball_Y
);

	parameter [9:0] Ball_X_Center = 40;
	parameter [9:0] Ball_Y_Center = 250;
	parameter [9:0] Ball_X_Min = 10;
	parameter [9:0] Ball_X_Max = 560;
	parameter [9:0] Ball_Y_Min = 10;
	parameter [9:0] Ball_Y_Max = 250;

	logic On_Ground;
	logic Is_Jump;
	logic [9:0] Jump_Counter;

	logic [9:0] Ball_X_Int, Ball_Y_Int;
	logic [9:0] Ball_X_Vel, Ball_Y_Vel;

	logic [9:0] Ball_Y_Jump_Vel;



	always_ff @(posedge Reset or posedge frame_clk) begin
		if (Reset) begin
			Ball_X_Vel <= 0;
			Ball_Y_Vel <= 0; 
			Ball_X_Int <= 0;
			Ball_Y_Int <= 0;
			Ball_X <= Ball_X_Center;
			Ball_Y <= Ball_Y_Center;
			Start <= 0;
		end
		else begin
			if (!Start) begin
				if (keycode0) begin
					Start <= 1;
				end
				else begin
					Start <= 0;
				end
			end
			else begin
				Start <= 1;
			end

			case (keycode2)
				8'h04 : begin
					Ball_X_Vel <= -5;
				end
				8'h07 : begin
					Ball_X_Vel <= 5;
				end
				8'h16 : begin
					Ball_Y_Vel <= 5;
				end
				8'h1A : begin
					Ball_Y_Vel <= -5;
				end
				default: begin
					Ball_X_Vel <= 0;
					if (Ball_Y >= Ball_Y_Max) begin
						Ball_Y_Vel <= 0;
					end
					else begin
						Ball_Y_Vel <= 5;
					end
				end
			endcase
			case (keycode1)
				8'h04 : begin
					if (keycode2 != 8'h04 && keycode2 != 8'h07) begin
						Ball_X_Vel <= -5;
					end
				end
				8'h07 : begin
				if (keycode1 != 8'h04 && keycode1 != 8'h07) begin
						Ball_X_Vel <= 5;
					end
				end
				8'h16 : begin
					Ball_Y_Vel <= 5;
				end
				8'h1A : begin
					Ball_Y_Vel <= -5;
				end
				default: begin
					Ball_X_Vel <= 0;
					if (Ball_Y >= Ball_Y_Max) begin
						Ball_Y_Vel <= 0;
					end
					else begin
						Ball_Y_Vel <= 5;
					end
				end
			endcase
			case (keycode0)
				8'h04 : begin
					if ((keycode1 != 8'h04 && keycode1 != 8'h07) && (keycode2 != 8'h04 && keycode2 != 8'h07)) begin
						Ball_X_Vel <= -5;
					end
				end
				8'h07 : begin
					if ((keycode1 != 8'h04 && keycode1 != 8'h07) && (keycode2 != 8'h04 && keycode2 != 8'h07)) begin
						Ball_X_Vel <= 5;
					end
				end
				8'h16 : begin
					Ball_Y_Vel <= 5;
				end
				8'h1A : begin
					Ball_Y_Vel <= -5;
				end
				default: begin
					Ball_X_Vel <= 0;
					if (Ball_Y >= Ball_Y_Max) begin
						Ball_Y_Vel <= 0;
					end
					else begin
						Ball_Y_Vel <= 5;
					end
				end
			endcase

			Ball_X_Int <= Ball_X + Ball_X_Vel;
			Ball_Y_Int <= Ball_Y + Ball_Y_Vel;

			if (Ball_X_Int >= Ball_X_Min && Ball_X_Int <= Ball_X_Max) begin
					Ball_X <= Ball_X + Ball_X_Vel;
			end
			if (Ball_Y_Int >= Ball_Y_Min && Ball_Y_Int <= Ball_Y_Max) begin
					Ball_Y <= Ball_Y + Ball_Y_Vel;
			end

		end
	end
endmodule
module ball (
	input Reset, frame_clk,
	input [7:0] keycode0,
	input [7:0] keycode1,
	input [7:0] keycode2,
	output Start,
	output [9:0] Ball_X,
	output [9:0] Ball_Y
);


	parameter [9:0] Ball_X_Center = 40;
	parameter [9:0] Ball_Y_Center = 250;
	parameter [9:0] Ball_X_Min = 10;
	parameter [9:0] Ball_X_Max = 560;
	parameter [9:0] Ball_Y_Min = 10;
	parameter [9:0] Ball_Y_Max = 250;

	logic On_Ground;
	logic Is_Jump;
	logic [9:0] Jump_Counter;

	logic [9:0] Ball_X_Int, Ball_Y_Int;
	logic [9:0] Ball_X_Vel, Ball_Y_Vel;

	logic [9:0] Ball_Y_Jump_Vel;



	always_ff @(posedge Reset or posedge frame_clk) begin
		if (Reset) begin
			Ball_X_Vel <= 0;
			Ball_Y_Vel <= 0; 
			Ball_X_Int <= 0;
			Ball_Y_Int <= 0;
			Ball_X <= Ball_X_Center;
			Ball_Y <= Ball_Y_Center;
			Start <= 0;
		end
		else begin
			if (!Start) begin
				if (keycode0) begin
					Start <= 1;
				end
				else begin
					Start <= 0;
				end
			end
			else begin
				Start <= 1;
			end

			case (keycode2)
				8'h04 : begin
					Ball_X_Vel <= -5;
				end
				8'h07 : begin
					Ball_X_Vel <= 5;
				end
				8'h16 : begin
					Ball_Y_Vel <= 5;
				end
				8'h1A : begin
					Ball_Y_Vel <= -5;
				end
				default: begin
					Ball_X_Vel <= 0;
					if (Ball_Y >= Ball_Y_Max) begin
						Ball_Y_Vel <= 0;
					end
					else begin
						Ball_Y_Vel <= 5;
					end
				end
			endcase
			case (keycode1)
				8'h04 : begin
					if (keycode2 != 8'h04 && keycode2 != 8'h07) begin
						Ball_X_Vel <= -5;
					end
				end
				8'h07 : begin
				if (keycode1 != 8'h04 && keycode1 != 8'h07) begin
						Ball_X_Vel <= 5;
					end
				end
				8'h16 : begin
					Ball_Y_Vel <= 5;
				end
				8'h1A : begin
					Ball_Y_Vel <= -5;
				end
				default: begin
					Ball_X_Vel <= 0;
					if (Ball_Y >= Ball_Y_Max) begin
						Ball_Y_Vel <= 0;
					end
					else begin
						Ball_Y_Vel <= 5;
					end
				end
			endcase
			case (keycode0)
				8'h04 : begin
					if ((keycode1 != 8'h04 && keycode1 != 8'h07) && (keycode2 != 8'h04 && keycode2 != 8'h07)) begin
						Ball_X_Vel <= -5;
					end
				end
				8'h07 : begin
					if ((keycode1 != 8'h04 && keycode1 != 8'h07) && (keycode2 != 8'h04 && keycode2 != 8'h07)) begin
						Ball_X_Vel <= 5;
					end
				end
				8'h16 : begin
					Ball_Y_Vel <= 5;
				end
				8'h1A : begin
					Ball_Y_Vel <= -5;
				end
				default: begin
					Ball_X_Vel <= 0;
					if (Ball_Y >= Ball_Y_Max) begin
						Ball_Y_Vel <= 0;
					end
					else begin
						Ball_Y_Vel <= 5;
					end
				end
			endcase

			Ball_X_Int <= Ball_X + Ball_X_Vel;
			Ball_Y_Int <= Ball_Y + Ball_Y_Vel;

			if (Ball_X_Int >= Ball_X_Min && Ball_X_Int <= Ball_X_Max) begin
					Ball_X <= Ball_X + Ball_X_Vel;
			end
			if (Ball_Y_Int >= Ball_Y_Min && Ball_Y_Int <= Ball_Y_Max) begin
					Ball_Y <= Ball_Y + Ball_Y_Vel;
			end

		end
	end
endmodule