Almost working jump.
This commit is contained in:
parent
92d0dfd9eb
commit
323e373d0e
9 changed files with 89 additions and 35 deletions
|
@ -23,6 +23,8 @@ class MemoryFetch() extends MultiIOModule {
|
|||
val readMem = Input(Bool())
|
||||
val writeMem = Input(Bool())
|
||||
val dataOut = Output(UInt(32.W))
|
||||
val jump = Input(Bool())
|
||||
val returnAddr = Input(UInt(32.W))
|
||||
})
|
||||
|
||||
|
||||
|
@ -49,5 +51,5 @@ class MemoryFetch() extends MultiIOModule {
|
|||
DMEM.io.writeEnable := io.writeMem
|
||||
|
||||
DMEM.io.dataAddress := Mux(io.writeMem, ALUResult, io.ALUResult)
|
||||
io.dataOut := Mux(io.readMem, DMEM.io.dataOut, ALUResult)
|
||||
io.dataOut := Mux(io.readMem, DMEM.io.dataOut, Mux(io.jump, io.returnAddr, ALUResult))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue