data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v
 line:148: before: "9_"
1: b"%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:148: syntax error, unexpected INTEGER NUMBER, expecting IDENTIFIER\n     9_CODE = 8'h46,\n     ^~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:171: syntax error, unexpected INTEGER NUMBER, expecting IDENTIFIER or '=' or do or final\n    reg 0_press, 1_press, 2_press, 3_press, 4_press, 5_press, 6_press, 7_press, 8_press, 9_press;\n        ^~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:179: syntax error, unexpected INTEGER NUMBER, expecting IDENTIFIER or '=' or do or final\n  reg 0_lock, 1_lock, 2_lock, 3_lock, 3_lock, 4_lock, 5_lock, 6_lock, 7_lock, 8_lock, 9_lock;\n      ^~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:186: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign zero = 0_press && ~(0_lock && PULSE_OR_HOLD);\n                    ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:187: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign one = 1_press && ~(1_lock && PULSE_OR_HOLD);\n                   ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:188: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign two = 2_press && ~(2_lock && PULSE_OR_HOLD);\n                   ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:189: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign three = 3_press && ~(3_lock && PULSE_OR_HOLD);\n                     ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:190: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign four = 4_press && ~(4_lock && PULSE_OR_HOLD);\n                    ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:191: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign five = 5_press && ~(5_lock && PULSE_OR_HOLD);\n                    ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:192: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign six = 6_press && ~(6_lock && PULSE_OR_HOLD);\n                   ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:193: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign seven = 7_press && ~(7_lock && PULSE_OR_HOLD);\n                     ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:194: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign eight = 8_press && ~(8_lock && PULSE_OR_HOLD);\n                     ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:195: syntax error, unexpected IDENTIFIER, expecting ',' or ';'\n    assign nine = 9_press && ~(9_lock && PULSE_OR_HOLD);\n                    ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:224: syntax error, unexpected IDENTIFIER\n    0_lock <= 0_press;\n      ^~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:246: syntax error, unexpected IDENTIFIER\n    0_press <= 1'b0;\n      ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:264: syntax error, unexpected IDENTIFIER\n    0_lock <= 1'b0;\n      ^~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:288: syntax error, unexpected IDENTIFIER\n            ZERO_CODE: 0_press <= curr_state == MAKE;\n                         ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:289: syntax error, unexpected IDENTIFIER\n      ONE_CODE: 1_press <= curr_state == MAKE;\n                  ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:290: syntax error, unexpected IDENTIFIER\n      TWO_CODE: 2_press <= curr_state == MAKE;\n                  ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:291: syntax error, unexpected IDENTIFIER\n      THREE_CODE: 3_press <= curr_state == MAKE;\n                    ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:292: syntax error, unexpected IDENTIFIER\n      FOUR_CODE: 4_press <= curr_state == MAKE;\n                   ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:293: syntax error, unexpected IDENTIFIER\n      FIVE_CODE: 5_press <= curr_state == MAKE;\n                   ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:294: syntax error, unexpected IDENTIFIER\n      SIX_CODE: 6_press <= curr_state == MAKE;\n                  ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:295: syntax error, unexpected IDENTIFIER\n      SEVEN_CODE: 7_press <= curr_state == MAKE;\n                    ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:296: syntax error, unexpected IDENTIFIER\n      EIGHT_CODE: 8_press <= curr_state == MAKE;\n                    ^~~~~\n%Error: data/full_repos/permissive/155759747/PS2_Keyboard_Controller.v:297: syntax error, unexpected IDENTIFIER\n      NINE_CODE: 9_press <= curr_state == MAKE;\n                   ^~~~~\n%Error: Exiting due to 26 error(s)\n"
module keyboard_tracker #(parameter PULSE_OR_HOLD = 0) (
    input clock,
	 input reset,
	 
	 inout PS2_CLK,
	 inout PS2_DAT,
	 
	 output zero, one, two, three, four, five, six, seven, eight, nine,
	 output left_bracket, right_bracker, minus,
	 output space, enter
	 );
	 

	 wire byte_received;

	 wire [7:0] newest_byte;
	 	 
	 localparam

	            MAKE            = 2'b00,
	            BREAK           = 2'b01,
					SECONDARY_MAKE  = 2'b10,
					SECONDARY_BREAK = 2'b11,
					




					
										

					9_CODE = 8'h46,
					8_CODE = 8'h3E,
					7_CODE = 8'h3D,
					6_CODE = 8'h36,
					5_CODE = 8'h2E,
					4_CODE = 8'h25,
					3_CODE = 8'h26,
					2_CODE = 8'h1E,
					1_CODE = 8'h16,
					0_CODE = 8'h45,

					SPACE_CODE = 8'h29,
					MINUS_CODE = 8'h4E,
					LEFT_BRACKET_CODE = 8'h54,
					RIGHT_BRACKET_CODE = 8'h5B,
					ENTER_CODE = 8'h5a;


    reg [1:0] curr_state;
	 



    reg 0_press, 1_press, 2_press, 3_press, 4_press, 5_press, 6_press, 7_press, 8_press, 9_press;
	 reg left_bracket_press, right_bracket_press, minus_press;
	 reg space_press, enter_press;
	 




	 reg 0_lock, 1_lock, 2_lock, 3_lock, 3_lock, 4_lock, 5_lock, 6_lock, 7_lock, 8_lock, 9_lock;
	 reg left_bracket_lock, right_bracket_lock, minus_lock;
	 reg space_lock, enter_lock;
	 



    assign zero = 0_press && ~(0_lock && PULSE_OR_HOLD);
    assign one = 1_press && ~(1_lock && PULSE_OR_HOLD);
    assign two = 2_press && ~(2_lock && PULSE_OR_HOLD);
    assign three = 3_press && ~(3_lock && PULSE_OR_HOLD);
    assign four = 4_press && ~(4_lock && PULSE_OR_HOLD);
    assign five = 5_press && ~(5_lock && PULSE_OR_HOLD);
    assign six = 6_press && ~(6_lock && PULSE_OR_HOLD);
    assign seven = 7_press && ~(7_lock && PULSE_OR_HOLD);
    assign eight = 8_press && ~(8_lock && PULSE_OR_HOLD);
    assign nine = 9_press && ~(9_lock && PULSE_OR_HOLD);

    assign left_bracket  = left_bracket_press && ~(left_bracket_lock && PULSE_OR_HOLD);
    assign right_bracket = right_bracket_press && ~(right_bracket_lock && PULSE_OR_HOLD);
    assign minus  = minus_press && ~(minus_lock && PULSE_OR_HOLD);

    assign space = space_press && ~(space_lock && PULSE_OR_HOLD);
    assign enter = enter_press && ~(enter_lock && PULSE_OR_HOLD);
	 

	 PS2_Controller #(.INITIALIZE_MOUSE(0)) core_driver(
	     .CLOCK_50(clock),
		  .reset(~reset),
		  .PS2_CLK(PS2_CLK),
		  .PS2_DAT(PS2_DAT),
		  .received_data(newest_byte),
		  .received_data_en(byte_received)
		  );
		  
    always @(posedge clock) begin


		  curr_state <= MAKE;
		  





		  0_lock <= 0_press;
		  1_lock <= 1_press;
		  2_lock <= 2_press;
		  3_lock <= 3_press;
		  4_lock <= 4_press;
		  5_lock <= 5_press;
		  6_lock <= 6_press;
		  7_lock <= 7_press;
		  8_lock <= 8_press;
		  9_lock <= 9_press;
		  
		  left_bracket_lock <= left_bracket_press;
		  right_bracket_lock <= right_bracket_press;
		  minus_lock <= minus_press;
		  
		  space_lock <= space_press;
		  enter_lock <= enter_press;
		  
	     if (~reset) begin
		      curr_state <= MAKE;
				

				0_press <= 1'b0;
				1_press <= 1'b0;
				2_press <= 1'b0;
				3_press <= 1'b0;
				4_press <= 1'b0;
				5_press <= 1'b0;
				6_press <= 1'b0;
				7_press <= 1'b0;
				8_press <= 1'b0;
				9_press <= 1'b0;

				left_bracket_press  <= 1'b0;
				right_bracket_press <= 1'b0;
				minus_press    <= 1'b0;
				
				space_press <= 1'b0;
				enter_press <= 1'b0;
				
				0_lock <= 1'b0;
				1_lock <= 1'b0;
				2_lock <= 1'b0;
				3_lock <= 1'b0;
				4_lock <= 1'b0;
				5_lock <= 1'b0;
				6_lock <= 1'b0;
				7_lock <= 1'b0;
				8_lock <= 1'b0;
				9_lock <= 1'b0;

				left_brakcet_lock  <= 1'b0;
				right_bracket_lock <= 1'b0;
				
				minus_lock  <= 1'b0;
				space_lock <= 1'b0;
				enter_lock <= 1'b0;
        end
		  else if (byte_received) begin



				case (newest_byte)

		          ZERO_CODE: 0_press <= curr_state == MAKE;
					 ONE_CODE: 1_press <= curr_state == MAKE;
					 TWO_CODE: 2_press <= curr_state == MAKE;
					 THREE_CODE: 3_press <= curr_state == MAKE;
					 FOUR_CODE: 4_press <= curr_state == MAKE;
					 FIVE_CODE: 5_press <= curr_state == MAKE;
					 SIX_CODE: 6_press <= curr_state == MAKE;
					 SEVEN_CODE: 7_press <= curr_state == MAKE;
					 EIGHT_CODE: 8_press <= curr_state == MAKE;
					 NINE_CODE: 9_press <= curr_state == MAKE;

					 
					 LEFT_BRACKET_CODE:  left_bracket_press  <= curr_state == MAKE;
					 RIGHT_BRACKET_CODE: right_bracket_press <= curr_state == MAKE;
					 MINUS_CODE:    minus_press    <= curr_state == MAKE;
					 
					 SPACE_CODE: space_press <= curr_state == MAKE;
					 ENTER_CODE: enter_press <= curr_state == MAKE;





					 8'he0: curr_state <= SECONDARY_MAKE;
					 8'hf0: curr_state <= curr_state == MAKE ? BREAK : SECONDARY_BREAK;
		      endcase
        end
        else begin

		      curr_state <= curr_state;
		  end
    end
