Change inflight table entry to per-lane and per-srcId

This commit is contained in:
Hansung Kim
2023-03-19 02:08:17 -07:00
parent 08ce7dc57d
commit 9f5b77145b

View File

@@ -140,25 +140,22 @@ class CoalescingUnit(numLanes: Int = 1)(implicit p: Parameters)
tlCoal.d.ready := true.B tlCoal.d.ready := true.B
tlCoal.e.valid := false.B tlCoal.e.valid := false.B
// Populate inflight coalesced request table for use in un-coalescing // Construct new entry for the inflight table
// responses back to the individual lanes that they originated from. val inflightCoalReqTable = Module(
val inflightCoalReqTableEntry = new InflightCoalReqTable(numLanes, sourceWidth, numInflightCoalRequests)
new InflightCoalReqTableEntry(numLanes, sourceWidth) )
val inflightCoalReqTable = val tableEntry = Wire(inflightCoalReqTable.entryT)
Module(
new InflightCoalReqTable(numLanes, sourceWidth, numInflightCoalRequests)
)
val tableEntry = Wire(inflightCoalReqTableEntry)
tableEntry.respSourceId := coalSourceId tableEntry.respSourceId := coalSourceId
// TODO: bogus fromLane. Take the lowest numLane bits off of coalSourceId tableEntry.lanes.foreach { l =>
tableEntry.fromLane := coalSourceId & ((2 << numLanes) - 1).U l.foreach { perLaneReq =>
// FIXME: I'm positive this is not the right way to do this // TODO: this part needs the actual coalescing logic to work
tableEntry.reqSourceIds(0) := 0.U perLaneReq.offset := 2.U
tableEntry.reqSourceIds(1) := 0.U perLaneReq.size := 2.U
tableEntry.reqSourceIds(2) := 0.U }
tableEntry.reqSourceIds(3) := 0.U }
dontTouch(tableEntry) dontTouch(tableEntry)
// Populate inflight coalesced request table
inflightCoalReqTable.io.enq.valid := coalReqValid inflightCoalReqTable.io.enq.valid := coalReqValid
inflightCoalReqTable.io.enq.bits := tableEntry inflightCoalReqTable.io.enq.bits := tableEntry
@@ -203,11 +200,13 @@ class InflightCoalReqTable(
val sourceWidth: Int, val sourceWidth: Int,
val entries: Int val entries: Int
) extends Module { ) extends Module {
private val inflightCoalReqEntryT = val offsetBits = 4 // FIXME
new InflightCoalReqTableEntry(numLanes, sourceWidth) val sizeBits = 2 // FIXME
val entryT =
new InflightCoalReqTableEntry(numLanes, sourceWidth, offsetBits, sizeBits)
val io = IO(new Bundle { val io = IO(new Bundle {
val enq = Flipped(EnqIO(inflightCoalReqEntryT)) val enq = Flipped(EnqIO(entryT))
val lookup = Decoupled(UInt(sourceWidth.W)) val lookup = Decoupled(UInt(sourceWidth.W))
// TODO: put this inside decoupledIO // TODO: put this inside decoupledIO
val lookupSourceId = Input(UInt(sourceWidth.W)) val lookupSourceId = Input(UInt(sourceWidth.W))
@@ -217,7 +216,12 @@ class InflightCoalReqTable(
entries, entries,
new Bundle { new Bundle {
val valid = Bool() val valid = Bool()
val bits = new InflightCoalReqTableEntry(numLanes, sourceWidth) val bits = new InflightCoalReqTableEntry(
numLanes,
sourceWidth,
offsetBits,
sizeBits
)
} }
) )
@@ -298,17 +302,20 @@ class InflightCoalReqTable(
dontTouch(matchIndex) dontTouch(matchIndex)
} }
class InflightCoalReqTableEntry(val numLanes: Int, val sourceWidth: Int) class InflightCoalReqTableEntry(
extends Bundle { val numLanes: Int,
val sourceWidth: Int,
val offsetBits: Int,
val sizeBits: Int
) extends Bundle {
class PerLaneRequest extends Bundle {
val offset = UInt(offsetBits.W)
val size = UInt(sizeBits.W)
}
// sourceId of the coalesced response that just came back. This will be the // sourceId of the coalesced response that just came back. This will be the
// key that queries the table. // key that queries the table.
val respSourceId = UInt(sourceWidth.W) val respSourceId = UInt(sourceWidth.W)
// Bit flags that show which lanes got coalesced into this request val lanes = Vec(numLanes, Vec(1 << sourceWidth, new PerLaneRequest))
val fromLane = UInt(numLanes.W)
// sourceId of the original requests before getting coalesced. We need to
// remember this in order to answer the right outstanding TL request on each
// lane.
val reqSourceIds = Vec(numLanes, UInt(sourceWidth.W))
} }
class MemTraceDriver(numLanes: Int = 1)(implicit p: Parameters) class MemTraceDriver(numLanes: Int = 1)(implicit p: Parameters)