data/full_repos/permissive/515245706/milestone3/gameBoardPart2/gameBoardDatapath/gameBoardDatapath.v
data/verilator_xmls/ac0b8560-8ba4-4ece-8bbd-d2f2b68e71dc.xml
module gameBoardDatapath(
	input clk,
    input resetn,
	input [4: 0] moveTo,
	input [4: 0] moveFrom,
	input [63: 0] initialGameBoard,

	output ifWin,
	output reg [63: 0] blockState

);


	wire [15: 0] bitState; 



	

	
	assign bitState[1] = (blockState[3: 0] == 4'b0001);
	assign bitState[2] = (blockState[7: 4] == 4'b0010);
	assign bitState[3] = (blockState[11: 8] == 4'b0011);
	assign bitState[4] = (blockState[15: 12] == 4'b0100);
	assign bitState[5] = (blockState[19: 16] == 4'b0101);
	assign bitState[6] = (blockState[23: 20] == 4'b0110);
	assign bitState[7] = (blockState[27: 24] == 4'b0111);
	assign bitState[8] = (blockState[31: 28] == 4'b1000);
	assign bitState[9] = (blockState[35: 32] == 4'b1001);
	assign bitState[10] = (blockState[39: 36] == 4'b1010);
	assign bitState[11] = (blockState[43: 40] == 4'b1011);
	assign bitState[12] = (blockState[47: 44] == 4'b1100);
	assign bitState[13] = (blockState[51: 48] == 4'b1101);
	assign bitState[14] = (blockState[55: 52] == 4'b1110);
	assign bitState[15] = (blockState[59: 56] == 4'b1111);

	



	always @(posedge clk)
	begin
		if (resetn == 1'b0)
			begin
				blockState = initialGameBoard;


			end
		else
			begin
				if (blockState[(moveFrom-1)*4 +: 4] != 4'b0000)
				begin
					blockState[(moveTo-1)*4 +: 4] <= blockState[(moveFrom-1)*4 +: 4];
					blockState[(moveFrom-1)*4 +: 4] <= 4'b0000;
				end




			end
	end


	

	

	assign ifWin = & (bitState[15: 1]);



	
endmodule
module gameBoardDatapath(
	input clk,
    input resetn,
	input [4: 0] moveTo,
	input [4: 0] moveFrom,
	input [63: 0] initialGameBoard,

	output ifWin,
	output reg [63: 0] blockState

);



	wire [15: 0] bitState; 



	

	
	assign bitState[1] = (blockState[3: 0] == 4'b0001);
	assign bitState[2] = (blockState[7: 4] == 4'b0010);
	assign bitState[3] = (blockState[11: 8] == 4'b0011);
	assign bitState[4] = (blockState[15: 12] == 4'b0100);
	assign bitState[5] = (blockState[19: 16] == 4'b0101);
	assign bitState[6] = (blockState[23: 20] == 4'b0110);
	assign bitState[7] = (blockState[27: 24] == 4'b0111);
	assign bitState[8] = (blockState[31: 28] == 4'b1000);
	assign bitState[9] = (blockState[35: 32] == 4'b1001);
	assign bitState[10] = (blockState[39: 36] == 4'b1010);
	assign bitState[11] = (blockState[43: 40] == 4'b1011);
	assign bitState[12] = (blockState[47: 44] == 4'b1100);
	assign bitState[13] = (blockState[51: 48] == 4'b1101);
	assign bitState[14] = (blockState[55: 52] == 4'b1110);
	assign bitState[15] = (blockState[59: 56] == 4'b1111);

	



	always @(posedge clk)
	begin
		if (resetn == 1'b0)
			begin
				blockState = initialGameBoard;


			end
		else
			begin
				if (blockState[(moveFrom-1)*4 +: 4] != 4'b0000)
				begin
					blockState[(moveTo-1)*4 +: 4] <= blockState[(moveFrom-1)*4 +: 4];
					blockState[(moveFrom-1)*4 +: 4] <= 4'b0000;
				end




			end
	end


	

	

	assign ifWin = & (bitState[15: 1]);



	
endmodule