diff options
author | Adrian Herrera <adrian.herrera@arm.com> | 2019-06-18 12:22:15 +0100 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-06-26 11:58:55 +0000 |
commit | 09bc8b6f1177df5fe5de9d2984781cc1fb8b75b4 (patch) | |
tree | 8c893a818582d1fb1b06e269159124c6c9fb9ba2 /src/dev/arm/smmu_v3_transl.cc | |
parent | af8d107191cc69a77624e2af34f108dc9c1ff03f (diff) | |
download | gem5-09bc8b6f1177df5fe5de9d2984781cc1fb8b75b4.tar.xz |
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>
Diffstat (limited to 'src/dev/arm/smmu_v3_transl.cc')
-rw-r--r-- | src/dev/arm/smmu_v3_transl.cc | 23 |
1 files changed, 18 insertions, 5 deletions
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; |