From 09bc8b6f1177df5fe5de9d2984781cc1fb8b75b4 Mon Sep 17 00:00:00 2001 From: Adrian Herrera Date: Tue, 18 Jun 2019 12:22:15 +0100 Subject: dev-arm: pending SMMU transl update on constructor/destructor Change-Id: I6f61651123aab129cfbe5a88aa6355cd21544a5e Reviewed-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19308 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- src/dev/arm/smmu_v3_transl.cc | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/dev/arm/smmu_v3_transl.cc') diff --git a/src/dev/arm/smmu_v3_transl.cc b/src/dev/arm/smmu_v3_transl.cc index 4a3efc6d8..6e0dacb88 100644 --- a/src/dev/arm/smmu_v3_transl.cc +++ b/src/dev/arm/smmu_v3_transl.cc @@ -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; -- cgit v1.2.3