data/full_repos/permissive/452648646/src/branch_evaluator.v
1: b'%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:1: Cannot find include file: opcode.vh\n`include "opcode.vh" \n         ^~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/452648646/src,data/full_repos/permissive/452648646/opcode.vh\n             data/full_repos/permissive/452648646/src,data/full_repos/permissive/452648646/opcode.vh.v\n             data/full_repos/permissive/452648646/src,data/full_repos/permissive/452648646/opcode.vh.sv\n             opcode.vh\n             opcode.vh.v\n             opcode.vh.sv\n             obj_dir/opcode.vh\n             obj_dir/opcode.vh.v\n             obj_dir/opcode.vh.sv\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:13: Define or directive not defined: \'`FUNCT3_BEQ\'\n        `FUNCT3_BEQ: begin\n        ^~~~~~~~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:13: syntax error, unexpected \':\', expecting endcase\n        `FUNCT3_BEQ: begin\n                   ^\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:16: Define or directive not defined: \'`FUNCT3_BNE\'\n        `FUNCT3_BNE: begin\n        ^~~~~~~~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:16: syntax error, unexpected begin, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n        `FUNCT3_BNE: begin\n                     ^~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:19: Define or directive not defined: \'`FUNCT3_BLT\'\n        `FUNCT3_BLT: begin\n        ^~~~~~~~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:19: syntax error, unexpected begin, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n        `FUNCT3_BLT: begin\n                     ^~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:22: Define or directive not defined: \'`FUNCT3_BGE\'\n        `FUNCT3_BGE: begin\n        ^~~~~~~~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:22: syntax error, unexpected begin, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n        `FUNCT3_BGE: begin\n                     ^~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:25: Define or directive not defined: \'`FUNCT3_BLTU\'\n        `FUNCT3_BLTU: begin\n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:25: syntax error, unexpected begin, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n        `FUNCT3_BLTU: begin\n                      ^~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:28: Define or directive not defined: \'`FUNCT3_BGEU\'\n        `FUNCT3_BGEU: begin\n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:28: syntax error, unexpected begin, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n        `FUNCT3_BGEU: begin\n                      ^~~~~\n%Error: data/full_repos/permissive/452648646/src/branch_evaluator.v:31: syntax error, unexpected \':\', expecting clocking\n        default: result = 1\'bx;\n               ^\n%Error: Exiting due to 14 error(s)\n'
module branch_evaluator (
    input wire [2:0] funct3,
    input wire [31:0] a,
    input wire [31:0] b,
    output reg result,
    output wire error
);

always @(funct3, a, b) begin
    case (funct3)
        `FUNCT3_BEQ: begin
            result = a == b;
        end
        `FUNCT3_BNE: begin
            result = a != b;
        end
        `FUNCT3_BLT: begin
            result = $signed(a) < $signed(b);
        end
        `FUNCT3_BGE: begin
            result = $signed(a) >= $signed(b);
        end
        `FUNCT3_BLTU: begin
            result = a < b;
        end
        `FUNCT3_BGEU: begin
            result = a >= b;
        end
        default: result = 1'bx;
    endcase
end

assign error = (funct3 == 3'b010 || funct3 == 3'b011);

endmodule
module branch_evaluator (
    input wire [2:0] funct3,
    input wire [31:0] a,
    input wire [31:0] b,
    output reg result,
    output wire error
);


always @(funct3, a, b) begin
    case (funct3)
        `FUNCT3_BEQ: begin
            result = a == b;
        end
        `FUNCT3_BNE: begin
            result = a != b;
        end
        `FUNCT3_BLT: begin
            result = $signed(a) < $signed(b);
        end
        `FUNCT3_BGE: begin
            result = $signed(a) >= $signed(b);
        end
        `FUNCT3_BLTU: begin
            result = a < b;
        end
        `FUNCT3_BGEU: begin
            result = a >= b;
        end
        default: result = 1'bx;
    endcase
end

assign error = (funct3 == 3'b010 || funct3 == 3'b011);

endmodule