data/full_repos/permissive/444465810/func/axi/CTRL.v
1: b"%Error: data/full_repos/permissive/444465810/func/axi/CTRL.v:26: syntax error, unexpected break, expecting IDENTIFIER or do or final\n output reg break,\n            ^~~~~\n%Error: data/full_repos/permissive/444465810/func/axi/CTRL.v:28: syntax error, unexpected output, expecting IDENTIFIER or '=' or do or final\n output reg Delay_Next,\n ^~~~~~\n%Error: data/full_repos/permissive/444465810/func/axi/CTRL.v:29: syntax error, unexpected output, expecting IDENTIFIER or '=' or do or final\n output reg sign\n ^~~~~~\n%Error: data/full_repos/permissive/444465810/func/axi/CTRL.v:50: syntax error, unexpected always\nalways @(*) begin\n^~~~~~\n%Error: Exiting due to 4 error(s)\n"
module CTRL(

    input [31:0]Instr,
    output reg[2:0]NPC_Sel,
    output reg[1:0]EXT_Sel,
    output reg[2:0]RF_Data_Sel,
    output reg[2:0]PC_Sel,

    output reg[3:0]ALU_Sel,
    output reg ALU_A_Sel,
    output reg ALU_B_Sel,

    output reg DMWr,
    output reg[1:0]StoreType,
    output reg[2:0]LoadType,

    output reg[1:0]RF_Sel,
    output reg RFWr,

	output reg [2:0] MDU_Sel,
	output reg Start,
	output reg MDU_RD_Sel,
	output reg ALU_MDU_Sel,

	output reg syscall,
	output reg break,
	output reg reserve,
	output reg Delay_Next,
	output reg sign
);
    `define op 31:26
    `define funct 5:0
    `define imm26 25:0
    `define imm16 15:0
    `define rs 25:21
    `define rt 20:16
    `define rd 15:11
    `define s 10:6


