1
0

ahb: don't violate spec with SRAM fuzzing

This commit is contained in:
Wesley W. Terpstra 2016-12-14 14:53:54 -08:00
parent 1a0021b818
commit 9d50704b64

View File

@ -91,8 +91,13 @@ class AHBRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4
val muxdata = Vec((p_mask.toBools zip (p_wdata zip d_rdata)) val muxdata = Vec((p_mask.toBools zip (p_wdata zip d_rdata))
map { case (m, (p, r)) => Mux(d_bypass && m, p, r) }) map { case (m, (p, r)) => Mux(d_bypass && m, p, r) })
// Don't fuzz hready when not in data phase
val d_request = Reg(Bool(false))
when (in.hready) { d_request := Bool(false) }
when (a_request) { d_request := Bool(true) }
// Finally, the outputs // Finally, the outputs
in.hreadyout := LFSR16(Bool(true))(0) // Bool(true) in.hreadyout := !d_request || LFSR16(Bool(true))(0) // Bool(true)
in.hresp := AHBParameters.RESP_OKAY in.hresp := AHBParameters.RESP_OKAY
in.hrdata := Mux(in.hreadyout, muxdata.asUInt, UInt(0)) in.hrdata := Mux(in.hreadyout, muxdata.asUInt, UInt(0))
} }