dev-arm: pending SMMU transl update on constructor/destructor

Change-Id: I6f61651123aab129cfbe5a88aa6355cd21544a5e
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19308
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Adrian Herrera
2019-06-18 12:22:15 +01:00
committed by Giacomo Travaglini
parent af8d107191
commit 09bc8b6f11
3 changed files with 20 additions and 16 deletions

View File

@@ -157,7 +157,6 @@ SMMUv3SlaveInterface::recvTimingReq(PacketPtr pkt)
return false;
}
xlateSlotsRemaining--;
if (pkt->isWrite())
wrBufSlotsRemaining -= nbeats;
@@ -203,8 +202,6 @@ SMMUv3SlaveInterface::atsSlaveRecvTimingReq(PacketPtr pkt)
return false;
}
xlateSlotsRemaining--;
std::string proc_name = csprintf("%s.atsport", name());
const bool ats_request = true;
SMMUTranslationProcess *proc =

View File

@@ -78,6 +78,24 @@ SMMUTranslRequest::prefetch(Addr addr, uint32_t sid, uint32_t ssid)
return req;
}
SMMUTranslationProcess::SMMUTranslationProcess(const std::string &name,
SMMUv3 &_smmu, SMMUv3SlaveInterface &_ifc)
:
SMMUProcess(name, _smmu),
ifc(_ifc)
{
// Decrease number of pending translation slots on the slave interface
assert(ifc.xlateSlotsRemaining > 0);
ifc.xlateSlotsRemaining--;
reinit();
}
SMMUTranslationProcess::~SMMUTranslationProcess()
{
// Increase number of pending translation slots on the slave interface
ifc.xlateSlotsRemaining++;
}
void
SMMUTranslationProcess::beginTransaction(const SMMUTranslRequest &req)
{
@@ -1173,8 +1191,6 @@ SMMUTranslationProcess::issuePrefetch(Addr addr)
if (!ifc.prefetchEnable || ifc.xlateSlotsRemaining == 0)
return;
ifc.xlateSlotsRemaining--;
std::string proc_name = csprintf("%sprf", name());
SMMUTranslationProcess *proc =
new SMMUTranslationProcess(proc_name, smmu, ifc);
@@ -1201,7 +1217,6 @@ SMMUTranslationProcess::completeTransaction(Yield &yield,
smmu.translationTimeDist.sample(curTick() - recvTick);
ifc.xlateSlotsRemaining++;
if (!request.isAtsRequest && request.isWrite)
ifc.wrBufSlotsRemaining +=
(request.size + (ifc.portWidth-1)) / ifc.portWidth;
@@ -1249,8 +1264,6 @@ SMMUTranslationProcess::completeTransaction(Yield &yield,
void
SMMUTranslationProcess::completePrefetch(Yield &yield)
{
ifc.xlateSlotsRemaining++;
SMMUAction a;
a.type = ACTION_TERMINATE;
a.pkt = NULL;

View File

@@ -173,15 +173,9 @@ class SMMUTranslationProcess : public SMMUProcess
public:
SMMUTranslationProcess(const std::string &name, SMMUv3 &_smmu,
SMMUv3SlaveInterface &_ifc)
:
SMMUProcess(name, _smmu),
ifc(_ifc)
{
reinit();
}
SMMUv3SlaveInterface &_ifc);
virtual ~SMMUTranslationProcess() {}
virtual ~SMMUTranslationProcess();
void beginTransaction(const SMMUTranslRequest &req);
void resumeTransaction();