1
0

bugfix where an in-progress acquire can be blocked by another acquire tracker being free'd up in between

This commit is contained in:
Yunsup Lee 2015-03-16 18:47:16 -07:00
parent cf1df2d72a
commit 145e15701e

View File

@ -364,23 +364,28 @@ class TSHRFile(bankId: Int) extends L2HellaCacheModule
(trackerList.map(_.io.incoherent) :+ wb.io.incoherent).map( _ := io.incoherent.toBits) (trackerList.map(_.io.incoherent) :+ wb.io.incoherent).map( _ := io.incoherent.toBits)
// Handle acquire transaction initiation // Handle acquire transaction initiation
val alloc_arb = Module(new Arbiter(Bool(), trackerList.size))
val trackerAcquireIOs = trackerList.map(_.io.inner.acquire) val trackerAcquireIOs = trackerList.map(_.io.inner.acquire)
val alloc_arb = Module(new Arbiter(Bool(), trackerList.size))
alloc_arb.io.out.ready := Bool(true)
trackerAcquireIOs.zip(alloc_arb.io.in).foreach {
case(tracker, arb) =>
arb.valid := tracker.ready
}
val alloc_idx = Vec(alloc_arb.io.in.map(_.ready)).lastIndexWhere{b: Bool => b}
val acquireMatchList = trackerList.map(_.io.has_acquire_match) val acquireMatchList = trackerList.map(_.io.has_acquire_match)
val any_acquire_matches = acquireMatchList.reduce(_||_) val any_acquire_matches = acquireMatchList.reduce(_||_)
val alloc_idx = Vec(alloc_arb.io.in.map(_.ready)).lastIndexWhere{b: Bool => b}
val match_idx = Vec(acquireMatchList).indexWhere{b: Bool => b} val match_idx = Vec(acquireMatchList).indexWhere{b: Bool => b}
val acquire_idx = Mux(any_acquire_matches, match_idx, alloc_idx) val acquire_idx = Mux(any_acquire_matches, match_idx, alloc_idx)
trackerAcquireIOs.zip(alloc_arb.io.in).zipWithIndex.foreach {
case((tracker, arb), i) =>
arb.valid := tracker.ready
tracker.bits := io.inner.acquire.bits
tracker.valid := arb.ready && (acquire_idx === UInt(i))
}
val block_acquires = trackerList.map(_.io.has_acquire_conflict).reduce(_||_) val block_acquires = trackerList.map(_.io.has_acquire_conflict).reduce(_||_)
io.inner.acquire.ready := trackerAcquireIOs.map(_.ready).reduce(_||_) && io.inner.acquire.ready := trackerAcquireIOs.map(_.ready).reduce(_||_) && !block_acquires
!block_acquires trackerAcquireIOs.zipWithIndex.foreach {
alloc_arb.io.out.ready := io.inner.acquire.valid && !block_acquires case(tracker, i) =>
tracker.bits := io.inner.acquire.bits
tracker.valid := io.inner.acquire.valid && !block_acquires && (acquire_idx === UInt(i))
}
// Wire releases from clients // Wire releases from clients
val release_idx = Vec(trackerList.map(_.io.has_release_match) :+ val release_idx = Vec(trackerList.map(_.io.has_release_match) :+