Use MUX instead of when.

This commit is contained in:
Sebastian Bugge 2024-09-27 08:49:36 +02:00
parent abef04fc22
commit e09a358320
Signed by: kaholaz
GPG key ID: 2EFFEDEE03519691

View file

@ -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)
}