Fix d$ invalidation when the mmu is enabled

This commit is contained in:
Dolu1990 2023-02-22 13:15:57 +01:00
parent 15a665af53
commit 220b599c9a
1 changed files with 11 additions and 9 deletions

View File

@ -1063,6 +1063,7 @@ class DataCache(val p : DataCacheConfig, mmuParameter : MemoryTranslatorBusParam
}
//remove side effects on exceptions
when(io.cpu.writeBack.isValid) {
when(consistancyHazard || mmuRsp.refilling || io.cpu.writeBack.accessError || io.cpu.writeBack.mmuException || io.cpu.writeBack.unalignedAccess) {
io.mem.cmd.valid := False
tagsWriteCmd.valid := False
@ -1072,7 +1073,8 @@ class DataCache(val p : DataCacheConfig, mmuParameter : MemoryTranslatorBusParam
if (withInternalLrSc) lrSc.reserved := lrSc.reserved
if (withExternalAmo) amo.external.state := LR_CMD
}
io.cpu.redo setWhen(io.cpu.writeBack.isValid && (mmuRsp.refilling || consistancyHazard))
io.cpu.redo setWhen((mmuRsp.refilling || consistancyHazard))
}
assert(!(io.cpu.writeBack.isValid && !io.cpu.writeBack.haltIt && io.cpu.writeBack.isStuck), "writeBack stuck by another plugin is not allowed", ERROR)
}