Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/31474 )

Change subject: mem-ruby: Getter/setter for atomic ops in WriteMask
......................................................................

mem-ruby: Getter/setter for atomic ops in WriteMask

Adding getter and setter methods for getting and setting the atomic ops
in the WriteMask class. This allows for message types with WriteMasks to
get or set the atomic ops without explicitly modifying the constructor
for the message type. This will beused by the DMASequencer which uses the
SequencerMsg type where the constructor is auto generated via SLICC.

Change-Id: I71787d294c1b89547618e9a13e386b65bb3e1021
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31474
Reviewed-by: Bobby R. Bruce <[email protected]>
Reviewed-by: Anthony Gutierrez <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/ruby/common/WriteMask.hh
1 file changed, 18 insertions(+), 3 deletions(-)

Approvals:
  Anthony Gutierrez: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  Jason Lowe-Power: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/ruby/common/WriteMask.hh b/src/mem/ruby/common/WriteMask.hh
index 0ba6989..6a0a041 100644
--- a/src/mem/ruby/common/WriteMask.hh
+++ b/src/mem/ruby/common/WriteMask.hh
@@ -40,6 +40,8 @@
 class WriteMask
 {
   public:
+    typedef std::vector<std::pair<int, AtomicOpFunctor* >> AtomicOpVector;
+
     WriteMask()
       : mSize(RubySystem::getBlockSizeBytes()), mMask(mSize, false),
         mAtomic(false)
@@ -53,8 +55,7 @@
       : mSize(size), mMask(mask), mAtomic(false)
     {}

-    WriteMask(int size, std::vector<bool> &mask,
-              std::vector<std::pair<int, AtomicOpFunctor*> > atomicOp)
+    WriteMask(int size, std::vector<bool> &mask, AtomicOpVector atomicOp)
       : mSize(size), mMask(mask), mAtomic(true), mAtomicOp(atomicOp)
     {}

@@ -184,11 +185,25 @@
             (*fnctr)(p);
         }
     }
+
+    const AtomicOpVector&
+    getAtomicOps() const
+    {
+        return mAtomicOp;
+    }
+
+    void
+    setAtomicOps(const AtomicOpVector& atomicOps)
+    {
+        mAtomic = true;
+        mAtomicOp = std::move(atomicOps);
+    }
+
   private:
     int mSize;
     std::vector<bool> mMask;
     bool mAtomic;
-    std::vector<std::pair<int, AtomicOpFunctor*> > mAtomicOp;
+    AtomicOpVector mAtomicOp;
 };

 inline std::ostream&

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

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I71787d294c1b89547618e9a13e386b65bb3e1021
Gerrit-Change-Number: 31474
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <[email protected]>
Gerrit-Reviewer: Anthony Gutierrez <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthew Poremba <[email protected]>
Gerrit-Reviewer: Tiago Mück <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to