From 12db50c89584938839e035da47d206250cbfd7c2 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Mon, 13 Mar 2017 18:19:08 +0000 Subject: ruby: Add support for address ranges in the directory Previously the directory covered a flat address range that always started from address 0. This change adds a vector of address ranges with interleaving and hashing that each directory keeps track of and the necessary flexibility to support systems with non continuous memory ranges. Change-Id: I6ea1c629bdf4c5137b7d9c89dbaf6c826adfd977 Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/2903 Reviewed-by: Bradford Beckmann Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/mem/ruby/structures/DirectoryMemory.hh | 34 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'src/mem/ruby/structures/DirectoryMemory.hh') diff --git a/src/mem/ruby/structures/DirectoryMemory.hh b/src/mem/ruby/structures/DirectoryMemory.hh index 98403808b..36defd5e9 100644 --- a/src/mem/ruby/structures/DirectoryMemory.hh +++ b/src/mem/ruby/structures/DirectoryMemory.hh @@ -1,4 +1,16 @@ /* + * Copyright (c) 2017 ARM Limited + * All rights reserved. + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood * All rights reserved. * @@ -32,6 +44,7 @@ #include #include +#include "base/addr_range.hh" #include "mem/protocol/DirectoryRequestType.hh" #include "mem/ruby/common/Address.hh" #include "mem/ruby/slicc_interface/AbstractEntry.hh" @@ -47,8 +60,18 @@ class DirectoryMemory : public SimObject void init(); + /** + * Return the index in the directory based on an address + * + * This function transforms an address which belongs to a not + * necessarily continuous vector of address ranges into a flat + * address that we use to index in the directory + * + * @param an input address + * @return the corresponding index in the directory + * + */ uint64_t mapAddressToLocalIdx(Addr address); - static uint64_t mapAddressToDirectoryVersion(Addr address); uint64_t getSize() { return m_size_bytes; } @@ -72,11 +95,12 @@ class DirectoryMemory : public SimObject uint64_t m_size_bytes; uint64_t m_size_bits; uint64_t m_num_entries; - int m_version; - static int m_num_directories; - static int m_num_directories_bits; - static int m_numa_high_bit; + /** + * The address range for which the directory responds. Normally + * this is all possible memory addresses. + */ + const AddrRangeList addrRanges; }; inline std::ostream& -- cgit v1.2.3