Use MUX instead of when.
This commit is contained in:
parent
abef04fc22
commit
e09a358320
1 changed files with 2 additions and 8 deletions
|
@ -48,12 +48,6 @@ class MemoryFetch() extends MultiIOModule {
|
|||
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) {
|
||||
io.dataOut := DMEM.io.dataOut
|
||||
}.otherwise(io.dataOut := ALUResult)
|
||||
DMEM.io.dataAddress := Mux(io.writeMem, ALUResult, io.ALUResult)
|
||||
io.dataOut := Mux(io.readMem, DMEM.io.dataOut, ALUResult)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue