mem: Remove unused size field from the CacheBlk class
[gem5.git] / src / mem / packet.hh
index 0e7135d73d078986a1b60fff52d1295d11b3220e..74a2de1353cbaeedebfcd3b7bacfd257e2f8eae6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015 ARM Limited
+ * Copyright (c) 2012-2016 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -151,6 +151,7 @@ class MemCmd
         IsError,        //!< Error response
         IsPrint,        //!< Print state matching address (for debugging)
         IsFlush,        //!< Flush the address from caches
+        FromCache,      //!< Request originated from a caching agent
         NUM_COMMAND_ATTRIBUTES
     };
 
@@ -193,6 +194,7 @@ class MemCmd
     bool needsResponse() const     { return testCmdAttrib(NeedsResponse); }
     bool isInvalidate() const      { return testCmdAttrib(IsInvalidate); }
     bool isEviction() const        { return testCmdAttrib(IsEviction); }
+    bool fromCache() const         { return testCmdAttrib(FromCache); }
 
     /**
      * A writeback is an eviction that carries data.
@@ -514,6 +516,7 @@ class Packet : public Printable
     bool needsResponse() const       { return cmd.needsResponse(); }
     bool isInvalidate() const        { return cmd.isInvalidate(); }
     bool isEviction() const          { return cmd.isEviction(); }
+    bool fromCache() const           { return cmd.fromCache(); }
     bool isWriteback() const         { return cmd.isWriteback(); }
     bool hasData() const             { return cmd.hasData(); }
     bool hasRespData() const
@@ -609,6 +612,7 @@ class Packet : public Printable
     void setResponderHadWritable()
     {
         assert(cacheResponding());
+        assert(!responderHadWritable());
         flags.set(RESPONDER_HAD_WRITABLE);
     }
     bool responderHadWritable() const
@@ -660,6 +664,12 @@ class Packet : public Printable
         return _isSecure;
     }
 
+    /**
+     * Accessor function to atomic op.
+     */
+    AtomicOpFunctor *getAtomicOp() const { return req->getAtomicOpFunctor(); }
+    bool isAtomicOp() const { return req->isAtomic(); }
+
     /**
      * It has been determined that the SC packet should successfully update
      * memory. Therefore, convert this SC packet to a normal write.