data/full_repos/permissive/14349674/gameFiles/PS2_Demo.v
1: b"%Error: data/full_repos/permissive/14349674/gameFiles/PS2_Demo.v:46: syntax error, unexpected continue, expecting IDENTIFIER or do or final\nwire continue;\n     ^~~~~~~~\n%Error: data/full_repos/permissive/14349674/gameFiles/PS2_Demo.v:100: syntax error, unexpected continue, expecting TYPE-IDENTIFIER\nassign continue = (last_data_received == 8'b00100001);\n       ^~~~~~~~\n%Error: data/full_repos/permissive/14349674/gameFiles/PS2_Demo.v:166: syntax error, unexpected continue, expecting TYPE-IDENTIFIER\n .hex_number   (continue),\n                ^~~~~~~~\n%Error: Exiting due to 3 error(s)\n"
module PS2_Demo (

	CLOCK_50,
	KEY,


	PS2_CLK,
	PS2_DAT,
	
	left, right, start
);







input				CLOCK_50;
input		[3:0]	KEY;


inout				PS2_CLK;
inout				PS2_DAT;


wire[6:0]	HEX0;
wire		[6:0]	HEX1;
wire		[6:0]	HEX2;
wire		[6:0]	HEX3;
wire		[6:0]	HEX4;
wire		[6:0]	HEX5;
wire		[6:0]	HEX6;
wire		[6:0]	HEX7;
wire		[6:0] LEDG;


output left;
output right;
output start;
wire continue;
wire reset;




wire		[7:0]	ps2_key_data;
wire				ps2_key_pressed;


reg			[7:0]	last_data_received;
reg [50:0] count = 'd0;
reg [50:0] delay = 'd0;








always @(posedge CLOCK_50)

	begin

		if (count == delay) begin
			if (ps2_key_pressed == 1'b1) begin
					last_data_received <= ps2_key_data;
					delay <= 0;
					count <= 0;
			end else if (ps2_key_data == 8'b11110000) begin
					last_data_received <= 8'h00;
					delay <= 'd100000;
			end
		end else begin
			count <= count + 1;
		end
			
	end


assign HEX7 = 7'h7F;

assign left = (last_data_received == 8'b01101011);
assign right = (last_data_received == 8'b01110100);
assign start = (last_data_received == 8'b00011011);
assign continue = (last_data_received == 8'b00100001);
assign reset = (last_data_received == 8'b00101101);

assign LEDG[1] = left;
assign LEDG[0] = right;



PS2_Controller PS2 (

	.CLOCK_50				(CLOCK_50),
	.reset				(~KEY[0]),


	.PS2_CLK			(PS2_CLK),
 	.PS2_DAT			(PS2_DAT),


	.received_data		(ps2_key_data),
	.received_data_en	(ps2_key_pressed)
);

Hexadecimal_To_Seven_Segment Segment0 (

	.hex_number			(last_data_received[3:0]),




	.seven_seg_display	(HEX0)
);

Hexadecimal_To_Seven_Segment Segment1 (

	.hex_number			(last_data_received[7:4]),




	.seven_seg_display	(HEX1)
);

Hexadecimal_To_Seven_Segment Segment2 (

	.hex_number			(start),




	.seven_seg_display	(HEX2)
);

Hexadecimal_To_Seven_Segment Segment3 (

	.hex_number			(reset),




	.seven_seg_display	(HEX3)
);

Hexadecimal_To_Seven_Segment Segment4 (

	.hex_number			(continue),




	.seven_seg_display	(HEX4)
);

Hexadecimal_To_Seven_Segment Segment5 (

	.hex_number			(left),




	.seven_seg_display	(HEX5)
);

Hexadecimal_To_Seven_Segment Segment6 (

	.hex_number			(right),




	.seven_seg_display	(HEX6)
);



endmodule
module PS2_Demo (

	CLOCK_50,
	KEY,


	PS2_CLK,
	PS2_DAT,
	
	left, right, start
);








input				CLOCK_50;
input		[3:0]	KEY;


inout				PS2_CLK;
inout				PS2_DAT;


wire[6:0]	HEX0;
wire		[6:0]	HEX1;
wire		[6:0]	HEX2;
wire		[6:0]	HEX3;
wire		[6:0]	HEX4;
wire		[6:0]	HEX5;
wire		[6:0]	HEX6;
wire		[6:0]	HEX7;
wire		[6:0] LEDG;


output left;
output right;
output start;
wire continue;
wire reset;




wire		[7:0]	ps2_key_data;
wire				ps2_key_pressed;


reg			[7:0]	last_data_received;
reg [50:0] count = 'd0;
reg [50:0] delay = 'd0;








always @(posedge CLOCK_50)

	begin

		if (count == delay) begin
			if (ps2_key_pressed == 1'b1) begin
					last_data_received <= ps2_key_data;
					delay <= 0;
					count <= 0;
			end else if (ps2_key_data == 8'b11110000) begin
					last_data_received <= 8'h00;
					delay <= 'd100000;
			end
		end else begin
			count <= count + 1;
		end
			
	end


assign HEX7 = 7'h7F;

assign left = (last_data_received == 8'b01101011);
assign right = (last_data_received == 8'b01110100);
assign start = (last_data_received == 8'b00011011);
assign continue = (last_data_received == 8'b00100001);
assign reset = (last_data_received == 8'b00101101);

assign LEDG[1] = left;
assign LEDG[0] = right;



PS2_Controller PS2 (

	.CLOCK_50				(CLOCK_50),
	.reset				(~KEY[0]),


	.PS2_CLK			(PS2_CLK),
 	.PS2_DAT			(PS2_DAT),


	.received_data		(ps2_key_data),
	.received_data_en	(ps2_key_pressed)
);

Hexadecimal_To_Seven_Segment Segment0 (

	.hex_number			(last_data_received[3:0]),




	.seven_seg_display	(HEX0)
);

Hexadecimal_To_Seven_Segment Segment1 (

	.hex_number			(last_data_received[7:4]),




	.seven_seg_display	(HEX1)
);

Hexadecimal_To_Seven_Segment Segment2 (

	.hex_number			(start),




	.seven_seg_display	(HEX2)
);

Hexadecimal_To_Seven_Segment Segment3 (

	.hex_number			(reset),




	.seven_seg_display	(HEX3)
);

Hexadecimal_To_Seven_Segment Segment4 (

	.hex_number			(continue),




	.seven_seg_display	(HEX4)
);

Hexadecimal_To_Seven_Segment Segment5 (

	.hex_number			(left),




	.seven_seg_display	(HEX5)
);

Hexadecimal_To_Seven_Segment Segment6 (

	.hex_number			(right),




	.seven_seg_display	(HEX6)
);



endmodule