-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bohan Hu
committed
Nov 2, 2020
1 parent
a95d4c5
commit 47e2467
Showing
3 changed files
with
49 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package core | ||
import chisel3._ | ||
|
||
class PipelineRegCtrl extends Bundle { | ||
val flush = Bool() | ||
val hold = Bool() | ||
} | ||
|
||
class PipelineCtrlReq extends Bundle { | ||
val flush = Bool() | ||
val hold = Bool() | ||
} | ||
|
||
class PipelineCtrlIO extends Bundle { | ||
val toIFID = Output(new PipelineRegCtrl) | ||
val toIDEX = Output(new PipelineRegCtrl) | ||
val toEXWB = Output(new PipelineRegCtrl) | ||
val fromEX = Input(new PipelineCtrlReq) | ||
val fromWB = Input(new PipelineCtrlReq) | ||
} | ||
|
||
// IFU's hold and flush be handled by redir from FU | ||
// EXU's flush be handled by its own fsm | ||
|
||
class PipelineCtrl extends Module { | ||
val io = IO(new PipelineCtrlIO) | ||
// Handle the flush request from WB, EX | ||
when(io.fromEX.flush) { | ||
io.toIFID.flush := true.B | ||
io.toIDEX.flush := true.B | ||
} | ||
when(io.fromWB.flush) { | ||
io.toIFID.flush := true.B | ||
io.toIDEX.flush := true.B | ||
// We need to handle the flush to FU: MDU, LSU, when flush comes, don't start the fsm | ||
io.toEXWB.flush := true.B | ||
} | ||
|
||
when(io.fromEX.hold) { | ||
io.toIFID.hold := true.B | ||
io.toIDEX.hold := true.B | ||
} | ||
when(io.fromWB.flush) { | ||
io.toIFID.flush := true.B | ||
io.toIDEX.flush := true.B | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.