wire [5:0]Op = Instr[`op];
wire [5:0]Funct = Instr[`funct];
wire [4:0]rt = Instr[`rt];

always @(*) begin
		if (Op == 6'b000000 && Funct == 6'b100000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			RF_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 1;
		end
		else if (Op == 6'b000000 && Funct == 6'b100001) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			RF_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100010) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			RF_Sel = 0;
			ALU_Sel = 1;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 1;
		end
		else if (Op == 6'b000000 && Funct == 6'b100011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			RF_Sel = 0;
			ALU_Sel = 1;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100100)	begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 2;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100101)	begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 3;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100110)	begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 4;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100111)	begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 5;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000100) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 6;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;	
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000110) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 7;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;	
		end
		else if (Op == 6'b000000 && Funct == 6'b000111) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 8;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;	
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 6;
			ALU_A_Sel = 1;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000010) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 7;
			ALU_A_Sel = 1;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 8;
			ALU_A_Sel = 1;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 1;
		end
		else if (Op == 6'b001001) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001100) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 1;
			RF_Sel = 1;
			ALU_Sel = 2;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001101) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 1;
			RF_Sel = 1;
			ALU_Sel = 3;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001110) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 1;
			RF_Sel = 1;
			ALU_Sel = 4;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001111) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 1;
			EXT_Sel = 2;
			RF_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 2;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000010) begin
			NPC_Sel = 2;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000011) begin
			NPC_Sel = 2;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 1;
			RF_Sel = 2;
			DMWr = 0;
			RF_Data_Sel = 3;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b001000) begin
			NPC_Sel = 3;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b001001) begin
			NPC_Sel = 3;
			MDU_Sel = 0;
			Start = 0;
			RF_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 3;
			RFWr = 1;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000100) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 0;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000101) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 1;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000110) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 2;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000111) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 3;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000001 && rt == 5'b00000) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 4;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000001 && rt == 5'b00001) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 5;
			DMWr = 0;	
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if(Op == 6'b000001 && rt == 5'b10001) begin
		  NPC_Sel = 1;
		  MDU_Sel = 0;
		  Start = 0;
		  RFWr = 1;
		  EXT_Sel = 0;
		  PC_Sel = 5;
		  DMWr = 0;
		  RFWr = 1;
		  RF_Sel = 2;
		  RF_Data_Sel = 3;
		  Delay_Next = 1;
		  syscall = 0;
		  break = 0;
		  reserve = 0;
		  sign = 0;
		end
		else if(Op == 6'b000001 && rt == 5'b10000) begin
		  NPC_Sel = 1;
		  MDU_Sel = 0;
		  Start = 0;
		  RFWr = 1;
		  EXT_Sel = 0;
		  PC_Sel = 4;
		  DMWr = 0;
		  RFWr = 1;
		  RF_Sel = 2;
		  RF_Data_Sel = 3;
		  Delay_Next = 1;
		  syscall = 0;
		  break = 0;
		  reserve = 0;
		  sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b101010) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 9;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b101011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 10;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b001010) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 9;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b001011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 10;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b101011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 0;
			EXT_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 1;
			StoreType = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b101001) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 0;
			EXT_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 1;
			StoreType = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b101000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 0;
			EXT_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 1;
			StoreType = 2;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 0;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100001) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 1;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100101) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 2;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 3;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100100) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 4;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b011000)	begin
			NPC_Sel = 0;
			MDU_Sel = 1;
			Start = 1;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b011001)	begin
			NPC_Sel = 0;
			MDU_Sel = 2;
			Start = 1;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b011010)	begin
			NPC_Sel = 0;
			MDU_Sel = 3;
			Start = 1;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b011011)	begin
			NPC_Sel = 0;
			MDU_Sel = 4;
			Start = 1;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b010011)	begin
			NPC_Sel = 0;  
			MDU_Sel = 5;
			Start = 0;
			DMWr = 0;  
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b010001)	begin
			NPC_Sel = 0;  
			MDU_Sel = 6;
			Start = 0;
			DMWr = 0;  
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b010010) begin
			NPC_Sel = 0;
			RF_Sel = 0;
			MDU_Sel = 0;
			MDU_RD_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 1;
			DMWr = 0; 
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b010000) begin
			NPC_Sel = 0;
			RF_Sel = 0;
			MDU_Sel = 0;
			MDU_RD_Sel = 1;
			Start = 0;
			ALU_MDU_Sel = 1;
			DMWr = 0; 
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Instr[31:21] == 11'b01000000000 && Instr[10:0] == 11'b00000000000) begin
			NPC_Sel = 0;
			RF_Sel = 1;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 4;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Instr[31:21] == 11'b01000000100 && Instr[10:0] == 11'b00000000000) begin
			NPC_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b001101) begin
			RFWr = 0;
			DMWr = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			break = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b001100) begin
			RFWr = 0;
			DMWr = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			syscall = 1;
			Delay_Next = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Instr == 32'b01000010000000000000000000011000) begin
			RFWr = 0;
			DMWr = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			syscall = 0;
			Delay_Next = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;

		end
		else begin
			RFWr = 0;
			DMWr = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			reserve = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
			sign = 0;
		end
	end
endmodule
module CTRL(

    input [31:0]Instr,
    output reg[2:0]NPC_Sel,
    output reg[1:0]EXT_Sel,
    output reg[2:0]RF_Data_Sel,
    output reg[2:0]PC_Sel,

    output reg[3:0]ALU_Sel,
    output reg ALU_A_Sel,
    output reg ALU_B_Sel,

    output reg DMWr,
    output reg[1:0]StoreType,
    output reg[2:0]LoadType,

    output reg[1:0]RF_Sel,
    output reg RFWr,

	output reg [2:0] MDU_Sel,
	output reg Start,
	output reg MDU_RD_Sel,
	output reg ALU_MDU_Sel,

	output reg syscall,
	output reg break,
	output reg reserve,
	output reg Delay_Next,
	output reg sign
);

    `define op 31:26
    `define funct 5:0
    `define imm26 25:0
    `define imm16 15:0
    `define rs 25:21
    `define rt 20:16
    `define rd 15:11
    `define s 10:6


wire [5:0]Op = Instr[`op];
wire [5:0]Funct = Instr[`funct];
wire [4:0]rt = Instr[`rt];

