ruby: patch checkpoint restore with garnet
[gem5.git] / src / mem / ruby / common / Address.cc
index cc87f4ece882e90a1e6a5d83558aa69f242f7e8b..b075ef3c5aabed2373f292daff8b07c29cc757c6 100644 (file)
@@ -26,6 +26,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "arch/isa_traits.hh"
+#include "config/the_isa.hh"
 #include "mem/ruby/common/Address.hh"
 #include "mem/ruby/system/System.hh"
 
@@ -55,10 +57,10 @@ Address::makeNextStrideAddress(int stride)
         + RubySystem::getBlockSizeBytes()*stride;
 }
 
-integer_t
+Index
 Address::memoryModuleIndex() const
 {
-    integer_t index =
+    Index index =
         bitSelect(RubySystem::getBlockSizeBits() +
                   RubySystem::getMemorySizeBits(), ADDRESS_WIDTH);
     assert (index >= 0);
@@ -134,3 +136,24 @@ Address::operator=(const Address& obj)
     return *this;
 }
 
+void
+Address::makePageAddress()
+{
+    m_address = maskLowOrderBits(TheISA::LogVMPageSize);
+}
+
+Address
+page_address(const Address& addr)
+{
+    Address temp = addr;
+    temp.makePageAddress();
+    return temp;
+}
+
+Address
+next_stride_address(const Address& addr, int stride)
+{
+    Address temp = addr;
+    temp.makeNextStrideAddress(stride);
+    return temp;
+}