Add single cycle stall to branching.

This commit is contained in:
Sebastian Bugge 2024-11-12 12:28:38 +01:00
parent 9e12c60d27
commit e0b6634a93
Signed by: kaholaz
GPG key ID: 2EFFEDEE03519691
2 changed files with 4 additions and 14 deletions

View file

@ -20,22 +20,12 @@ class IFBarrier extends MultiIOModule {
val instruction = Reg(new Instruction)
val replay = RegInit(Bool(), false.B)
val flushRemaining = RegInit(UInt(2.W), 0.U)
flushRemaining := Mux(
io.flush,
1.U,
Mux(
flushRemaining === 0.U,
0.U,
flushRemaining - 1.U
)
)
replay := io.stall
instruction := io.instructionIn
io.instructionOut := Mux(
io.stall || io.flush || flushRemaining > 0.U,
io.stall || io.flush,
Instruction.NOP,
Mux(
replay,