data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v
 line:10: before: ";"
1: b"%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:10: Define or directive not defined: '`ALU_OP_ADD'\n        2'b00:  aluOp <= `ALU_OP_ADD;            \n                         ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:10: syntax error, unexpected ';', expecting TYPE-IDENTIFIER\n        2'b00:  aluOp <= `ALU_OP_ADD;            \n                                    ^\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:20: Define or directive not defined: '`BEQ_FUNCT3'\n            `BEQ_FUNCT3:  aluOp <= `ALU_OP_EQ;\n            ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:20: syntax error, unexpected ':', expecting endcase\n            `BEQ_FUNCT3:  aluOp <= `ALU_OP_EQ;\n                       ^\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:20: Define or directive not defined: '`ALU_OP_EQ'\n            `BEQ_FUNCT3:  aluOp <= `ALU_OP_EQ;\n                                   ^~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:21: Define or directive not defined: '`BNE_FUNCT3'\n            `BNE_FUNCT3:  aluOp <= `ALU_OP_NEQ;\n            ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:21: Define or directive not defined: '`ALU_OP_NEQ'\n            `BNE_FUNCT3:  aluOp <= `ALU_OP_NEQ;\n                                   ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:22: Define or directive not defined: '`BLT_FUNCT3'\n            `BLT_FUNCT3:  aluOp <= `ALU_OP_SLT;\n            ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:22: Define or directive not defined: '`ALU_OP_SLT'\n            `BLT_FUNCT3:  aluOp <= `ALU_OP_SLT;\n                                   ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:23: Define or directive not defined: '`BGE_FUNCT3'\n            `BGE_FUNCT3:  aluOp <= `ALU_OP_GE;\n            ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:23: Define or directive not defined: '`ALU_OP_GE'\n            `BGE_FUNCT3:  aluOp <= `ALU_OP_GE;\n                                   ^~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:24: Define or directive not defined: '`BLTU_FUNCT3'\n            `BLTU_FUNCT3: aluOp <= `ALU_OP_SLTU;\n            ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:24: Define or directive not defined: '`ALU_OP_SLTU'\n            `BLTU_FUNCT3: aluOp <= `ALU_OP_SLTU;\n                                   ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:25: Define or directive not defined: '`BGEU_FUNCT3'\n            `BGEU_FUNCT3: aluOp <= `ALU_OP_GEU;\n            ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:25: Define or directive not defined: '`ALU_OP_GEU'\n            `BGEU_FUNCT3: aluOp <= `ALU_OP_GEU;\n                                   ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:26: Define or directive not defined: '`ALU_OP_XXX'\n            default:      aluOp <= `ALU_OP_XXX;\n                                   ^~~~~~~~~~~\n%Error: data/full_repos/permissive/174704591/src/snippets/riscv/alu_ctrl.v:29: Define or directive not defined: '`ALU_OP_XXX'\n        default: aluOp <= `ALU_OP_XXX;\n                          ^~~~~~~~~~~\n%Error: Cannot continue\n"
module alu_ctrl (
    input [2:0]  funct3,
    input [6:0]  funct7,
    input [1:0]  aluCtrlOp,
    input        itype,
    output reg [3:0] aluOp
);
    always @(*) begin
      case(aluCtrlOp)
        2'b00:  aluOp <= `ALU_OP_ADD;
        2'b01:  begin
          if(itype & funct3[1:0] != 2'b01)
            aluOp <= {1'b0, funct3};
          else
            aluOp <= {funct7[5], funct3};
        end
        2'b10:  begin

          case(funct3)
            `BEQ_FUNCT3:  aluOp <= `ALU_OP_EQ;
            `BNE_FUNCT3:  aluOp <= `ALU_OP_NEQ;
            `BLT_FUNCT3:  aluOp <= `ALU_OP_SLT;
            `BGE_FUNCT3:  aluOp <= `ALU_OP_GE;
            `BLTU_FUNCT3: aluOp <= `ALU_OP_SLTU;
            `BGEU_FUNCT3: aluOp <= `ALU_OP_GEU;
            default:      aluOp <= `ALU_OP_XXX;
          endcase
          end
        default: aluOp <= `ALU_OP_XXX;
      endcase
    end
endmodule
module alu_ctrl (
    input [2:0]  funct3,
    input [6:0]  funct7,
    input [1:0]  aluCtrlOp,
    input        itype,
    output reg [3:0] aluOp
);

    always @(*) begin
      case(aluCtrlOp)
        2'b00:  aluOp <= `ALU_OP_ADD;
        2'b01:  begin
          if(itype & funct3[1:0] != 2'b01)
            aluOp <= {1'b0, funct3};
          else
            aluOp <= {funct7[5], funct3};
        end
        2'b10:  begin

          case(funct3)
            `BEQ_FUNCT3:  aluOp <= `ALU_OP_EQ;
            `BNE_FUNCT3:  aluOp <= `ALU_OP_NEQ;
            `BLT_FUNCT3:  aluOp <= `ALU_OP_SLT;
            `BGE_FUNCT3:  aluOp <= `ALU_OP_GE;
            `BLTU_FUNCT3: aluOp <= `ALU_OP_SLTU;
            `BGEU_FUNCT3: aluOp <= `ALU_OP_GEU;
            default:      aluOp <= `ALU_OP_XXX;
          endcase
          end
        default: aluOp <= `ALU_OP_XXX;
      endcase
    end
endmodule