data/full_repos/permissive/118252043/rtl/neighbours.v
1: b"%Error: data/full_repos/permissive/118252043/rtl/neighbours.v:22: Can't find definition of variable: 'upper_cell'\n                   upper_cell <= {MAX_j,i_x};\n                   ^~~~~~~~~~\n%Error: data/full_repos/permissive/118252043/rtl/neighbours.v:23: Can't find definition of variable: 'upper_right_cell'\n                                                                : ... Suggested alternative: 'upper_cell'\n                   upper_right_cell <= {MAX_j,i_x + 1};\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/118252043/rtl/neighbours.v:24: Can't find definition of variable: 'right_cell'\n                                                                : ... Suggested alternative: 'upper_right_cell'\n                   right_cell <= {i_y,i_x + 1};\n                   ^~~~~~~~~~\n%Error: data/full_repos/permissive/118252043/rtl/neighbours.v:25: Can't find definition of variable: 'lower_right_cell'\n                                                                : ... Suggested alternative: 'upper_right_cell'\n                   lower_right_cell <= {i_y + 1,i_x + 1};\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/118252043/rtl/neighbours.v:26: Can't find definition of variable: 'lower_cell'\n                                                                : ... Suggested alternative: 'upper_cell'\n                   lower_cell <= {i_y + 1,i_x};\n                   ^~~~~~~~~~\n%Error: data/full_repos/permissive/118252043/rtl/neighbours.v:27: Can't find definition of variable: 'lower_left_cell'\n                                                                : ... Suggested alternative: 'lower_right_cell'\n                   lower_left_cell <= {i_y + 1,MAX_i};\n                   ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/118252043/rtl/neighbours.v:28: Can't find definition of variable: 'left_cell'\n                   left_cell <= {i_y,MAX_i};\n                   ^~~~~~~~~\n%Error: data/full_repos/permissive/118252043/rtl/neighbours.v:29: Can't find definition of variable: 'upper_left_cell'\n                                                                : ... Suggested alternative: 'lower_left_cell'\n                   upper_left_cell <= {MAX_j,MAX_i};\n                   ^~~~~~~~~~~~~~~\n%Error: Exiting due to 8 error(s)\n"
module neighbours(
                  input wire [9:0] i_x,
	                input wire [9:0] i_y,
	                output reg [3:0] o_sum
		              );

   parameter MAX_i = 14;
   parameter MAX_j = 19;

   always @(*) begin

	    if ((i_y == 0) || (i_y == MAX_j) || (i_x == 0) || (i_x == MAX_i))
	      begin

	         if (i_y == 0)
	           begin

		            if (i_x == 0)
		              begin
		                 upper_cell <= {MAX_j,i_x};
		                 upper_right_cell <= {MAX_j,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {i_y + 1,i_x + 1};
		                 lower_cell <= {i_y + 1,i_x};
		                 lower_left_cell <= {i_y + 1,MAX_i};
		                 left_cell <= {i_y,MAX_i};
		                 upper_left_cell <= {MAX_j,MAX_i};
		              end

		            else if (i_x == MAX_i)
		              begin
		                 upper_cell <= {MAX_j,i_x};
		                 upper_right_cell <= {MAX_j,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {i_y + 1,i_x + 1};
		                 lower_cell <= {i_y + 1,i_x};
		                 lower_left_cell <= {i_y + 1,MAX_i};
		                 left_cell <= {i_y,MAX_i};
		                 upper_left_cell <= {MAX_j,MAX_i};
		              end

		            else
		              begin
		                 upper_cell <= {MAX_j,i_x};
		                 upper_right_cell <= {MAX_j,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {i_y + 1,i_x + 1};
		                 lower_cell <= {i_y + 1,i_x};
		                 lower_left_cell <= {i_y + 1,i_x - 1};
		                 left_cell <= {i_y,i_x - 1};
		                 upper_left_cell <= {MAX_j,i_x - 1};
		              end
	           end

	         else if (i_x == MAX_i)
	           begin

		            if (i_y == MAX_j)
		              begin
		                 upper_cell <= {i_y - 1,i_x};
		                 upper_right_cell <= {i_y + 1,0};
		                 right_cell <= {i_y,0};
		                 lower_right_cell <= {0,0};
		                 lower_cell <= {0,MAX_i};
		                 lower_left_cell <= {0,i_x - 1};
		                 left_cell <= {i_y,MAX_i};
		                 upper_left_cell <= {i_y,MAX_i};
		              end

		            else
		              begin
		                 upper_cell <= {i_y - 1,i_x};
		                 upper_right_cell <= {i_y - 1,0};
		                 right_cell <= {i_y,0};
		                 lower_right_cell <= {i_y + 1,0};
		                 lower_cell <= {i_y + 1,i_x};
		                 lower_left_cell <= {i_y + 1,i_x - 1};
		                 left_cell <= {i_y,i_x - 1};
		                 upper_left_cell <= {i_y - 1,i_x - 1};
		              end
	           end

	         else if (i_y == MAX_j)
	           begin

		            if (i_x == 0)
		              begin
		                 upper_cell <= {i_y - 1,i_x};
		                 upper_right_cell <= {i_y + 1,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {i_y,i_x + 1};
		                 lower_cell <= {0,i_x};
		                 lower_left_cell <= {0,i_x - 1};
		                 left_cell <= {i_y,MAX_i};
		                 upper_left_cell <= {i_y - 1,MAX_i};
		              end

		            else
		              begin
		                 upper_cell <= {i_y - 1,i_x};
		                 upper_right_cell <= {i_y - 1,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {0,i_x + 1};
		                 lower_cell <= {0,i_x};
		                 lower_left_cell <= {0,i_x - 1};
		                 left_cell <= {i_y,i_x - 1};
		                 upper_left_cell <= {i_y - 1,i_x - 1};
		              end
	           end

	         else
	           begin
		            upper_cell <= {i_y - 1,i_x};
		            upper_right_cell <= {i_y - 1,i_x + 1};
		            right_cell <= {i_y,i_x + 1};
		            lower_right_cell <= {i_y + 1,i_x + 1};
		            lower_cell <= {i_y + 1,i_x};
		            lower_left_cell <= {i_y + 1,MAX_i};
		            left_cell <= {i_y,MAX_i};
		            upper_left_cell <= {i_y - 1,MAX_i};
	           end
	      end

	    else
	      begin
	         upper_cell <= {i_y - 1,i_x};
	         upper_right_cell <= {i_y - 1,i_x + 1};
	         right_cell <= {i_y,i_x + 1};
	         lower_right_cell <= {i_y + 1,i_x + 1};
	         lower_cell <= {i_y + 1,i_x};
	         lower_left_cell <= {i_y + 1,i_x - 1};
	         left_cell <= {i_y,i_x - 1};
	         upper_left_cell <= {i_y - 1,i_x - 1};
	      end
   end

   wire [3:0] sum_neighbours;
   assign sum_neighbours = upper_cell + upper_right_cell + right_cell + lower_right_cell + lower_cell + lower_left_cell + left_cell + upper_left_cell;

endmodule
module neighbours(
                  input wire [9:0] i_x,
	                input wire [9:0] i_y,
	                output reg [3:0] o_sum
		              );


   parameter MAX_i = 14;
   parameter MAX_j = 19;

   always @(*) begin

	    if ((i_y == 0) || (i_y == MAX_j) || (i_x == 0) || (i_x == MAX_i))
	      begin

	         if (i_y == 0)
	           begin

		            if (i_x == 0)
		              begin
		                 upper_cell <= {MAX_j,i_x};
		                 upper_right_cell <= {MAX_j,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {i_y + 1,i_x + 1};
		                 lower_cell <= {i_y + 1,i_x};
		                 lower_left_cell <= {i_y + 1,MAX_i};
		                 left_cell <= {i_y,MAX_i};
		                 upper_left_cell <= {MAX_j,MAX_i};
		              end

		            else if (i_x == MAX_i)
		              begin
		                 upper_cell <= {MAX_j,i_x};
		                 upper_right_cell <= {MAX_j,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {i_y + 1,i_x + 1};
		                 lower_cell <= {i_y + 1,i_x};
		                 lower_left_cell <= {i_y + 1,MAX_i};
		                 left_cell <= {i_y,MAX_i};
		                 upper_left_cell <= {MAX_j,MAX_i};
		              end

		            else
		              begin
		                 upper_cell <= {MAX_j,i_x};
		                 upper_right_cell <= {MAX_j,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {i_y + 1,i_x + 1};
		                 lower_cell <= {i_y + 1,i_x};
		                 lower_left_cell <= {i_y + 1,i_x - 1};
		                 left_cell <= {i_y,i_x - 1};
		                 upper_left_cell <= {MAX_j,i_x - 1};
		              end
	           end

	         else if (i_x == MAX_i)
	           begin

		            if (i_y == MAX_j)
		              begin
		                 upper_cell <= {i_y - 1,i_x};
		                 upper_right_cell <= {i_y + 1,0};
		                 right_cell <= {i_y,0};
		                 lower_right_cell <= {0,0};
		                 lower_cell <= {0,MAX_i};
		                 lower_left_cell <= {0,i_x - 1};
		                 left_cell <= {i_y,MAX_i};
		                 upper_left_cell <= {i_y,MAX_i};
		              end

		            else
		              begin
		                 upper_cell <= {i_y - 1,i_x};
		                 upper_right_cell <= {i_y - 1,0};
		                 right_cell <= {i_y,0};
		                 lower_right_cell <= {i_y + 1,0};
		                 lower_cell <= {i_y + 1,i_x};
		                 lower_left_cell <= {i_y + 1,i_x - 1};
		                 left_cell <= {i_y,i_x - 1};
		                 upper_left_cell <= {i_y - 1,i_x - 1};
		              end
	           end

	         else if (i_y == MAX_j)
	           begin

		            if (i_x == 0)
		              begin
		                 upper_cell <= {i_y - 1,i_x};
		                 upper_right_cell <= {i_y + 1,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {i_y,i_x + 1};
		                 lower_cell <= {0,i_x};
		                 lower_left_cell <= {0,i_x - 1};
		                 left_cell <= {i_y,MAX_i};
		                 upper_left_cell <= {i_y - 1,MAX_i};
		              end

		            else
		              begin
		                 upper_cell <= {i_y - 1,i_x};
		                 upper_right_cell <= {i_y - 1,i_x + 1};
		                 right_cell <= {i_y,i_x + 1};
		                 lower_right_cell <= {0,i_x + 1};
		                 lower_cell <= {0,i_x};
		                 lower_left_cell <= {0,i_x - 1};
		                 left_cell <= {i_y,i_x - 1};
		                 upper_left_cell <= {i_y - 1,i_x - 1};
		              end
	           end

	         else
	           begin
		            upper_cell <= {i_y - 1,i_x};
		            upper_right_cell <= {i_y - 1,i_x + 1};
		            right_cell <= {i_y,i_x + 1};
		            lower_right_cell <= {i_y + 1,i_x + 1};
		            lower_cell <= {i_y + 1,i_x};
		            lower_left_cell <= {i_y + 1,MAX_i};
		            left_cell <= {i_y,MAX_i};
		            upper_left_cell <= {i_y - 1,MAX_i};
	           end
	      end

	    else
	      begin
	         upper_cell <= {i_y - 1,i_x};
	         upper_right_cell <= {i_y - 1,i_x + 1};
	         right_cell <= {i_y,i_x + 1};
	         lower_right_cell <= {i_y + 1,i_x + 1};
	         lower_cell <= {i_y + 1,i_x};
	         lower_left_cell <= {i_y + 1,i_x - 1};
	         left_cell <= {i_y,i_x - 1};
	         upper_left_cell <= {i_y - 1,i_x - 1};
	      end
   end

   wire [3:0] sum_neighbours;
   assign sum_neighbours = upper_cell + upper_right_cell + right_cell + lower_right_cell + lower_cell + lower_left_cell + left_cell + upper_left_cell;

endmodule