data/full_repos/permissive/115074071/src/main/Datapath/Branch.v
1: b'%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:1: Cannot find include file: src/main/Define/op_def.v\n`include "src/main/Define/op_def.v" \n         ^~~~~~~~~~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/115074071/src/main/Datapath,data/full_repos/permissive/115074071/src/main/Define/op_def.v\n             data/full_repos/permissive/115074071/src/main/Datapath,data/full_repos/permissive/115074071/src/main/Define/op_def.v.v\n             data/full_repos/permissive/115074071/src/main/Datapath,data/full_repos/permissive/115074071/src/main/Define/op_def.v.sv\n             src/main/Define/op_def.v\n             src/main/Define/op_def.v.v\n             src/main/Define/op_def.v.sv\n             obj_dir/src/main/Define/op_def.v\n             obj_dir/src/main/Define/op_def.v.v\n             obj_dir/src/main/Define/op_def.v.sv\n%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:18: Define or directive not defined: \'`OP_BEQ\'\n            `OP_BEQ     :   BranchSucceed = SrcA            == SrcB    ? 1 : 0;\n            ^~~~~~~\n%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:18: syntax error, unexpected \':\', expecting endcase\n            `OP_BEQ     :   BranchSucceed = SrcA            == SrcB    ? 1 : 0;\n                        ^\n%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:19: Define or directive not defined: \'`OP_BNE\'\n            `OP_BNE     :   BranchSucceed = SrcA            != SrcB    ? 1 : 0;\n            ^~~~~~~\n%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:20: Define or directive not defined: \'`OP_BLEZ\'\n            `OP_BLEZ    :   BranchSucceed = $signed(SrcA)   <= 0       ? 1 : 0;\n            ^~~~~~~~\n%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:21: Define or directive not defined: \'`OP_BGTZ\'\n            `OP_BGTZ    :   BranchSucceed = $signed(SrcA)   >  0       ? 1 : 0;\n            ^~~~~~~~\n%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:22: Define or directive not defined: \'`OP_BLTZ\'\n            `OP_BLTZ, `OP_BGEZ  : begin\n            ^~~~~~~~\n%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:22: Define or directive not defined: \'`OP_BGEZ\'\n            `OP_BLTZ, `OP_BGEZ  : begin\n                      ^~~~~~~~\n%Error: data/full_repos/permissive/115074071/src/main/Datapath/Branch.v:28: syntax error, unexpected \':\', expecting clocking\n            default: BranchSucceed = 0;\n                   ^\n%Error: Cannot continue\n'
module Branch(
    input           clk,
    input   [31:0]  SrcA,
    input   [31:0]  SrcB,
    input   [5:0]   OP,
    input   [4:0]   Branch_funct,
    output  reg     BranchSucceed
);

    initial begin
        BranchSucceed = 0;
    end

    always@(negedge clk) begin
        $display("Branch ------ SrcA: %x", SrcA);
        case (OP)
            `OP_BEQ     :   BranchSucceed = SrcA            == SrcB    ? 1 : 0;
            `OP_BNE     :   BranchSucceed = SrcA            != SrcB    ? 1 : 0;
            `OP_BLEZ    :   BranchSucceed = $signed(SrcA)   <= 0       ? 1 : 0;
            `OP_BGTZ    :   BranchSucceed = $signed(SrcA)   >  0       ? 1 : 0;
            `OP_BLTZ, `OP_BGEZ  : begin
                    if (Branch_funct == 5'b00000)
                            BranchSucceed = $signed(SrcA)   <  0       ? 1 : 0;
                    else
                            BranchSucceed = $signed(SrcA)   >= 0       ? 1 : 0;
            end
            default: BranchSucceed = 0;
        endcase
        if(BranchSucceed)
            $display("JUMPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    end

endmodule
module Branch(
    input           clk,
    input   [31:0]  SrcA,
    input   [31:0]  SrcB,
    input   [5:0]   OP,
    input   [4:0]   Branch_funct,
    output  reg     BranchSucceed
);


    initial begin
        BranchSucceed = 0;
    end

    always@(negedge clk) begin
        $display("Branch ------ SrcA: %x", SrcA);
        case (OP)
            `OP_BEQ     :   BranchSucceed = SrcA            == SrcB    ? 1 : 0;
            `OP_BNE     :   BranchSucceed = SrcA            != SrcB    ? 1 : 0;
            `OP_BLEZ    :   BranchSucceed = $signed(SrcA)   <= 0       ? 1 : 0;
            `OP_BGTZ    :   BranchSucceed = $signed(SrcA)   >  0       ? 1 : 0;
            `OP_BLTZ, `OP_BGEZ  : begin
                    if (Branch_funct == 5'b00000)
                            BranchSucceed = $signed(SrcA)   <  0       ? 1 : 0;
                    else
                            BranchSucceed = $signed(SrcA)   >= 0       ? 1 : 0;
            end
            default: BranchSucceed = 0;
        endcase
        if(BranchSucceed)
            $display("JUMPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    end

endmodule