arch-arm: Using new "raw" memhelpers
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 9 Dec 2019 14:02:18 +0000 (14:02 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 30 Sep 2020 08:50:39 +0000 (08:50 +0000)
JIRA: https://gem5.atlassian.net/browse/GEM5-196

Change-Id: Ie5ea0fc845a8f6d77a5723bacaff25ba04562f9c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23528
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/isa/templates/mem.isa
src/arch/arm/isa/templates/mem64.isa
src/arch/arm/isa/templates/misc.isa
src/arch/arm/isa/templates/neon64.isa
src/arch/arm/isa/templates/sve_mem.isa

index 693d93ae3d74b4d1d2dd24df0af84eda5e874d59..b056f48e87a58a04a7885c570845ab36a5c367c6 100644 (file)
@@ -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<bool>(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<bool>(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<bool>(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<bool>(size, true));
             }
         } else {
             xc->setPredicate(false);
index ed43cd77afe77beb0f5ba86e9251f8c330105dbf..3b90f8c3f25c700013ac08a753755a19c7e8452d 100644 (file)
@@ -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<bool>(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<bool>(op_size, true));
         }
 
         return fault;
index c982e7515a4526765a5e86fd1d02690623517452..51d833700aaea5c2c851a03d8f9866870ebe02a5 100644 (file)
@@ -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<bool>(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<bool>(op_size, true));
             }
         } else {
             xc->setPredicate(false);
index 5d30107b25bf9dae6dc6e465e2667c72c4062137..d281c95c867e9c875e682a750b40cf1a1232fbb2 100644 (file)
@@ -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<bool>(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<bool>(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<bool>(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<bool>(accSize, true));
         }
 
         return fault;
index fb306fca32111d1c8bad3b290992d9ee08137d84..7d59908c2b5c0322d7e4e1d19b5d3b3d1257867e 100644 (file)
@@ -155,8 +155,8 @@ def template SveContigLoadExecute {{
 
         %(rden_code)s;
 
-        fault = xc->readMem(EA, memData.raw_ptr<uint8_t>(), memAccessSize,
-            this->memAccessFlags, rdEn);
+        fault = readMemAtomic(xc, EA, memData.raw_ptr<uint8_t>(),
+            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<uint8_t>(), memAccessSize, EA,
-                this->memAccessFlags, NULL, wrEn);
+            fault = writeMemAtomic(xc, memData.raw_ptr<uint8_t>(),
+                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<uint8_t>(), memAccessSize, EA,
-                this->memAccessFlags, NULL, wrEn);
+            fault = writeMemTiming(xc, memData.raw_ptr<uint8_t>(),
+                EA, memAccessSize, this->memAccessFlags, NULL, wrEn);
         }
 
         return fault;
@@ -945,8 +945,9 @@ def template SveStructLoadExecute {{
         auto memDataView = memData.as<Element>();
 
         if (fault == NoFault) {
-            fault = xc->readMem(EA, memData.raw_ptr<uint8_t>(), memAccessSize,
-                this->memAccessFlags);
+            fault = readMemAtomic(xc, EA, memData.raw_ptr<uint8_t>(),
+                memAccessSize, this->memAccessFlags,
+                std::vector<bool>(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<bool>(memAccessSize, true));
         }
 
         return fault;
@@ -1039,8 +1041,8 @@ def template SveStructStoreExecute {{
         }
 
         if (fault == NoFault) {
-            fault = xc->writeMem(memData.raw_ptr<uint8_t>(), memAccessSize, EA,
-                this->memAccessFlags, NULL, wrEn);
+            fault = writeMemAtomic(xc, memData.raw_ptr<uint8_t>(),
+                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<uint8_t>(), memAccessSize, EA,
-                this->memAccessFlags, NULL, wrEn);
+            fault = writeMemTiming(xc, memData.raw_ptr<uint8_t>(),
+                EA, memAccessSize, this->memAccessFlags, NULL, wrEn);
         }
 
         return fault;