From 086b2a53983efe7a289cc82ff4d5a851325df3bb Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Thu, 18 Jan 2024 18:12:49 -0800 Subject: [PATCH] Clean up uncoalescer -> respQueue doc --- .../scala/radiance/memory/Coalescing.scala | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/scala/radiance/memory/Coalescing.scala b/src/main/scala/radiance/memory/Coalescing.scala index c0aa2bf..a932914 100644 --- a/src/main/scala/radiance/memory/Coalescing.scala +++ b/src/main/scala/radiance/memory/Coalescing.scala @@ -1076,18 +1076,26 @@ class CoalescingUnitImp(outer: CoalescingUnit, config: CoalescerConfig) // Connect lookup result from InflightTable uncoalescer.io.inflightLookup <> inflightTable.io.lookup // InflightTable IO: Look up the table with incoming coalesced responses - // FIXME: this should be done inside uncoalescer + // @cleanup: this should be done inside uncoalescer inflightTable.io.lookupSourceId := tlCoal.d.bits.source // Connect uncoalescer results back into response queue - (respQueues zip uncoalescer.io.respQueueIO).foreach { case (q, uncoalEnqs) => + (respQueues zip uncoalescer.io.respQueueIO).zipWithIndex.foreach + { case ((q, sameLaneUncoalResps), lane) => + // reqQueueDepth here is the maximum number of same-lane, different-time + // requests that can go into a single coalesced response. We need to have + // that many enq ports to not backpressure the uncoalescer. require(q.io.enq.length == config.reqQueueDepth + respQueueUncoalPortOffset, s"wrong number of enq ports for MultiPort response queue") // slice the ports reserved for uncoalesced response - val qUncoalEnqs = q.io.enq.slice(respQueueUncoalPortOffset, q.io.enq.length) - (qUncoalEnqs zip uncoalEnqs).foreach { - case (enq, uncoalEnq) => { - enq <> uncoalEnq + val sameLaneEnqPorts = q.io.enq.slice(respQueueUncoalPortOffset, q.io.enq.length) + (sameLaneEnqPorts zip sameLaneUncoalResps).foreach { + case (enqPort, uncoalResp) => { + enqPort <> uncoalResp + // assert( + // enqPort.ready, + // cf"respQueue: enq port for uncoalesced response is blocked on lane $lane" + // ) } } }