From: Steve Reinhardt Date: Tue, 22 May 2007 14:30:55 +0000 (-0700) Subject: Fix getDeviceAddressRanges() to get snooping right. X-Git-Tag: m5_2.0_beta4~195^2~50^2~43^2~8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da46364b1878339841e9cda5a62ee104409b6535;p=gem5.git Fix getDeviceAddressRanges() to get snooping right. --HG-- extra : convert_revision : 2aeab25ef955ab9db7b968786faff227239fbbe4 --- 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 ¶ms) } - 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 @@ -1139,6 +1139,18 @@ Cache::deletePortRefs(Port *p) } +template +void +Cache::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 bool Cache::CpuSidePort::recvTiming(PacketPtr pkt) @@ -1260,6 +1272,18 @@ Cache::CpuSidePort::recvFunctional(PacketPtr pkt) } +template +void +Cache::MemSidePort:: +getDeviceAddressRanges(AddrRangeList &resp, bool &snoop) +{ + // Memory-side port always snoops. + bool dummy; + otherPort->getPeerAddressRanges(resp, dummy); + snoop = true; +} + + template bool Cache::MemSidePort::recvTiming(PacketPtr pkt)