always @(*) begin
		if (Op == 6'b000000 && Funct == 6'b100000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			RF_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 1;
		end
		else if (Op == 6'b000000 && Funct == 6'b100001) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			RF_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100010) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			RF_Sel = 0;
			ALU_Sel = 1;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 1;
		end
		else if (Op == 6'b000000 && Funct == 6'b100011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			RF_Sel = 0;
			ALU_Sel = 1;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100100)	begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 2;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100101)	begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 3;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100110)	begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 4;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b100111)	begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 5;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000100) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 6;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;	
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000110) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 7;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;	
		end
		else if (Op == 6'b000000 && Funct == 6'b000111) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 8;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;	
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 6;
			ALU_A_Sel = 1;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000010) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 7;
			ALU_A_Sel = 1;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b000011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 8;
			ALU_A_Sel = 1;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 1;
		end
		else if (Op == 6'b001001) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001100) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 1;
			RF_Sel = 1;
			ALU_Sel = 2;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001101) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 1;
			RF_Sel = 1;
			ALU_Sel = 3;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001110) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 1;
			RF_Sel = 1;
			ALU_Sel = 4;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b001111) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 1;
			EXT_Sel = 2;
			RF_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 2;
			syscall = 0;
			break = 0;
			reserve = 0;
			Delay_Next = 0;
			sign = 0;
		end
		else if (Op == 6'b000010) begin
			NPC_Sel = 2;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000011) begin
			NPC_Sel = 2;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 1;
			RF_Sel = 2;
			DMWr = 0;
			RF_Data_Sel = 3;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b001000) begin
			NPC_Sel = 3;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b001001) begin
			NPC_Sel = 3;
			MDU_Sel = 0;
			Start = 0;
			RF_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 3;
			RFWr = 1;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000100) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 0;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000101) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 1;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000110) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 2;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000111) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 3;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000001 && rt == 5'b00000) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 4;
			DMWr = 0;
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000001 && rt == 5'b00001) begin
			NPC_Sel = 1;
			MDU_Sel = 0;
			Start = 0;
			RFWr = 0;
			EXT_Sel = 0;
			PC_Sel = 5;
			DMWr = 0;	
			Delay_Next = 1;
			syscall = 0;
			break = 0;
			reserve = 0;
			sign = 0;
		end
		else if(Op == 6'b000001 && rt == 5'b10001) begin
		  NPC_Sel = 1;
		  MDU_Sel = 0;
		  Start = 0;
		  RFWr = 1;
		  EXT_Sel = 0;
		  PC_Sel = 5;
		  DMWr = 0;
		  RFWr = 1;
		  RF_Sel = 2;
		  RF_Data_Sel = 3;
		  Delay_Next = 1;
		  syscall = 0;
		  break = 0;
		  reserve = 0;
		  sign = 0;
		end
		else if(Op == 6'b000001 && rt == 5'b10000) begin
		  NPC_Sel = 1;
		  MDU_Sel = 0;
		  Start = 0;
		  RFWr = 1;
		  EXT_Sel = 0;
		  PC_Sel = 4;
		  DMWr = 0;
		  RFWr = 1;
		  RF_Sel = 2;
		  RF_Data_Sel = 3;
		  Delay_Next = 1;
		  syscall = 0;
		  break = 0;
		  reserve = 0;
		  sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b101010) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 9;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b101011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RF_Sel = 0;
			ALU_Sel = 10;
			ALU_A_Sel = 0;
			ALU_B_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b001010) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 9;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b001011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 10;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b101011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 0;
			EXT_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 1;
			StoreType = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b101001) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 0;
			EXT_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 1;
			StoreType = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b101000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 0;
			EXT_Sel = 0;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 1;
			StoreType = 2;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100011) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 0;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100001) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 1;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100101) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 2;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100000) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 3;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b100100) begin
			NPC_Sel = 0;
			MDU_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			RFWr = 1;
			EXT_Sel = 0;
			RF_Sel = 1;
			ALU_Sel = 0;
			ALU_A_Sel = 0;
			ALU_B_Sel = 1;
			DMWr = 0;
			LoadType = 4;
			RF_Data_Sel = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b011000)	begin
			NPC_Sel = 0;
			MDU_Sel = 1;
			Start = 1;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b011001)	begin
			NPC_Sel = 0;
			MDU_Sel = 2;
			Start = 1;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b011010)	begin
			NPC_Sel = 0;
			MDU_Sel = 3;
			Start = 1;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b011011)	begin
			NPC_Sel = 0;
			MDU_Sel = 4;
			Start = 1;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b010011)	begin
			NPC_Sel = 0;  
			MDU_Sel = 5;
			Start = 0;
			DMWr = 0;  
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b010001)	begin
			NPC_Sel = 0;  
			MDU_Sel = 6;
			Start = 0;
			DMWr = 0;  
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b010010) begin
			NPC_Sel = 0;
			RF_Sel = 0;
			MDU_Sel = 0;
			MDU_RD_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 1;
			DMWr = 0; 
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b010000) begin
			NPC_Sel = 0;
			RF_Sel = 0;
			MDU_Sel = 0;
			MDU_RD_Sel = 1;
			Start = 0;
			ALU_MDU_Sel = 1;
			DMWr = 0; 
			RF_Data_Sel = 0;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Instr[31:21] == 11'b01000000000 && Instr[10:0] == 11'b00000000000) begin
			NPC_Sel = 0;
			RF_Sel = 1;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			DMWr = 0;
			RF_Data_Sel = 4;
			RFWr = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Instr[31:21] == 11'b01000000100 && Instr[10:0] == 11'b00000000000) begin
			NPC_Sel = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			DMWr = 0;
			RFWr = 0;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b001101) begin
			RFWr = 0;
			DMWr = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			break = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Op == 6'b000000 && Funct == 6'b001100) begin
			RFWr = 0;
			DMWr = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			syscall = 1;
			Delay_Next = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;
		end
		else if (Instr == 32'b01000010000000000000000000011000) begin
			RFWr = 0;
			DMWr = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			syscall = 0;
			Delay_Next = 0;
		  	break = 0;
		  	reserve = 0;
			sign = 0;

		end
		else begin
			RFWr = 0;
			DMWr = 0;
			Start = 0;
			ALU_MDU_Sel = 0;
			MDU_Sel = 0;
			reserve = 1;
			Delay_Next = 0;
		  	syscall = 0;
		  	break = 0;
			sign = 0;
		end
	end
endmodule