portWidth(p->port_width),
wrBufSlotsRemaining(p->wrbuf_slots),
xlateSlotsRemaining(p->xlate_slots),
+ pendingMemAccesses(0),
prefetchEnable(p->prefetch_enable),
prefetchReserveLastWay(
p->prefetch_reserve_last_way),
unsigned wrBufSlotsRemaining;
unsigned xlateSlotsRemaining;
+ unsigned pendingMemAccesses;
const bool prefetchEnable;
const bool prefetchReserveLastWay;
// Decrease number of pending translation slots on the slave interface
assert(ifc.xlateSlotsRemaining > 0);
ifc.xlateSlotsRemaining--;
+
+ ifc.pendingMemAccesses++;
reinit();
}
SMMUTranslationProcess::~SMMUTranslationProcess()
{
// Increase number of pending translation slots on the slave interface
- ifc.xlateSlotsRemaining++;
- // If no more SMMU translations are pending (all slots available),
+ assert(ifc.pendingMemAccesses > 0);
+ ifc.pendingMemAccesses--;
+
+ // If no more SMMU memory accesses are pending,
// signal SMMU Slave Interface as drained
- if (ifc.xlateSlotsRemaining == ifc.params()->xlate_slots) {
+ if (ifc.pendingMemAccesses == 0) {
ifc.signalDrainDone();
}
}
smmu.translationTimeDist.sample(curTick() - recvTick);
+ ifc.xlateSlotsRemaining++;
if (!request.isAtsRequest && request.isWrite)
ifc.wrBufSlotsRemaining +=
(request.size + (ifc.portWidth-1)) / ifc.portWidth;
void
SMMUTranslationProcess::completePrefetch(Yield &yield)
{
+ ifc.xlateSlotsRemaining++;
+
SMMUAction a;
a.type = ACTION_TERMINATE;
a.pkt = NULL;