data/full_repos/permissive/109846502/Decoder.v
1: b'%Error: data/full_repos/permissive/109846502/Decoder.v:2: Cannot find include file: defines.vh\n`include "defines.vh" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/109846502,data/full_repos/permissive/109846502/defines.vh\n             data/full_repos/permissive/109846502,data/full_repos/permissive/109846502/defines.vh.v\n             data/full_repos/permissive/109846502,data/full_repos/permissive/109846502/defines.vh.sv\n             defines.vh\n             defines.vh.v\n             defines.vh.sv\n             obj_dir/defines.vh\n             obj_dir/defines.vh.v\n             obj_dir/defines.vh.sv\n%Error: data/full_repos/permissive/109846502/Decoder.v:52: Define or directive not defined: \'`KEY_NONE\'\n     CurrentKey <= `KEY_NONE;\n                   ^~~~~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:52: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n     CurrentKey <= `KEY_NONE;\n                            ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:67: Define or directive not defined: \'`KEY_NONE\'\n       CurrentKey <= `KEY_NONE;\n                     ^~~~~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:67: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n       CurrentKey <= `KEY_NONE;\n                              ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:76: Define or directive not defined: \'`KEY_1\'\n        4\'b0111: CurrentKey <= `KEY_1;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:76: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b0111: CurrentKey <= `KEY_1;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:77: Define or directive not defined: \'`KEY_4\'\n        4\'b1011: CurrentKey <= `KEY_4;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:77: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1011: CurrentKey <= `KEY_4;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:78: Define or directive not defined: \'`KEY_7\'\n        4\'b1101: CurrentKey <= `KEY_7;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:78: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1101: CurrentKey <= `KEY_7;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:79: Define or directive not defined: \'`KEY_0\'\n        4\'b1110: CurrentKey <= `KEY_0;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:79: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1110: CurrentKey <= `KEY_0;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:83: Define or directive not defined: \'`KEY_2\'\n        4\'b0111: CurrentKey <= `KEY_2;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:83: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b0111: CurrentKey <= `KEY_2;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:84: Define or directive not defined: \'`KEY_5\'\n        4\'b1011: CurrentKey <= `KEY_5;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:84: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1011: CurrentKey <= `KEY_5;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:85: Define or directive not defined: \'`KEY_8\'\n        4\'b1101: CurrentKey <= `KEY_8;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:85: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1101: CurrentKey <= `KEY_8;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:86: Define or directive not defined: \'`KEY_F\'\n        4\'b1110: CurrentKey <= `KEY_F;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:86: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1110: CurrentKey <= `KEY_F;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:90: Define or directive not defined: \'`KEY_3\'\n        4\'b0111: CurrentKey <= `KEY_3;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:90: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b0111: CurrentKey <= `KEY_3;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:91: Define or directive not defined: \'`KEY_6\'\n        4\'b1011: CurrentKey <= `KEY_6;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:91: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1011: CurrentKey <= `KEY_6;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:92: Define or directive not defined: \'`KEY_9\'\n        4\'b1101: CurrentKey <= `KEY_9;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:92: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1101: CurrentKey <= `KEY_9;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:93: Define or directive not defined: \'`KEY_E\'\n        4\'b1110: CurrentKey <= `KEY_E;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:93: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1110: CurrentKey <= `KEY_E;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:97: Define or directive not defined: \'`KEY_A\'\n        4\'b0111: CurrentKey <= `KEY_A;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:97: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b0111: CurrentKey <= `KEY_A;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:98: Define or directive not defined: \'`KEY_B\'\n        4\'b1011: CurrentKey <= `KEY_B;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:98: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1011: CurrentKey <= `KEY_B;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:99: Define or directive not defined: \'`KEY_C\'\n        4\'b1101: CurrentKey <= `KEY_C;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:99: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1101: CurrentKey <= `KEY_C;\n                                     ^\n%Error: data/full_repos/permissive/109846502/Decoder.v:100: Define or directive not defined: \'`KEY_D\'\n        4\'b1110: CurrentKey <= `KEY_D;\n                               ^~~~~~\n%Error: data/full_repos/permissive/109846502/Decoder.v:100: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n        4\'b1110: CurrentKey <= `KEY_D;\n                                     ^\n%Error: Exiting due to 37 error(s)\n'
module Decoder(
	 input clk,
	 input rst,
	 input [3:0] row,
	 output reg [3:0] Col,
	 output reg [4:0] DecodeOut
    );








