data/full_repos/permissive/107499099/mips_de2-115/MIPS/alu_ctrler.v
'utf-8' codec can't decode byte 0xc0 in position 173: invalid start byte
1: b'%Warning-WIDTH: data/full_repos/permissive/107499099/mips_de2-115/MIPS/alu_ctrler.v:131: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s CONST \'3\'h0\' generates 3 bits.\n                                                                                       : ... In instance alu_ctrler\n          y = 3\'b000;\n            ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: Exiting due to 1 warning(s)\n'
module alu_ctrler (alu_op, func, alu_ctrl);
  input  [2:0]  alu_op;
  input  [5:0]    func;

  output [3:0]  alu_ctrl;

  reg    [3:0]       y;
   
  always @(alu_op or func) begin
    case (alu_op)
      3'b000: begin
        y = `ALU_CTRL_ADD;
        end
      3'b001: begin
        y = `ALU_CTRL_LUI;
      end
      3'b010: begin
        if (func == 6'b100000) begin
          y = `ALU_CTRL_ADD;
        end else if (func == 6'b100001) begin
          y = `ALU_CTRL_ADD;
        end else if (func == 6'b100010) begin
          y = `ALU_CTRL_SUB;
        end else if (func == 6'b100011) begin
          y = `ALU_CTRL_SUB;
        end else if (func == 6'b100100) begin
          y = `ALU_CTRL_AND;
        end else if (func == 6'b100101) begin
          y = `ALU_CTRL_OR;
        end else if (func == 6'b101010) begin
          y = `ALU_CTRL_SLT;
        end else if (func == 6'b001001) begin
          y = `ALU_CTRL_ADD;
        end else if (func == 6'b001000) begin
          y = `ALU_CTRL_ADD;
        end else if (func == 6'b001000) begin
          y = `ALU_CTRL_NOR;
        end else if (func == 6'b001000) begin
          y = `ALU_CTRL_XOR;
        end else if (func == 6'b000000) begin
          y = `ALU_CTRL_SLL;
        end else if (func == 6'b000010) begin
          y = `ALU_CTRL_SRL;
        end else if (func == 6'b000100) begin
          y = `ALU_CTRL_SLL;
        end else if (func == 6'b000110) begin
          y = `ALU_CTRL_SRL;
        end else if (func == 6'b000011) begin
          y = `ALU_CTRL_SRA;
        end else if (func == 6'b000111) begin
          y = `ALU_CTRL_SRA;
        end else if (func == 6'b101011) begin
          y = `ALU_CTRL_SLTU;






        end else begin
          y = 3'b000;
        end
      end
      3'b011: begin
        y = `ALU_CTRL_AND;
      end
      3'b100: begin
        y = `ALU_CTRL_OR;
      end
      3'b101: begin
        y = `ALU_CTRL_XOR;
      end
      3'b110: begin
        y = `ALU_CTRL_SLT;
      end
      default: begin
        y = `ALU_CTRL_SLTU;
      end
    endcase
  end

  assign alu_ctrl = y;
endmodule
module alu_ctrler (alu_op, func, alu_ctrl);

  input  [2:0]  alu_op;
  input  [5:0]    func;

  output [3:0]  alu_ctrl;

  reg    [3:0]       y;
   
  always @(alu_op or func) begin
    case (alu_op)
      3'b000: begin
        y = `ALU_CTRL_ADD;
        end
      3'b001: begin
        y = `ALU_CTRL_LUI;
      end
      3'b010: begin
        if (func == 6'b100000) begin
          y = `ALU_CTRL_ADD;
        end else if (func == 6'b100001) begin
          y = `ALU_CTRL_ADD;
        end else if (func == 6'b100010) begin
          y = `ALU_CTRL_SUB;
        end else if (func == 6'b100011) begin
          y = `ALU_CTRL_SUB;
        end else if (func == 6'b100100) begin
          y = `ALU_CTRL_AND;
        end else if (func == 6'b100101) begin
          y = `ALU_CTRL_OR;
        end else if (func == 6'b101010) begin
          y = `ALU_CTRL_SLT;
        end else if (func == 6'b001001) begin
          y = `ALU_CTRL_ADD;
        end else if (func == 6'b001000) begin
          y = `ALU_CTRL_ADD;
        end else if (func == 6'b001000) begin
          y = `ALU_CTRL_NOR;
        end else if (func == 6'b001000) begin
          y = `ALU_CTRL_XOR;
        end else if (func == 6'b000000) begin
          y = `ALU_CTRL_SLL;
        end else if (func == 6'b000010) begin
          y = `ALU_CTRL_SRL;
        end else if (func == 6'b000100) begin
          y = `ALU_CTRL_SLL;
        end else if (func == 6'b000110) begin
          y = `ALU_CTRL_SRL;
        end else if (func == 6'b000011) begin
          y = `ALU_CTRL_SRA;
        end else if (func == 6'b000111) begin
          y = `ALU_CTRL_SRA;
        end else if (func == 6'b101011) begin
          y = `ALU_CTRL_SLTU;






        end else begin
          y = 3'b000;
        end
      end
      3'b011: begin
        y = `ALU_CTRL_AND;
      end
      3'b100: begin
        y = `ALU_CTRL_OR;
      end
      3'b101: begin
        y = `ALU_CTRL_XOR;
      end
      3'b110: begin
        y = `ALU_CTRL_SLT;
      end
      default: begin
        y = `ALU_CTRL_SLTU;
      end
    endcase
  end

  assign alu_ctrl = y;
endmodule