data/full_repos/permissive/153414067/ball_movement.v
'utf-8' codec can't decode byte 0xe1 in position 86: invalid continuation byte
1: b'%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:58: Operator SUB expects 7 bits on the RHS, but RHS\'s VARREF \'platform3_width\' generates 5 bits.\n                                                                       : ... In instance ball_movement\n  assign max = 7\'d100 - platform3_width - platform3_width - 3\'d3;    \n                      ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:58: Operator SUB expects 7 bits on the RHS, but RHS\'s VARREF \'platform3_width\' generates 5 bits.\n                                                                       : ... In instance ball_movement\n  assign max = 7\'d100 - platform3_width - platform3_width - 3\'d3;    \n                                        ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:58: Operator SUB expects 7 bits on the RHS, but RHS\'s CONST \'3\'h3\' generates 3 bits.\n                                                                       : ... In instance ball_movement\n  assign max = 7\'d100 - platform3_width - platform3_width - 3\'d3;    \n                                                          ^\n%Error: data/full_repos/permissive/153414067/ball_movement.v:60: Cannot find file containing module: \'random\'\n  random RAND(.clk(clk), .trigger(middle), .max(max), .out(randout));  \n  ^~~~~~\n        ... Looked in:\n             data/full_repos/permissive/153414067,data/full_repos/permissive/153414067/random\n             data/full_repos/permissive/153414067,data/full_repos/permissive/153414067/random.v\n             data/full_repos/permissive/153414067,data/full_repos/permissive/153414067/random.sv\n             random\n             random.v\n             random.sv\n             obj_dir/random\n             obj_dir/random.v\n             obj_dir/random.sv\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:62: Operator ADD expects 7 bits on the RHS, but RHS\'s VARREF \'platform3_width\' generates 5 bits.\n                                                                       : ... In instance ball_movement\n  assign platform4_hor = randout + platform3_width + 3\'d3;     \n                                 ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:62: Operator ADD expects 7 bits on the RHS, but RHS\'s CONST \'3\'h3\' generates 3 bits.\n                                                                       : ... In instance ball_movement\n  assign platform4_hor = randout + platform3_width + 3\'d3;     \n                                                   ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:78: Operator ASSIGNDLY expects 5 bits on the Assign RHS, but Assign RHS\'s CONST \'6\'h14\' generates 6 bits.\n                                                                       : ... In instance ball_movement\n   platform1_width <= 6\'d20;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:82: Operator ASSIGNDLY expects 5 bits on the Assign RHS, but Assign RHS\'s CONST \'6\'h14\' generates 6 bits.\n                                                                       : ... In instance ball_movement\n   platform2_width <= 6\'d20;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:86: Operator ASSIGNDLY expects 5 bits on the Assign RHS, but Assign RHS\'s CONST \'6\'h14\' generates 6 bits.\n                                                                       : ... In instance ball_movement\n   platform3_width <= 6\'d20;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:126: Operator ASSIGNDLY expects 8 bits on the Assign RHS, but Assign RHS\'s VARREF \'platform1_ver\' generates 7 bits.\n                                                                        : ... In instance ball_movement\n     platform0_ver <= platform1_ver;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:128: Operator ASSIGNDLY expects 6 bits on the Assign RHS, but Assign RHS\'s VARREF \'platform1_width\' generates 5 bits.\n                                                                        : ... In instance ball_movement\n     platform0_width <= platform1_width;\n                     ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:130: Operator ASSIGNDLY expects 7 bits on the Assign RHS, but Assign RHS\'s VARREF \'platform2_ver\' generates 6 bits.\n                                                                        : ... In instance ball_movement\n     platform1_ver <= platform2_ver;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:134: Operator ASSIGNDLY expects 6 bits on the Assign RHS, but Assign RHS\'s VARREF \'platform3_ver\' generates 5 bits.\n                                                                        : ... In instance ball_movement\n     platform2_ver <= platform3_ver;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:140: Operator GTE expects 5 bits on the RHS, but RHS\'s CONST \'4\'ha\' generates 4 bits.\n                                                                        : ... In instance ball_movement\n     if (score[1] && score[0] && (platform3_width >= 4\'d10)) platform3_width <= platform3_width - 1\'d1;  \n                                                  ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:142: Operator SUB expects 7 bits on the RHS, but RHS\'s CONST \'2\'h2\' generates 2 bits.\n                                                                        : ... In instance ball_movement\n    else if((ball_ver == {platform0_ver, 2\'b00} - 10\'d21) && (ball_hor >= platform0_hor - platform0_width - 2\'d2) && (ball_hor <= platform0_hor + platform0_width + 2\'d2)) up <= 1;          \n                                                                                                          ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:142: Operator ADD expects 7 bits on the RHS, but RHS\'s CONST \'2\'h2\' generates 2 bits.\n                                                                        : ... In instance ball_movement\n    else if((ball_ver == {platform0_ver, 2\'b00} - 10\'d21) && (ball_hor >= platform0_hor - platform0_width - 2\'d2) && (ball_hor <= platform0_hor + platform0_width + 2\'d2)) up <= 1;          \n                                                                                                                                                                  ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:116: Operator SUB expects 10 bits on the RHS, but RHS\'s CONST \'5\'h15\' generates 5 bits.\n                                                                        : ... In instance ball_movement\n    else if((ball_ver == {platform1_ver, 2\'b00} - 5\'d21) && (ball_hor >= platform1_hor - platform1_width - 2\'d2) && (ball_hor <= platform1_hor + platform1_width + 2\'d2))\n                                                ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:116: Operator SUB expects 7 bits on the RHS, but RHS\'s VARREF \'platform1_width\' generates 5 bits.\n                                                                        : ... In instance ball_movement\n    else if((ball_ver == {platform1_ver, 2\'b00} - 5\'d21) && (ball_hor >= platform1_hor - platform1_width - 2\'d2) && (ball_hor <= platform1_hor + platform1_width + 2\'d2))\n                                                                                       ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:116: Operator SUB expects 7 bits on the RHS, but RHS\'s CONST \'2\'h2\' generates 2 bits.\n                                                                        : ... In instance ball_movement\n    else if((ball_ver == {platform1_ver, 2\'b00} - 5\'d21) && (ball_hor >= platform1_hor - platform1_width - 2\'d2) && (ball_hor <= platform1_hor + platform1_width + 2\'d2))\n                                                                                                         ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:116: Operator ADD expects 7 bits on the RHS, but RHS\'s VARREF \'platform1_width\' generates 5 bits.\n                                                                        : ... In instance ball_movement\n    else if((ball_ver == {platform1_ver, 2\'b00} - 5\'d21) && (ball_hor >= platform1_hor - platform1_width - 2\'d2) && (ball_hor <= platform1_hor + platform1_width + 2\'d2))\n                                                                                                                                               ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:116: Operator ADD expects 7 bits on the RHS, but RHS\'s CONST \'2\'h2\' generates 2 bits.\n                                                                        : ... In instance ball_movement\n    else if((ball_ver == {platform1_ver, 2\'b00} - 5\'d21) && (ball_hor >= platform1_hor - platform1_width - 2\'d2) && (ball_hor <= platform1_hor + platform1_width + 2\'d2))\n                                                                                                                                                                 ^\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:148: Operator LTE expects 10 bits on the LHS, but LHS\'s VARREF \'out_platform_ver\' generates 8 bits.\n                                                                        : ... In instance ball_movement\n    if (out_platform_ver <= 10\'d150) out_platform_ver <= out_platform_ver + 1\'d1;\n                         ^~\n%Warning-WIDTH: data/full_repos/permissive/153414067/ball_movement.v:152: Operator GTE expects 8 bits on the LHS, but LHS\'s VARREF \'platform2_ver\' generates 6 bits.\n                                                                        : ... In instance ball_movement\n    if (platform2_ver >= 8\'d36) platform3_ver <= platform3_ver + 1\'d1;\n                      ^~\n%Error: Exiting due to 1 error(s), 22 warning(s)\n'
module ball_movement(
	input clk,
	input rst,
	
	input right,
	input left,
	input middle,
	
	output reg [9:0] ball_ver,
	output reg [6:0] ball_hor,
	




	
	output reg [7:0] platform0_ver,
	output reg [6:0] platform0_hor,
	output reg [5:0] platform0_width,
	
	output reg [6:0] platform1_ver,
	output reg [6:0] platform1_hor,
	output reg [4:0] platform1_width,
	
	output reg [5:0] platform2_ver,
	output reg [6:0] platform2_hor,
	output reg [4:0] platform2_width,
	
	output reg [4:0] platform3_ver,
	output reg [6:0] platform3_hor,
	output reg [4:0] platform3_width,
	

	
	output reg [7:0] out_platform_ver,
	output reg [6:0] out_platform_hor,
	output reg [5:0] out_platform_width,
	
	output reg over
    );
	 
	 reg [20:0] cntr;
	 reg [1:0] upper_cntr = 2'b0;
	 reg up;
	 
	 reg [19:0] score;
	 
	 wire [6:0] platform4_hor;
	 
	 wire [6:0] randout;
	 wire [6:0] max;
	 assign max = 7'd100 - platform3_width - platform3_width - 3'd3;
	 
	 random RAND(.clk(clk), .trigger(middle), .max(max), .out(randout));
	 
	 assign platform4_hor = randout + platform3_width + 3'd3;
	 
	 always @ (posedge clk)
	 begin
		if (rst) begin
			ball_hor <= 7'd50;
			ball_ver <= 10'd499;
			
			out_platform_width <= 6'd48;
			out_platform_ver <= 8'd130;
			out_platform_hor <= 7'd51;
			
			platform0_width <= 6'd48;
			platform0_ver <= 8'd130;
			platform0_hor <= 7'd51;
			
			platform1_width <= 6'd20;
			platform1_ver <= 7'd94;
			platform1_hor <= 7'd25;
			
			platform2_width <= 6'd20;
			platform2_ver <= 6'd58;
			platform2_hor <= 7'd60;
			
			platform3_width <= 6'd20;
			platform3_ver <= 5'd22;
			platform3_hor <= 7'd30;
			
			over <= 1'b0;
			score <= 20'd0;
			
			cntr <= 21'b0;
			upper_cntr <= 2'b0;
			up <= 1;
		end
		else begin
			cntr <= cntr + 1'b1;
		end
		if (cntr[20] == 1) begin
			cntr <= 21'b0;
			if (up) begin
				if (ball_ver <= {platform0_ver, 2'b00} - 10'd213) begin
					if (upper_cntr == 2'b11) begin
						upper_cntr <= 2'b0;
						up <= 0;
					end
					else upper_cntr <= upper_cntr + 1'b1;
				end
				else if(ball_ver <= {platform0_ver, 2'b00} - 10'd181) ball_ver <= ball_ver - 10'd4;
				else if(ball_ver <= {platform0_ver, 2'b00} - 10'd117) ball_ver <= ball_ver - 10'd8;
				else ball_ver <= ball_ver - 10'd12;
				end
			else begin
				if (ball_ver >= 10'd600) over <= 1;
				else if((ball_ver == {platform1_ver, 2'b00} - 5'd21) && (ball_hor >= platform1_hor - platform1_width - 2'd2) && (ball_hor <= platform1_hor + platform1_width + 2'd2))
				begin
					up <= 1;
					score <= score + 1'd1;
					if (score[19] == 1) over <= 1'b1;
					
					out_platform_ver <= platform0_ver;
					out_platform_hor <= platform0_hor;
					out_platform_width <= platform0_width;
					
					platform0_ver <= platform1_ver;
					platform0_hor <= platform1_hor;
					platform0_width <= platform1_width;
					
					platform1_ver <= platform2_ver;
					platform1_hor <= platform2_hor;
					platform1_width <= platform2_width;
					
					platform2_ver <= platform3_ver;
					platform2_hor <= platform3_hor;
					platform2_width <= platform3_width;
					
					platform3_ver <= 5'd0;
					platform3_hor <= platform4_hor;
					if (score[1] && score[0] && (platform3_width >= 4'd10)) platform3_width <= platform3_width - 1'd1;
				end
				else if((ball_ver == {platform0_ver, 2'b00} - 10'd21) && (ball_hor >= platform0_hor - platform0_width - 2'd2) && (ball_hor <= platform0_hor + platform0_width + 2'd2)) up <= 1;
				else if(ball_ver >= {platform0_ver, 2'b00} - 10'd117) ball_ver <= ball_ver + 10'd12;
				else if(ball_ver >= {platform0_ver, 2'b00} - 10'd181) ball_ver <= ball_ver + 10'd8;
				else ball_ver <= ball_ver + 10'd4;
			end
			if (platform0_ver <= 8'd130) begin
				if (out_platform_ver <= 10'd150) out_platform_ver <= out_platform_ver + 1'd1;
				platform0_ver <= platform0_ver + 1'd1;
				platform1_ver <= platform1_ver + 1'd1;
				platform2_ver <= platform2_ver + 1'd1;
				if (platform2_ver >= 8'd36) platform3_ver <= platform3_ver + 1'd1;
				
			end
			if (left && (ball_hor > 7'd6))
				ball_hor <= ball_hor - 1'b1;
			if (right && (ball_hor < 7'd95))
				ball_hor <= ball_hor + 1'b1;
		end
	 end


endmodule
module ball_movement(
	input clk,
	input rst,
	
	input right,
	input left,
	input middle,
	
	output reg [9:0] ball_ver,
	output reg [6:0] ball_hor,
	




	
	output reg [7:0] platform0_ver,
	output reg [6:0] platform0_hor,
	output reg [5:0] platform0_width,
	
	output reg [6:0] platform1_ver,
	output reg [6:0] platform1_hor,
	output reg [4:0] platform1_width,
	
	output reg [5:0] platform2_ver,
	output reg [6:0] platform2_hor,
	output reg [4:0] platform2_width,
	
	output reg [4:0] platform3_ver,
	output reg [6:0] platform3_hor,
	output reg [4:0] platform3_width,
	

	
	output reg [7:0] out_platform_ver,
	output reg [6:0] out_platform_hor,
	output reg [5:0] out_platform_width,
	
	output reg over
    );

	 
	 reg [20:0] cntr;
	 reg [1:0] upper_cntr = 2'b0;
	 reg up;
	 
	 reg [19:0] score;
	 
	 wire [6:0] platform4_hor;
	 
	 wire [6:0] randout;
	 wire [6:0] max;
	 assign max = 7'd100 - platform3_width - platform3_width - 3'd3;
	 
	 random RAND(.clk(clk), .trigger(middle), .max(max), .out(randout));
	 
	 assign platform4_hor = randout + platform3_width + 3'd3;
	 
	 always @ (posedge clk)
	 begin
		if (rst) begin
			ball_hor <= 7'd50;
			ball_ver <= 10'd499;
			
			out_platform_width <= 6'd48;
			out_platform_ver <= 8'd130;
			out_platform_hor <= 7'd51;
			
			platform0_width <= 6'd48;
			platform0_ver <= 8'd130;
			platform0_hor <= 7'd51;
			
			platform1_width <= 6'd20;
			platform1_ver <= 7'd94;
			platform1_hor <= 7'd25;
			
			platform2_width <= 6'd20;
			platform2_ver <= 6'd58;
			platform2_hor <= 7'd60;
			
			platform3_width <= 6'd20;
			platform3_ver <= 5'd22;
			platform3_hor <= 7'd30;
			
			over <= 1'b0;
			score <= 20'd0;
			
			cntr <= 21'b0;
			upper_cntr <= 2'b0;
			up <= 1;
		end
		else begin
			cntr <= cntr + 1'b1;
		end
		if (cntr[20] == 1) begin
			cntr <= 21'b0;
			if (up) begin
				if (ball_ver <= {platform0_ver, 2'b00} - 10'd213) begin
					if (upper_cntr == 2'b11) begin
						upper_cntr <= 2'b0;
						up <= 0;
					end
					else upper_cntr <= upper_cntr + 1'b1;
				end
				else if(ball_ver <= {platform0_ver, 2'b00} - 10'd181) ball_ver <= ball_ver - 10'd4;
				else if(ball_ver <= {platform0_ver, 2'b00} - 10'd117) ball_ver <= ball_ver - 10'd8;
				else ball_ver <= ball_ver - 10'd12;
				end
			else begin
				if (ball_ver >= 10'd600) over <= 1;
				else if((ball_ver == {platform1_ver, 2'b00} - 5'd21) && (ball_hor >= platform1_hor - platform1_width - 2'd2) && (ball_hor <= platform1_hor + platform1_width + 2'd2))
				begin
					up <= 1;
					score <= score + 1'd1;
					if (score[19] == 1) over <= 1'b1;
					
					out_platform_ver <= platform0_ver;
					out_platform_hor <= platform0_hor;
					out_platform_width <= platform0_width;
					
					platform0_ver <= platform1_ver;
					platform0_hor <= platform1_hor;
					platform0_width <= platform1_width;
					
					platform1_ver <= platform2_ver;
					platform1_hor <= platform2_hor;
					platform1_width <= platform2_width;
					
					platform2_ver <= platform3_ver;
					platform2_hor <= platform3_hor;
					platform2_width <= platform3_width;
					
					platform3_ver <= 5'd0;
					platform3_hor <= platform4_hor;
					if (score[1] && score[0] && (platform3_width >= 4'd10)) platform3_width <= platform3_width - 1'd1;
				end
				else if((ball_ver == {platform0_ver, 2'b00} - 10'd21) && (ball_hor >= platform0_hor - platform0_width - 2'd2) && (ball_hor <= platform0_hor + platform0_width + 2'd2)) up <= 1;
				else if(ball_ver >= {platform0_ver, 2'b00} - 10'd117) ball_ver <= ball_ver + 10'd12;
				else if(ball_ver >= {platform0_ver, 2'b00} - 10'd181) ball_ver <= ball_ver + 10'd8;
				else ball_ver <= ball_ver + 10'd4;
			end
			if (platform0_ver <= 8'd130) begin
				if (out_platform_ver <= 10'd150) out_platform_ver <= out_platform_ver + 1'd1;
				platform0_ver <= platform0_ver + 1'd1;
				platform1_ver <= platform1_ver + 1'd1;
				platform2_ver <= platform2_ver + 1'd1;
				if (platform2_ver >= 8'd36) platform3_ver <= platform3_ver + 1'd1;
				
			end
			if (left && (ball_hor > 7'd6))
				ball_hor <= ball_hor - 1'b1;
			if (right && (ball_hor < 7'd95))
				ball_hor <= ball_hor + 1'b1;
		end
	 end


endmodule