data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v
1: b'%Error: data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v:2: Cannot find include file: defines.vh\n`include "defines.vh" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new,data/full_repos/permissive/433174928/defines.vh\n             data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new,data/full_repos/permissive/433174928/defines.vh.v\n             data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new,data/full_repos/permissive/433174928/defines.vh.sv\n             defines.vh\n             defines.vh.v\n             defines.vh.sv\n             obj_dir/defines.vh\n             obj_dir/defines.vh.v\n             obj_dir/defines.vh.sv\n%Error: data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v:17: Define or directive not defined: \'`BEQ\'\n            `BEQ:\n            ^~~~\n%Error: data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v:17: syntax error, unexpected \':\', expecting endcase\n            `BEQ:\n                ^\n%Error: data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v:19: Define or directive not defined: \'`BNE\'\n            `BNE:\n            ^~~~\n%Error: data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v:21: Define or directive not defined: \'`BLT\'\n            `BLT:\n            ^~~~\n%Error: data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v:23: Define or directive not defined: \'`BGE\'\n            `BGE:\n            ^~~~\n%Error: data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v:25: Define or directive not defined: \'`BLTU\'\n            `BLTU:\n            ^~~~~\n%Error: data/full_repos/permissive/433174928/Project_Vivado/Project_Vivado.srcs/sources_1/new/BranComp.v:27: Define or directive not defined: \'`BGEU\'\n            `BGEU:\n            ^~~~~\n%Error: Cannot continue\n'
module BranComp(
    input wire [2:0] bc_op,
    input wire [31:0] data_in1,
    input wire [31:0] data_in2,
    output wire bc_out
    );
    
    reg result = 0;
    
    always@(*) begin
        case(bc_op)
            `BEQ:
                result <= (data_in1==data_in2) ? 1:0;
            `BNE:
                result <= (data_in1==data_in2) ? 0:1;
            `BLT:
                result <= ($signed(data_in1) < $signed(data_in2)) ? 1 :0;
            `BGE:
                result <= ($signed(data_in1) < $signed(data_in2)) ? 0 :1;
            `BLTU:
                result <= (data_in1 < data_in2)? 1:0;
            `BGEU:
                result <= (data_in1 < data_in2)? 0:1;
             default:
                result <= result;
        endcase
    end
    
    assign bc_out = result;
    
endmodule
module BranComp(
    input wire [2:0] bc_op,
    input wire [31:0] data_in1,
    input wire [31:0] data_in2,
    output wire bc_out
    );

    
    reg result = 0;
    
    always@(*) begin
        case(bc_op)
            `BEQ:
                result <= (data_in1==data_in2) ? 1:0;
            `BNE:
                result <= (data_in1==data_in2) ? 0:1;
            `BLT:
                result <= ($signed(data_in1) < $signed(data_in2)) ? 1 :0;
            `BGE:
                result <= ($signed(data_in1) < $signed(data_in2)) ? 0 :1;
            `BLTU:
                result <= (data_in1 < data_in2)? 1:0;
            `BGEU:
                result <= (data_in1 < data_in2)? 0:1;
             default:
                result <= result;
        endcase
    end
    
    assign bc_out = result;
    
endmodule