diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index af32346bb9..cc68bbd3d7 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -795,7 +795,7 @@ Cache::functionalAccess(PacketPtr pkt, bool fromCpuSide) // continues towards the memory side if (fromCpuSide) { memSidePort->sendFunctional(pkt); - } else if (forwardSnoops && cpuSidePort->getMasterPort().isSnooping()) { + } else if (forwardSnoops && cpuSidePort->isSnooping()) { // if it came from the memory side, it must be a snoop request // and we should only forward it if we are forwarding snoops cpuSidePort->sendFunctionalSnoop(pkt); diff --git a/src/mem/coherent_bus.cc b/src/mem/coherent_bus.cc index b40e847628..ef8d68f008 100644 --- a/src/mem/coherent_bus.cc +++ b/src/mem/coherent_bus.cc @@ -92,7 +92,8 @@ CoherentBus::init() // neighbouring master ports are snooping and add them as snoopers for (SlavePortConstIter p = slavePorts.begin(); p != slavePorts.end(); ++p) { - if ((*p)->getMasterPort().isSnooping()) { + // check if the connected master port is snooping + if ((*p)->isSnooping()) { DPRINTF(BusAddrRanges, "Adding snooping master %s\n", (*p)->getMasterPort().name()); snoopPorts.push_back(*p); diff --git a/src/mem/comm_monitor.cc b/src/mem/comm_monitor.cc index 4255d58ad7..d8d5806bb8 100644 --- a/src/mem/comm_monitor.cc +++ b/src/mem/comm_monitor.cc @@ -328,7 +328,8 @@ CommMonitor::recvTimingSnoopResp(PacketPtr pkt) bool CommMonitor::isSnooping() const { - return slavePort.getMasterPort().isSnooping(); + // check if the connected master port is snooping + return slavePort.isSnooping(); } unsigned diff --git a/src/mem/port.hh b/src/mem/port.hh index b93d5d444b..49b0e18461 100644 --- a/src/mem/port.hh +++ b/src/mem/port.hh @@ -355,6 +355,13 @@ class SlavePort : public Port */ unsigned peerBlockSize() const; + /** + * Find out if the peer master port is snooping or not. + * + * @return true if the peer master port is snooping + */ + bool isSnooping() const { return _masterPort->isSnooping(); } + /** * Called by the owner to send a range change */ diff --git a/src/mem/ruby/system/RubyPort.cc b/src/mem/ruby/system/RubyPort.cc index 3621cc9e3e..285017a069 100644 --- a/src/mem/ruby/system/RubyPort.cc +++ b/src/mem/ruby/system/RubyPort.cc @@ -695,7 +695,8 @@ RubyPort::ruby_eviction_callback(const Address& address) // should this really be using funcMasterId? Request req(address.getAddress(), 0, 0, Request::funcMasterId); for (CpuPortIter p = slave_ports.begin(); p != slave_ports.end(); ++p) { - if ((*p)->getMasterPort().isSnooping()) { + // check if the connected master port is snooping + if ((*p)->isSnooping()) { Packet *pkt = new Packet(&req, MemCmd::InvalidationReq); // send as a snoop request (*p)->sendTimingSnoopReq(pkt);