Don't rely on SeqMem output after read-enable is low
This commit is contained in:
parent
190a8b9dd3
commit
e45b41b4b6
@ -59,9 +59,13 @@ class AXI4RAM(address: AddressSet, executable: Boolean = true, beatBytes: Int =
|
|||||||
r_id := in.ar.bits.id
|
r_id := in.ar.bits.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val ren = in.ar.fire()
|
||||||
|
def holdUnless[T <: Data](in : T, enable: Bool): T = Mux(!enable, RegEnable(in, enable), in)
|
||||||
|
val rdata = holdUnless(mem.read(r_addr, ren), RegNext(ren))
|
||||||
|
|
||||||
in.r.bits.id := r_id
|
in.r.bits.id := r_id
|
||||||
in.r.bits.resp := AXI4Parameters.RESP_OKAY
|
in.r.bits.resp := AXI4Parameters.RESP_OKAY
|
||||||
in.r.bits.data := Cat(mem.read(r_addr, in.ar.fire()).reverse)
|
in.r.bits.data := Cat(rdata.reverse)
|
||||||
in.r.bits.last := Bool(true)
|
in.r.bits.last := Bool(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,9 @@ class TLRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4)
|
|||||||
when (in.a.fire() && !read) {
|
when (in.a.fire() && !read) {
|
||||||
mem.write(memAddress, wdata, in.a.bits.mask.toBools)
|
mem.write(memAddress, wdata, in.a.bits.mask.toBools)
|
||||||
}
|
}
|
||||||
rdata := mem.read(memAddress, in.a.fire() && read)
|
val ren = in.a.fire() && read
|
||||||
|
def holdUnless[T <: Data](in : T, enable: Bool): T = Mux(!enable, RegEnable(in, enable), in)
|
||||||
|
rdata := holdUnless(mem.read(memAddress, ren), RegNext(ren))
|
||||||
|
|
||||||
// Tie off unused channels
|
// Tie off unused channels
|
||||||
in.b.valid := Bool(false)
|
in.b.valid := Bool(false)
|
||||||
|
Loading…
Reference in New Issue
Block a user