Jordi Vaquero has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/20779 )

Change subject: arch-arm: Adding Atomic treatment in RUBY memory infrastructure.
......................................................................

arch-arm: Adding Atomic treatment in RUBY memory infrastructure.

RUBY was unable to work with AMO (Atomic memory operations) in a general way.
This change modifies the hitCallback function to detect if the
operation detected as ST is an AtomicOp and handles it accordingly.

Change-Id: Ia6c1c68e22748b1123b0ae7197884725b7a93ce7
---
M src/mem/ruby/system/Sequencer.cc
1 file changed, 16 insertions(+), 4 deletions(-)



diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc
index 9d317aa..e2fb706 100644
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -484,11 +484,23 @@
                          getOffset(request_address), pkt->getSize());
             DPRINTF(RubySequencer, "swap data %s\n", data);
} else if (type != RubyRequestType_Store_Conditional || llscSuccess) {
-            // Types of stores set the actual data here, apart from
-            // failed Store Conditional requests
-            data.setData(pkt->getConstPtr<uint8_t>(),
+            if (pkt->isAtomicOp()){
+
+                std::vector<uint8_t> overwrite_val(pkt->getSize());
+                pkt->setData(
+ data.getData(getOffset(request_address), pkt->getSize()));
+                pkt->writeData(&overwrite_val[0]);
+                (*(pkt->getAtomicOp()))(&overwrite_val[0]);
+                data.setData(&overwrite_val[0],
                          getOffset(request_address), pkt->getSize());
-            DPRINTF(RubySequencer, "set data %s\n", data);
+                DPRINTF(RubySequencer, "AMO data %s\n", data);
+            }else{
+                // Types of stores set the actual data here, apart from
+                // failed Store Conditional requests
+                data.setData(pkt->getConstPtr<uint8_t>(),
+                             getOffset(request_address), pkt->getSize());
+                DPRINTF(RubySequencer, "set data %s\n", data);
+            }
         }
     }


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/20779
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c1c68e22748b1123b0ae7197884725b7a93ce7
Gerrit-Change-Number: 20779
Gerrit-PatchSet: 1
Gerrit-Owner: Jordi Vaquero <jordi.vaqu...@metempsy.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to