reg [2:0] Column;
reg [2:0] nextColumn;
reg state;
reg [4:0] CurrentKey;

	always @(posedge clk, posedge rst) begin
			if(rst)
				begin
					Column <= 3'd0; 
					nextColumn <= 3'd0;
					state <= 1'b1;
					CurrentKey <= `KEY_NONE;
				end
			else	
			begin
				if(state) begin
					Column <= nextColumn;
							
					case(nextColumn)
						3'd0: Col <= 4'b0111;
						3'd1: Col <= 4'b1011;
						3'd2: Col <= 4'b1101;
						3'd3: Col <= 4'b1110;
						3'd4: 
						begin
							DecodeOut <= CurrentKey;
							CurrentKey <= `KEY_NONE;
							Column <= 3'd0;
						end
					endcase
				end
				else begin
					case (Column)
						3'd0:
							case(row)
								4'b0111: CurrentKey <= `KEY_1;
								4'b1011: CurrentKey <= `KEY_4;
								4'b1101: CurrentKey <= `KEY_7;
								4'b1110: CurrentKey <= `KEY_0;
							endcase
						3'd1:
							case(row)
								4'b0111: CurrentKey <= `KEY_2;
								4'b1011: CurrentKey <= `KEY_5;
								4'b1101: CurrentKey <= `KEY_8;
								4'b1110: CurrentKey <= `KEY_F;
							endcase
						3'd2:
							case(row)
								4'b0111: CurrentKey <= `KEY_3;
								4'b1011: CurrentKey <= `KEY_6;
								4'b1101: CurrentKey <= `KEY_9;
								4'b1110: CurrentKey <= `KEY_E;
							endcase
						3'd3:
							case(row)
								4'b0111: CurrentKey <= `KEY_A;
								4'b1011: CurrentKey <= `KEY_B;
								4'b1101: CurrentKey <= `KEY_C;
								4'b1110: CurrentKey <= `KEY_D;
							endcase
					endcase
					nextColumn <= nextColumn + 1;
				end
				state <= ~state;
			end
	end

endmodule
module Decoder(
	 input clk,
	 input rst,
	 input [3:0] row,
	 output reg [3:0] Col,
	 output reg [4:0] DecodeOut
    );









reg [2:0] Column;
reg [2:0] nextColumn;
reg state;
reg [4:0] CurrentKey;

	always @(posedge clk, posedge rst) begin
			if(rst)
				begin
					Column <= 3'd0; 
					nextColumn <= 3'd0;
					state <= 1'b1;
					CurrentKey <= `KEY_NONE;
				end
			else	
			begin
				if(state) begin
					Column <= nextColumn;
							
					case(nextColumn)
						3'd0: Col <= 4'b0111;
						3'd1: Col <= 4'b1011;
						3'd2: Col <= 4'b1101;
						3'd3: Col <= 4'b1110;
						3'd4: 
						begin
							DecodeOut <= CurrentKey;
							CurrentKey <= `KEY_NONE;
							Column <= 3'd0;
						end
					endcase
				end
				else begin
					case (Column)
						3'd0:
							case(row)
								4'b0111: CurrentKey <= `KEY_1;
								4'b1011: CurrentKey <= `KEY_4;
								4'b1101: CurrentKey <= `KEY_7;
								4'b1110: CurrentKey <= `KEY_0;
							endcase
						3'd1:
							case(row)
								4'b0111: CurrentKey <= `KEY_2;
								4'b1011: CurrentKey <= `KEY_5;
								4'b1101: CurrentKey <= `KEY_8;
								4'b1110: CurrentKey <= `KEY_F;
							endcase
						3'd2:
							case(row)
								4'b0111: CurrentKey <= `KEY_3;
								4'b1011: CurrentKey <= `KEY_6;
								4'b1101: CurrentKey <= `KEY_9;
								4'b1110: CurrentKey <= `KEY_E;
							endcase
						3'd3:
							case(row)
								4'b0111: CurrentKey <= `KEY_A;
								4'b1011: CurrentKey <= `KEY_B;
								4'b1101: CurrentKey <= `KEY_C;
								4'b1110: CurrentKey <= `KEY_D;
							endcase
					endcase
					nextColumn <= nextColumn + 1;
				end
				state <= ~state;
			end
	end

endmodule