Add stall.
This commit is contained in:
parent
bcbe07b601
commit
1d433dd791
4 changed files with 29 additions and 7 deletions
|
@ -27,6 +27,7 @@ class InstructionFetch extends MultiIOModule {
|
|||
val instruction = Output(new Instruction)
|
||||
val branch = Input(Bool())
|
||||
val branchAddress = Input(UInt(32.W))
|
||||
val stall = Input(Bool())
|
||||
})
|
||||
|
||||
val IMEM = Module(new IMEM)
|
||||
|
@ -47,7 +48,7 @@ class InstructionFetch extends MultiIOModule {
|
|||
*/
|
||||
io.PC := PC
|
||||
IMEM.io.instructionAddress := PC
|
||||
PC := Mux(io.branch, io.branchAddress, PC + 4.U)
|
||||
PC := Mux(io.stall, PC, Mux(io.branch, io.branchAddress, PC + 4.U))
|
||||
|
||||
val instruction = Wire(new Instruction)
|
||||
instruction := IMEM.io.instruction.asTypeOf(new Instruction)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue