提交 decb8203 编写于 作者: L Lingrui98

FoldedSRAMTemplate: hold ridx when holdRead is set

上级 e5597226
......@@ -180,7 +180,9 @@ class FoldedSRAMTemplate[T <: Data](gen: T, set: Int, width: Int = 4, way: Int =
val rdata = array.io.r.resp.data
for (w <- 0 until way) {
val wayData = VecInit(rdata.indices.filter(_ % way == w).map(rdata(_)))
io.r.resp.data(w) := Mux1H(UIntToOH(ridx, width), wayData)
val holdRidx = HoldUnless(ridx, RegNext(io.r.req.valid))
val realRidx = if (holdRead) holdRidx else ridx
io.r.resp.data(w) := Mux1H(UIntToOH(realRidx, width), wayData)
}
val wen = io.w.req.valid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册