summaryrefslogtreecommitdiff
path: root/src/mem/cache/base.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-02-15 17:40:10 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2013-02-15 17:40:10 -0500
commitf6550b3d201b6b6a44b107b8fd662090095fe04b (patch)
tree01d255d0ff75c53a32d70d04ee4150650ebe430a /src/mem/cache/base.hh
parent2f3b322280a742069fd8965d723a2205a4a8cc00 (diff)
downloadgem5-f6550b3d201b6b6a44b107b8fd662090095fe04b.tar.xz
mem: Tighten up cache constness and scoping
This patch merely adopts a more strict use of const for the cache member functions and variables, and also moves a large portion of the member functions from public to protected.
Diffstat (limited to 'src/mem/cache/base.hh')
-rw-r--r--src/mem/cache/base.hh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh
index b9b42da78..dce40e915 100644
--- a/src/mem/cache/base.hh
+++ b/src/mem/cache/base.hh
@@ -262,12 +262,12 @@ class BaseCache : public MemObject
const int numTarget;
/** Do we forward snoops from mem side port through to cpu side port? */
- bool forwardSnoops;
+ const bool forwardSnoops;
/** Is this cache a toplevel cache (e.g. L1, I/O cache). If so we should
* never try to forward ownership and similar optimizations to the cpu
* side */
- bool isTopLevel;
+ const bool isTopLevel;
/**
* Bit vector of the blocking reasons for the access path.
@@ -290,7 +290,7 @@ class BaseCache : public MemObject
/**
* The address range to which the cache responds on the CPU side.
* Normally this is all possible memory addresses. */
- AddrRangeList addrRanges;
+ const AddrRangeList addrRanges;
public:
/** System we are currently operating in. */
@@ -495,7 +495,7 @@ class BaseCache : public MemObject
/**
* Returns true if the cache is blocked for accesses.
*/
- bool isBlocked()
+ bool isBlocked() const
{
return blocked != 0;
}
@@ -560,9 +560,9 @@ class BaseCache : public MemObject
virtual unsigned int drain(DrainManager *dm);
- virtual bool inCache(Addr addr) = 0;
+ virtual bool inCache(Addr addr) const = 0;
- virtual bool inMissQueue(Addr addr) = 0;
+ virtual bool inMissQueue(Addr addr) const = 0;
void incMissCount(PacketPtr pkt)
{