`timescale 1ns / 1ps
module HazardUnit (
    input [1:0] PC_jump,
    input is_loadword,
    input PC_branch,
    output IFID_source,
    output IDEX_source,
    output IF_need_stall
);

wire is_jump;
assign is_jump = PC_jump == 2'b01 || PC_jump == 2'b10;

assign IFID_source = (PC_branch == 1'b1 || is_jump == 1'b1 || is_loadword == 1'b1) ? 1'b1 : 1'b0;

assign IDEX_source = (PC_branch == 1'b1 || is_jump == 1'b1) ? 1'b1 : 1'b0;

assign IF_need_stall = (is_loadword == 1'b1) ? 1'b1 : 1'b0;
endmodule
