Avoid stall when actual branch

This commit is contained in:
2024-07-12 00:17:33 +08:00
parent ee78aabc48
commit c8a110e740

View File

@@ -26,7 +26,9 @@ module InstFetch (
if (reset) begin
PC <= 32'h00000000;
end else begin
if (need_stall) begin
// Note: if the inst is branch followed by a load word, the stall of the load word
// will prevent the branch from jump
if (need_stall == 1'h1 && PC_branch == 1'h0) begin
PC <= PC;
end else begin
if (PC_branch) begin