From e04ee364de17c156ed8eab8823b409539cc4f584 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Mon, 9 Dec 2019 14:02:18 +0000 Subject: [PATCH] arch-arm: Using new "raw" memhelpers JIRA: https://gem5.atlassian.net/browse/GEM5-196 Change-Id: Ie5ea0fc845a8f6d77a5723bacaff25ba04562f9c Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23528 Reviewed-by: Nikos Nikoleris Tested-by: kokoro --- src/arch/arm/isa/templates/mem.isa | 21 +++++++++++----- src/arch/arm/isa/templates/mem64.isa | 8 ++++-- src/arch/arm/isa/templates/misc.isa | 6 +++-- src/arch/arm/isa/templates/neon64.isa | 18 +++++++++----- src/arch/arm/isa/templates/sve_mem.isa | 34 ++++++++++++++------------ 5 files changed, 55 insertions(+), 32 deletions(-) diff --git a/src/arch/arm/isa/templates/mem.isa b/src/arch/arm/isa/templates/mem.isa index 693d93ae3..b056f48e8 100644 --- a/src/arch/arm/isa/templates/mem.isa +++ b/src/arch/arm/isa/templates/mem.isa @@ -206,7 +206,10 @@ def template NeonLoadExecute {{ if (%(predicate_test)s) { if (fault == NoFault) { - fault = xc->readMem(EA, dataPtr, %(size)d, memAccessFlags); + const auto size = %(size)d; + fault = readMemAtomic(xc, EA, dataPtr, + size, memAccessFlags, + std::vector(size, true)); %(memacc_code)s; } @@ -277,8 +280,10 @@ def template NeonStoreExecute {{ } if (fault == NoFault) { - fault = xc->writeMem(dataPtr, %(size)d, EA, - memAccessFlags, NULL); + const auto size = %(size)d; + fault = writeMemAtomic(xc, dataPtr, EA, size, + memAccessFlags, NULL, + std::vector(size, true)); } if (fault == NoFault) { @@ -410,8 +415,10 @@ def template NeonStoreInitiateAcc {{ } if (fault == NoFault) { - fault = xc->writeMem(memUnion.bytes, %(size)d, EA, - memAccessFlags, NULL); + const auto size = %(size)d; + fault = writeMemTiming(xc, memUnion.bytes, EA, + size, memAccessFlags, nullptr, + std::vector(size, true)); } } else { xc->setPredicate(false); @@ -462,7 +469,9 @@ def template NeonLoadInitiateAcc {{ if (%(predicate_test)s) { if (fault == NoFault) { - fault = xc->initiateMemRead(EA, %(size)d, memAccessFlags); + const auto size = %(size)d; + fault = initiateMemRead(xc, EA, size, memAccessFlags, + std::vector(size, true)); } } else { xc->setPredicate(false); diff --git a/src/arch/arm/isa/templates/mem64.isa b/src/arch/arm/isa/templates/mem64.isa index ed43cd77a..3b90f8c3f 100644 --- a/src/arch/arm/isa/templates/mem64.isa +++ b/src/arch/arm/isa/templates/mem64.isa @@ -322,7 +322,9 @@ def template DCStore64Execute {{ } if (fault == NoFault) { - fault = xc->writeMem(NULL, op_size, EA, memAccessFlags, NULL); + fault = writeMemAtomic(xc, NULL, EA, + op_size, memAccessFlags, NULL, + std::vector(op_size, true)); } if (fault == NoFault) { @@ -349,7 +351,9 @@ def template DCStore64InitiateAcc {{ } if (fault == NoFault) { - fault = xc->writeMem(NULL, op_size, EA, memAccessFlags, NULL); + fault = writeMemTiming(xc, NULL, EA, op_size, + memAccessFlags, NULL, + std::vector(op_size, true)); } return fault; diff --git a/src/arch/arm/isa/templates/misc.isa b/src/arch/arm/isa/templates/misc.isa index c982e7515..51d833700 100644 --- a/src/arch/arm/isa/templates/misc.isa +++ b/src/arch/arm/isa/templates/misc.isa @@ -647,7 +647,8 @@ def template Mcr15Execute {{ if (fault == NoFault) { Addr op_size = xc->tcBase()->getSystemPtr()->cacheLineSize(); EA &= ~(op_size - 1); - fault = xc->writeMem(NULL, op_size, EA, memAccessFlags, NULL); + fault = writeMemAtomic(xc, NULL, EA, op_size, + memAccessFlags, NULL, std::vector(op_size, true)); } } else { xc->setPredicate(false); @@ -676,7 +677,8 @@ def template Mcr15InitiateAcc {{ if (fault == NoFault) { Addr op_size = xc->tcBase()->getSystemPtr()->cacheLineSize(); EA &= ~(op_size - 1); - fault = xc->writeMem(NULL, op_size, EA, memAccessFlags, NULL); + fault = writeMemTiming(xc, NULL, EA, op_size, + memAccessFlags, NULL, std::vector(op_size, true)); } } else { xc->setPredicate(false); diff --git a/src/arch/arm/isa/templates/neon64.isa b/src/arch/arm/isa/templates/neon64.isa index 5d30107b2..d281c95c8 100644 --- a/src/arch/arm/isa/templates/neon64.isa +++ b/src/arch/arm/isa/templates/neon64.isa @@ -287,7 +287,9 @@ def template NeonLoadExecute64 {{ uint8_t *dataPtr = memUnion.bytes; if (fault == NoFault) { - fault = xc->readMem(EA, dataPtr, accSize, memAccessFlags); + fault = readMemAtomic(xc, EA, dataPtr, + accSize, memAccessFlags, + std::vector(accSize, true)); %(memacc_code)s; } @@ -312,7 +314,9 @@ def template NeonLoadInitiateAcc64 {{ %(ea_code)s; if (fault == NoFault) { - fault = xc->initiateMemRead(EA, accSize, memAccessFlags); + fault = initiateMemRead(xc, EA, accSize, + memAccessFlags, + std::vector(accSize, true)); } return fault; @@ -364,8 +368,9 @@ def template NeonStoreExecute64 {{ } if (fault == NoFault) { - fault = xc->writeMem(dataPtr, accSize, EA, memAccessFlags, - NULL); + fault = writeMemAtomic(xc, dataPtr, EA, accSize, + memAccessFlags, nullptr, + std::vector(accSize, true)); } if (fault == NoFault) { @@ -394,8 +399,9 @@ def template NeonStoreInitiateAcc64 {{ } if (fault == NoFault) { - fault = xc->writeMem(memUnion.bytes, accSize, EA, memAccessFlags, - NULL); + fault = writeMemTiming(xc, memUnion.bytes, EA, + accSize, memAccessFlags, NULL, + std::vector(accSize, true)); } return fault; diff --git a/src/arch/arm/isa/templates/sve_mem.isa b/src/arch/arm/isa/templates/sve_mem.isa index fb306fca3..7d59908c2 100644 --- a/src/arch/arm/isa/templates/sve_mem.isa +++ b/src/arch/arm/isa/templates/sve_mem.isa @@ -155,8 +155,8 @@ def template SveContigLoadExecute {{ %(rden_code)s; - fault = xc->readMem(EA, memData.raw_ptr(), memAccessSize, - this->memAccessFlags, rdEn); + fault = readMemAtomic(xc, EA, memData.raw_ptr(), + memAccessSize, this->memAccessFlags, rdEn); %(fault_code)s; @@ -186,8 +186,8 @@ def template SveContigLoadInitiateAcc {{ %(rden_code)s; - fault = xc->initiateMemRead(EA, memAccessSize, this->memAccessFlags, - rdEn); + fault = initiateMemRead(xc, EA, memAccessSize, + this->memAccessFlags, rdEn); %(fault_code)s; @@ -247,8 +247,8 @@ def template SveContigStoreExecute {{ } if (fault == NoFault) { - fault = xc->writeMem(memData.raw_ptr(), memAccessSize, EA, - this->memAccessFlags, NULL, wrEn); + fault = writeMemAtomic(xc, memData.raw_ptr(), + EA, memAccessSize, this->memAccessFlags, NULL, wrEn); } if (fault == NoFault) { @@ -284,8 +284,8 @@ def template SveContigStoreInitiateAcc {{ } if (fault == NoFault) { - fault = xc->writeMem(memData.raw_ptr(), memAccessSize, EA, - this->memAccessFlags, NULL, wrEn); + fault = writeMemTiming(xc, memData.raw_ptr(), + EA, memAccessSize, this->memAccessFlags, NULL, wrEn); } return fault; @@ -945,8 +945,9 @@ def template SveStructLoadExecute {{ auto memDataView = memData.as(); if (fault == NoFault) { - fault = xc->readMem(EA, memData.raw_ptr(), memAccessSize, - this->memAccessFlags); + fault = readMemAtomic(xc, EA, memData.raw_ptr(), + memAccessSize, this->memAccessFlags, + std::vector(memAccessSize, true)); %(memacc_code)s; } @@ -975,8 +976,9 @@ def template SveStructLoadInitiateAcc {{ %(ea_code)s; if (fault == NoFault) { - fault = xc->initiateMemRead(EA, memAccessSize, - this->memAccessFlags); + fault = initiateMemRead(xc, EA, + memAccessSize, this->memAccessFlags, + std::vector(memAccessSize, true)); } return fault; @@ -1039,8 +1041,8 @@ def template SveStructStoreExecute {{ } if (fault == NoFault) { - fault = xc->writeMem(memData.raw_ptr(), memAccessSize, EA, - this->memAccessFlags, NULL, wrEn); + fault = writeMemAtomic(xc, memData.raw_ptr(), + EA, memAccessSize, this->memAccessFlags, NULL, wrEn); } if (fault == NoFault) { @@ -1076,8 +1078,8 @@ def template SveStructStoreInitiateAcc {{ } if (fault == NoFault) { - fault = xc->writeMem(memData.raw_ptr(), memAccessSize, EA, - this->memAccessFlags, NULL, wrEn); + fault = writeMemTiming(xc, memData.raw_ptr(), + EA, memAccessSize, this->memAccessFlags, NULL, wrEn); } return fault; -- 2.30.2