fix(fu): 修改地址前递逻辑

This commit is contained in:
Liphen 2024-01-21 13:51:46 +08:00
parent c6d8f9ed8f
commit 2a09884e0f
1 changed files with 7 additions and 1 deletions

View File

@ -86,5 +86,11 @@ class Fu(implicit val cpuConfig: CpuConfig) extends Module {
io.inst(i).src_info.src1_data + io.inst(i).info.imm
)
)
io.dataMemory.addr := Mux(io.inst(0).info.fusel === FuType.lsu, mem_addr(0), mem_addr(1))
// 当mem级访存发生stall时mem_addr_last不变
val mem_addr_last = RegEnable(io.dataMemory.addr, io.ctrl.allow_to_go)
io.dataMemory.addr := Mux(
!io.ctrl.allow_to_go,
mem_addr_last,
Mux(io.inst(0).info.fusel === FuType.lsu, mem_addr(0), mem_addr(1))
)
}