data/full_repos/permissive/444465810/func/axi/NPC.v
data/verilator_xmls/91d54ab3-66bb-4552-8f64-2e967d4991e2.xml
module NPC(
    input [31:0]PC,
    input [31:0]ImmB,
    input [25:0]ImmJ,
    input [31:0]Cmp1,
    input [31:0]Cmp2,
    input [2:0] CmpOp,
    output [31:0]Jump,
    output reg[31:0]Branch
);

assign Jump = {PC[31:28],ImmJ,2'b00};

always @(*)begin
    case(CmpOp)
    	0: Branch = ($signed(Cmp1) == $signed(Cmp2)) ? (PC + (ImmB << 2)) : (PC + 4);
		1: Branch = ($signed(Cmp1) != $signed(Cmp2)) ? (PC + (ImmB << 2)) : (PC + 4);
		2: Branch = ($signed(Cmp1) <= 0) ? (PC + (ImmB << 2)) : (PC + 4);
		3: Branch = ($signed(Cmp1) > 0) ? (PC + (ImmB << 2)) : (PC + 4);
		4: Branch = ($signed(Cmp1) < 0) ? (PC + (ImmB << 2)) : (PC + 4);
		5: Branch = ($signed(Cmp1) >= 0) ? (PC + (ImmB << 2)) : (PC + 4);
    endcase
end
endmodule
module NPC(
    input [31:0]PC,
    input [31:0]ImmB,
    input [25:0]ImmJ,
    input [31:0]Cmp1,
    input [31:0]Cmp2,
    input [2:0] CmpOp,
    output [31:0]Jump,
    output reg[31:0]Branch
);


assign Jump = {PC[31:28],ImmJ,2'b00};

always @(*)begin
    case(CmpOp)
    	0: Branch = ($signed(Cmp1) == $signed(Cmp2)) ? (PC + (ImmB << 2)) : (PC + 4);
		1: Branch = ($signed(Cmp1) != $signed(Cmp2)) ? (PC + (ImmB << 2)) : (PC + 4);
		2: Branch = ($signed(Cmp1) <= 0) ? (PC + (ImmB << 2)) : (PC + 4);
		3: Branch = ($signed(Cmp1) > 0) ? (PC + (ImmB << 2)) : (PC + 4);
		4: Branch = ($signed(Cmp1) < 0) ? (PC + (ImmB << 2)) : (PC + 4);
		5: Branch = ($signed(Cmp1) >= 0) ? (PC + (ImmB << 2)) : (PC + 4);
    endcase
end
endmodule