endmodule
module keyboard_tracker #(parameter PULSE_OR_HOLD = 0) (
    input clock,
	 input reset,
	 
	 inout PS2_CLK,
	 inout PS2_DAT,
	 
	 output zero, one, two, three, four, five, six, seven, eight, nine,
	 output left_bracket, right_bracker, minus,
	 output space, enter
	 );

	 

	 wire byte_received;

	 wire [7:0] newest_byte;
	 	 
	 localparam

	            MAKE            = 2'b00,
	            BREAK           = 2'b01,
					SECONDARY_MAKE  = 2'b10,
					SECONDARY_BREAK = 2'b11,
					




					
										

					9_CODE = 8'h46,
					8_CODE = 8'h3E,
					7_CODE = 8'h3D,
					6_CODE = 8'h36,
					5_CODE = 8'h2E,
					4_CODE = 8'h25,
					3_CODE = 8'h26,
					2_CODE = 8'h1E,
					1_CODE = 8'h16,
					0_CODE = 8'h45,

					SPACE_CODE = 8'h29,
					MINUS_CODE = 8'h4E,
					LEFT_BRACKET_CODE = 8'h54,
					RIGHT_BRACKET_CODE = 8'h5B,
					ENTER_CODE = 8'h5a;


    reg [1:0] curr_state;
	 



    reg 0_press, 1_press, 2_press, 3_press, 4_press, 5_press, 6_press, 7_press, 8_press, 9_press;
	 reg left_bracket_press, right_bracket_press, minus_press;
	 reg space_press, enter_press;
	 




	 reg 0_lock, 1_lock, 2_lock, 3_lock, 3_lock, 4_lock, 5_lock, 6_lock, 7_lock, 8_lock, 9_lock;
	 reg left_bracket_lock, right_bracket_lock, minus_lock;
	 reg space_lock, enter_lock;
	 



    assign zero = 0_press && ~(0_lock && PULSE_OR_HOLD);
    assign one = 1_press && ~(1_lock && PULSE_OR_HOLD);
    assign two = 2_press && ~(2_lock && PULSE_OR_HOLD);
    assign three = 3_press && ~(3_lock && PULSE_OR_HOLD);
    assign four = 4_press && ~(4_lock && PULSE_OR_HOLD);
    assign five = 5_press && ~(5_lock && PULSE_OR_HOLD);
    assign six = 6_press && ~(6_lock && PULSE_OR_HOLD);
    assign seven = 7_press && ~(7_lock && PULSE_OR_HOLD);
    assign eight = 8_press && ~(8_lock && PULSE_OR_HOLD);
    assign nine = 9_press && ~(9_lock && PULSE_OR_HOLD);

    assign left_bracket  = left_bracket_press && ~(left_bracket_lock && PULSE_OR_HOLD);
    assign right_bracket = right_bracket_press && ~(right_bracket_lock && PULSE_OR_HOLD);
    assign minus  = minus_press && ~(minus_lock && PULSE_OR_HOLD);

    assign space = space_press && ~(space_lock && PULSE_OR_HOLD);
    assign enter = enter_press && ~(enter_lock && PULSE_OR_HOLD);
	 

	 PS2_Controller #(.INITIALIZE_MOUSE(0)) core_driver(
	     .CLOCK_50(clock),
		  .reset(~reset),
		  .PS2_CLK(PS2_CLK),
		  .PS2_DAT(PS2_DAT),
		  .received_data(newest_byte),
		  .received_data_en(byte_received)
		  );
		  
    always @(posedge clock) begin


		  curr_state <= MAKE;
		  





		  0_lock <= 0_press;
		  1_lock <= 1_press;
		  2_lock <= 2_press;
		  3_lock <= 3_press;
		  4_lock <= 4_press;
		  5_lock <= 5_press;
		  6_lock <= 6_press;
		  7_lock <= 7_press;
		  8_lock <= 8_press;
		  9_lock <= 9_press;
		  
		  left_bracket_lock <= left_bracket_press;
		  right_bracket_lock <= right_bracket_press;
		  minus_lock <= minus_press;
		  
		  space_lock <= space_press;
		  enter_lock <= enter_press;
		  
	     if (~reset) begin
		      curr_state <= MAKE;
				

				0_press <= 1'b0;
				1_press <= 1'b0;
				2_press <= 1'b0;
				3_press <= 1'b0;
				4_press <= 1'b0;
				5_press <= 1'b0;
				6_press <= 1'b0;
				7_press <= 1'b0;
				8_press <= 1'b0;
				9_press <= 1'b0;

				left_bracket_press  <= 1'b0;
				right_bracket_press <= 1'b0;
				minus_press    <= 1'b0;
				
				space_press <= 1'b0;
				enter_press <= 1'b0;
				
				0_lock <= 1'b0;
				1_lock <= 1'b0;
				2_lock <= 1'b0;
				3_lock <= 1'b0;
				4_lock <= 1'b0;
				5_lock <= 1'b0;
				6_lock <= 1'b0;
				7_lock <= 1'b0;
				8_lock <= 1'b0;
				9_lock <= 1'b0;

				left_brakcet_lock  <= 1'b0;
				right_bracket_lock <= 1'b0;
				
				minus_lock  <= 1'b0;
				space_lock <= 1'b0;
				enter_lock <= 1'b0;
        end
		  else if (byte_received) begin



				case (newest_byte)

		          ZERO_CODE: 0_press <= curr_state == MAKE;
					 ONE_CODE: 1_press <= curr_state == MAKE;
					 TWO_CODE: 2_press <= curr_state == MAKE;
					 THREE_CODE: 3_press <= curr_state == MAKE;
					 FOUR_CODE: 4_press <= curr_state == MAKE;
					 FIVE_CODE: 5_press <= curr_state == MAKE;
					 SIX_CODE: 6_press <= curr_state == MAKE;
					 SEVEN_CODE: 7_press <= curr_state == MAKE;
					 EIGHT_CODE: 8_press <= curr_state == MAKE;
					 NINE_CODE: 9_press <= curr_state == MAKE;

					 
					 LEFT_BRACKET_CODE:  left_bracket_press  <= curr_state == MAKE;
					 RIGHT_BRACKET_CODE: right_bracket_press <= curr_state == MAKE;
					 MINUS_CODE:    minus_press    <= curr_state == MAKE;
					 
					 SPACE_CODE: space_press <= curr_state == MAKE;
					 ENTER_CODE: enter_press <= curr_state == MAKE;





					 8'he0: curr_state <= SECONDARY_MAKE;
					 8'hf0: curr_state <= curr_state == MAKE ? BREAK : SECONDARY_BREAK;
		      endcase
        end
        else begin

		      curr_state <= curr_state;
		  end
    end
endmodule