data/full_repos/permissive/46522718/KEY_MUX.v
1: b'%Warning-IMPLICIT: data/full_repos/permissive/46522718/KEY_MUX.v:92: Signal definition not found, creating implicitly: \'parity\'\n assign parity = register[1]; \n        ^~~~~~\n                   ... Use "/* verilator lint_off IMPLICIT */" and lint_on around source to disable this message.\n%Warning-IMPLICIT: data/full_repos/permissive/46522718/KEY_MUX.v:17: Signal definition not found, creating implicitly: \'parity_error\'\n ps keyboard(PS2_CLK, PS2_DAT, scan_code, parity_error, rdy);\n                                          ^~~~~~~~~~~~\n%Warning-IMPLICIT: data/full_repos/permissive/46522718/KEY_MUX.v:17: Signal definition not found, creating implicitly: \'rdy\'\n ps keyboard(PS2_CLK, PS2_DAT, scan_code, parity_error, rdy);\n                                                        ^~~\n%Error: Exiting due to 3 warning(s)\n'
module KEY_MUX
(
	input PS2_CLK,
	input PS2_DAT,
	output [9:0]LEDR,
	output [6:0]HEX0,
	output [6:0]HEX1
);
	reg [3:0]S = 4'b0001;
	reg [3:0]NS;
	reg [7:0]in1;
	reg [7:0]in2;
	reg [7:0]in3;
	reg [7:0]out;
	wire [7:0]scan_code;

	ps keyboard(PS2_CLK, PS2_DAT, scan_code, parity_error, rdy);
	KEY_DISP d0(out, HEX0[6:0]);
	Seg7Disp s0(S[3:0], HEX1[6:0]);

	assign LEDR[3:0] = S;
	assign LEDR[9:6] = NS;
	
	always@(scan_code[0], scan_code[1], scan_code[2], scan_code[3], scan_code[4], scan_code[5],
	        scan_code[6],scan_code[7])
	begin
		case(S)
			4'b0001: 
			begin
				NS <= 4'b0010;
				in1 <= scan_code;
			end
			4'b0010: 
			begin
				NS <= 4'b0100;
				in2 <= scan_code;
			end
			4'b0100: 
			begin
				NS <= 4'b1000;
				in3 <= scan_code;
			end
			4'b1000: 
			begin
				out <= in3;
				NS <= 4'b0001;
			end
			default: NS <= 4'b0001;
		endcase
	end
	
	always@(NS)
	begin
		S <= NS;
	end

endmodule
module KEY_MUX
(
	input PS2_CLK,
	input PS2_DAT,
	output [9:0]LEDR,
	output [6:0]HEX0,
	output [6:0]HEX1
);

	reg [3:0]S = 4'b0001;
	reg [3:0]NS;
	reg [7:0]in1;
	reg [7:0]in2;
	reg [7:0]in3;
	reg [7:0]out;
	wire [7:0]scan_code;

	ps keyboard(PS2_CLK, PS2_DAT, scan_code, parity_error, rdy);
	KEY_DISP d0(out, HEX0[6:0]);
	Seg7Disp s0(S[3:0], HEX1[6:0]);

	assign LEDR[3:0] = S;
	assign LEDR[9:6] = NS;
	
	always@(scan_code[0], scan_code[1], scan_code[2], scan_code[3], scan_code[4], scan_code[5],
	        scan_code[6],scan_code[7])
	begin
		case(S)
			4'b0001: 
			begin
				NS <= 4'b0010;
				in1 <= scan_code;
			end
			4'b0010: 
			begin
				NS <= 4'b0100;
				in2 <= scan_code;
			end
			4'b0100: 
			begin
				NS <= 4'b1000;
				in3 <= scan_code;
			end
			4'b1000: 
			begin
				out <= in3;
				NS <= 4'b0001;
			end
			default: NS <= 4'b0001;
		endcase
	end
	
	always@(NS)
	begin
		S <= NS;
	end

endmodule