changeset e70523bd0d26 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=e70523bd0d26
description:
        mem: Make Request getters const

        This patch tidies up the Request class, making all getters const. The
        odd one out is incAccessDepth which is called by the memory system as
        packets carry the request around. This is also const to enable the
        packet to hold on to a const Request.

diffstat:

 src/mem/request.hh |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (87 lines):

diff -r 926802ed1536 -r e70523bd0d26 src/mem/request.hh
--- a/src/mem/request.hh        Tue Dec 02 06:07:46 2014 -0500
+++ b/src/mem/request.hh        Tue Dec 02 06:07:48 2014 -0500
@@ -410,13 +410,13 @@
      * Accessor for paddr.
      */
     bool
-    hasPaddr()
+    hasPaddr() const
     {
         return privateFlags.isSet(VALID_PADDR);
     }
 
     Addr
-    getPaddr()
+    getPaddr() const
     {
         assert(privateFlags.isSet(VALID_PADDR));
         return _paddr;
@@ -437,19 +437,19 @@
      * Level of the cache hierachy where this request was responded to
      * (e.g. 0 = L1; 1 = L2).
      */
-    int depth;
+    mutable int depth;
 
     /**
      *  Accessor for size.
      */
     bool
-    hasSize()
+    hasSize() const
     {
         return privateFlags.isSet(VALID_SIZE);
     }
 
     int
-    getSize()
+    getSize() const
     {
         assert(privateFlags.isSet(VALID_SIZE));
         return _size;
@@ -512,7 +512,7 @@
 
     /** Accesssor for the requestor id. */
     MasterID
-    masterId()
+    masterId() const
     {
         return _masterId;
     }
@@ -530,7 +530,7 @@
 
     /** Accessor function for asid.*/
     int
-    getAsid()
+    getAsid() const
     {
         assert(privateFlags.isSet(VALID_VADDR));
         return _asid;
@@ -545,7 +545,7 @@
 
     /** Accessor function for architecture-specific flags.*/
     ArchFlagsType
-    getArchFlags()
+    getArchFlags() const
     {
         assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
         return _flags & ARCH_BITS;
@@ -553,7 +553,7 @@
 
     /** Accessor function to check if sc result is valid. */
     bool
-    extraDataValid()
+    extraDataValid() const
     {
         return privateFlags.isSet(VALID_EXTRA_DATA);
     }
@@ -621,7 +621,7 @@
      * Increment/Get the depth at which this request is responded to.
      * This currently happens when the request misses in any cache level.
      */
-    void incAccessDepth() { depth++; }
+    void incAccessDepth() const { depth++; }
     int getAccessDepth() const { return depth; }
 
     /**
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to