data/full_repos/permissive/160895047/ALU_Decoder.v
1: b'%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:3: Cannot find include file: ALU.v\n`include "ALU.v" \n         ^~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/160895047,data/full_repos/permissive/160895047/ALU.v\n             data/full_repos/permissive/160895047,data/full_repos/permissive/160895047/ALU.v.v\n             data/full_repos/permissive/160895047,data/full_repos/permissive/160895047/ALU.v.sv\n             ALU.v\n             ALU.v.v\n             ALU.v.sv\n             obj_dir/ALU.v\n             obj_dir/ALU.v.v\n             obj_dir/ALU.v.sv\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:4: Cannot find include file: funct.v\n`include "funct.v" \n         ^~~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:28: Define or directive not defined: \'`ALU_ADD\'\n  2\'b00: ALUControl = `ALU_ADD;\n                      ^~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:28: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n  2\'b00: ALUControl = `ALU_ADD;\n                              ^\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:29: Define or directive not defined: \'`ALU_SUBTRACT\'\n  2\'b01: ALUControl = `ALU_SUBTRACT;\n                      ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:29: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n  2\'b01: ALUControl = `ALU_SUBTRACT;\n                                   ^\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:32: Define or directive not defined: \'`FUNCT_ADD\'\n    `FUNCT_ADD: ALUControl = `ALU_ADD;\n    ^~~~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:32: syntax error, unexpected \':\', expecting endcase\n    `FUNCT_ADD: ALUControl = `ALU_ADD;\n              ^\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:32: Define or directive not defined: \'`ALU_ADD\'\n    `FUNCT_ADD: ALUControl = `ALU_ADD;\n                             ^~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:33: Define or directive not defined: \'`FUNCT_SUBTRACT\'\n    `FUNCT_SUBTRACT: ALUControl = `ALU_SUBTRACT;\n    ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:33: Define or directive not defined: \'`ALU_SUBTRACT\'\n    `FUNCT_SUBTRACT: ALUControl = `ALU_SUBTRACT;\n                                  ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:34: Define or directive not defined: \'`FUNCT_AND\'\n    `FUNCT_AND: ALUControl = `ALU_AND;\n    ^~~~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:34: Define or directive not defined: \'`ALU_AND\'\n    `FUNCT_AND: ALUControl = `ALU_AND;\n                             ^~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:35: Define or directive not defined: \'`FUNCT_OR\'\n    `FUNCT_OR: ALUControl = `ALU_OR;\n    ^~~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:35: Define or directive not defined: \'`ALU_OR\'\n    `FUNCT_OR: ALUControl = `ALU_OR;\n                            ^~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:36: Define or directive not defined: \'`FUNCT_SLT\'\n    `FUNCT_SLT: ALUControl = `ALU_SLT;\n    ^~~~~~~~~~\n%Error: data/full_repos/permissive/160895047/ALU_Decoder.v:36: Define or directive not defined: \'`ALU_SLT\'\n    `FUNCT_SLT: ALUControl = `ALU_SLT;\n                             ^~~~~~~~\n%Error: Cannot continue\n'
module ALU_Decoder(
	ALUOp,
	Funct,
	ALUControl
);
input CLK;
input [1:0] ALUOp;
input [5:0] Funct;
output [2:0] ALUControl;

wire CLK;
wire [1:0] ALUOp;
wire [5:0] Funct;
reg [2:0] ALUControl;

always @*
begin

	case (ALUOp)
		`ALU_DECODER_ADD: ALUControl = `ALU_ADD;
		`ALU_DECODER_SUBTRACT: ALUControl = `ALU_SUBTRACT;
		`ALU_DECODER_FUNCT:
			case (Funct[3:0])
				`FUNCT_ADD: ALUControl = `ALU_ADD;
				`FUNCT_SUBTRACT: ALUControl = `ALU_SUBTRACT;
				`FUNCT_AND: ALUControl = `ALU_AND;
				`FUNCT_OR: ALUControl = `ALU_OR;
				`FUNCT_SLT: ALUControl = `ALU_SLT;
				default: $display("Unknown Funct: %b", Funct);
			endcase
		default: $display("Unknown ALUOp: %b", ALUOp);
	endcase
end
endmodule
module ALU_Decoder(
	ALUOp,
	Funct,
	ALUControl
);

input CLK;
input [1:0] ALUOp;
input [5:0] Funct;
output [2:0] ALUControl;

wire CLK;
wire [1:0] ALUOp;
wire [5:0] Funct;
reg [2:0] ALUControl;

always @*
begin

	case (ALUOp)
		`ALU_DECODER_ADD: ALUControl = `ALU_ADD;
		`ALU_DECODER_SUBTRACT: ALUControl = `ALU_SUBTRACT;
		`ALU_DECODER_FUNCT:
			case (Funct[3:0])
				`FUNCT_ADD: ALUControl = `ALU_ADD;
				`FUNCT_SUBTRACT: ALUControl = `ALU_SUBTRACT;
				`FUNCT_AND: ALUControl = `ALU_AND;
				`FUNCT_OR: ALUControl = `ALU_OR;
				`FUNCT_SLT: ALUControl = `ALU_SLT;
				default: $display("Unknown Funct: %b", Funct);
			endcase
		default: $display("Unknown ALUOp: %b", ALUOp);
	endcase
end
endmodule