changeset d95e81d44e36 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=d95e81d44e36
description:
        base: add an accessor and operators ==,!= to address ranges

diffstat:

 src/base/addr_range.hh |  21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diffs (38 lines):

diff -r 5935ab1ddd7a -r d95e81d44e36 src/base/addr_range.hh
--- a/src/base/addr_range.hh    Tue Feb 03 14:25:55 2015 -0500
+++ b/src/base/addr_range.hh    Tue Feb 03 14:25:58 2015 -0500
@@ -227,6 +227,11 @@
     Addr start() const { return _start; }
 
     /**
+     * Get the end address of the range.
+     */
+    Addr end() const { return _end; }
+
+    /**
      * Get a string representation of the range. This could
      * alternatively be implemented as a operator<<, but at the moment
      * that seems like overkill.
@@ -363,6 +368,22 @@
             return intlvMatch < r.intlvMatch;
     }
 
+    bool operator==(const AddrRange& r) const
+    {
+        if (_start    != r._start)    return false;
+        if (_end      != r._end)      return false;
+        if (intlvBits != r.intlvBits) return false;
+        if (intlvBits != 0) {
+            if (intlvHighBit != r.intlvHighBit) return false;
+            if (intlvMatch   != r.intlvMatch)   return false;
+        }
+        return true;
+    }
+
+    bool operator!=(const AddrRange& r) const
+    {
+        return !(*this == r);
+    }
 #endif // SWIG
 };
 
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to