Working store and load.
This commit is contained in:
parent
f7c93b1292
commit
39a6c5f87e
1 changed files with 8 additions and 3 deletions
|
@ -40,14 +40,19 @@ class MemoryFetch() extends MultiIOModule {
|
||||||
/**
|
/**
|
||||||
* Your code here.
|
* Your code here.
|
||||||
*/
|
*/
|
||||||
DMEM.io.dataIn := io.writeData
|
|
||||||
DMEM.io.dataAddress := io.ALUResult
|
|
||||||
DMEM.io.writeEnable := io.writeMem
|
|
||||||
|
|
||||||
// ALUResult is one cycle early!
|
// ALUResult is one cycle early!
|
||||||
val ALUResult = RegInit(UInt(32.W), 0.U)
|
val ALUResult = RegInit(UInt(32.W), 0.U)
|
||||||
ALUResult := io.ALUResult
|
ALUResult := io.ALUResult
|
||||||
|
|
||||||
|
DMEM.io.dataIn := io.writeData
|
||||||
|
DMEM.io.writeEnable := io.writeMem
|
||||||
|
|
||||||
|
when(io.writeMem) {
|
||||||
|
DMEM.io.dataAddress := ALUResult
|
||||||
|
}.otherwise(DMEM.io.dataAddress := io.ALUResult)
|
||||||
|
|
||||||
|
|
||||||
when(io.readMem) {
|
when(io.readMem) {
|
||||||
io.dataOut := DMEM.io.dataOut
|
io.dataOut := DMEM.io.dataOut
|
||||||
}.otherwise(io.dataOut := ALUResult)
|
}.otherwise(io.dataOut := ALUResult)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue