summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2007-05-22 07:30:55 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2007-05-22 07:30:55 -0700
commitda46364b1878339841e9cda5a62ee104409b6535 (patch)
tree1311700952d1509f08e8ac55a60d7467fba2b22c
parent0484867d85da6c1f97c5e1c55056cf48b6b7c37d (diff)
downloadgem5-da46364b1878339841e9cda5a62ee104409b6535.tar.xz
Fix getDeviceAddressRanges() to get snooping right.
--HG-- extra : convert_revision : 2aeab25ef955ab9db7b968786faff227239fbbe4
-rw-r--r--src/mem/cache/base_cache.cc8
-rw-r--r--src/mem/cache/base_cache.hh3
-rw-r--r--src/mem/cache/cache.hh6
-rw-r--r--src/mem/cache/cache_impl.hh24
4 files changed, 30 insertions, 11 deletions
diff --git a/src/mem/cache/base_cache.cc b/src/mem/cache/base_cache.cc
index d75d35ebb..a47c19e60 100644
--- a/src/mem/cache/base_cache.cc
+++ b/src/mem/cache/base_cache.cc
@@ -57,7 +57,6 @@ BaseCache::BaseCache(const std::string &name, Params &params)
}
-
void
BaseCache::CachePort::recvStatusChange(Port::Status status)
{
@@ -66,13 +65,6 @@ BaseCache::CachePort::recvStatusChange(Port::Status status)
}
}
-void
-BaseCache::CachePort::getDeviceAddressRanges(AddrRangeList &resp, bool &snoop)
-{
- AddrRangeList dummy;
- otherPort->getPeerAddressRanges(resp, dummy);
-}
-
int
BaseCache::CachePort::deviceBlockSize()
{
diff --git a/src/mem/cache/base_cache.hh b/src/mem/cache/base_cache.hh
index f7107a86a..a27ac1788 100644
--- a/src/mem/cache/base_cache.hh
+++ b/src/mem/cache/base_cache.hh
@@ -91,9 +91,6 @@ class BaseCache : public MemObject
virtual void recvStatusChange(Status status);
- virtual void getDeviceAddressRanges(AddrRangeList &resp,
- bool &snoop);
-
virtual int deviceBlockSize();
bool recvRetryCommon();
diff --git a/src/mem/cache/cache.hh b/src/mem/cache/cache.hh
index 75fb50f4e..e14b2efe8 100644
--- a/src/mem/cache/cache.hh
+++ b/src/mem/cache/cache.hh
@@ -89,6 +89,9 @@ class Cache : public BaseCache
void processRequestEvent();
void processResponseEvent();
+ virtual void getDeviceAddressRanges(AddrRangeList &resp,
+ bool &snoop);
+
virtual bool recvTiming(PacketPtr pkt);
virtual void recvRetry();
@@ -124,6 +127,9 @@ class Cache : public BaseCache
void processRequestEvent();
void processResponseEvent();
+ virtual void getDeviceAddressRanges(AddrRangeList &resp,
+ bool &snoop);
+
virtual bool recvTiming(PacketPtr pkt);
virtual void recvRetry();
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh
index 56352c110..a7f96603e 100644
--- a/src/mem/cache/cache_impl.hh
+++ b/src/mem/cache/cache_impl.hh
@@ -1140,6 +1140,18 @@ Cache<TagStore,Coherence>::deletePortRefs(Port *p)
template<class TagStore, class Coherence>
+void
+Cache<TagStore,Coherence>::CpuSidePort::
+getDeviceAddressRanges(AddrRangeList &resp, bool &snoop)
+{
+ // CPU side port doesn't snoop; it's a target only.
+ bool dummy;
+ otherPort->getPeerAddressRanges(resp, dummy);
+ snoop = false;
+}
+
+
+template<class TagStore, class Coherence>
bool
Cache<TagStore,Coherence>::CpuSidePort::recvTiming(PacketPtr pkt)
{
@@ -1261,6 +1273,18 @@ Cache<TagStore,Coherence>::CpuSidePort::recvFunctional(PacketPtr pkt)
template<class TagStore, class Coherence>
+void
+Cache<TagStore,Coherence>::MemSidePort::
+getDeviceAddressRanges(AddrRangeList &resp, bool &snoop)
+{
+ // Memory-side port always snoops.
+ bool dummy;
+ otherPort->getPeerAddressRanges(resp, dummy);
+ snoop = true;
+}
+
+
+template<class TagStore, class Coherence>
bool
Cache<TagStore,Coherence>::MemSidePort::recvTiming(PacketPtr pkt)
{