From 49407d76aaba6f347c4d7e6be45eccc43b4c05fc Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 9 Jul 2012 12:35:32 -0400 Subject: Port: Add isSnooping to slave port (asking master port) This patch adds isSnooping to the slave port, and thus avoids going through getMasterPort to be able to ask the master. Over the course of the next few patches, all getMasterPort/getSlavePort in Port and MemObject are to be protocol agnostic, and the snooping is part of the protocol layer. The function is already present on the master port, where it is implemented by the module itself, e.g. a cache. On the slave side, it is merely asking the connected master port. The same name is used by both functions despite their difference in behaviour. The initial design used isMasterSnooping on the slave port side, but the more verbose function name was later changed. --- src/mem/coherent_bus.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mem/coherent_bus.cc') diff --git a/src/mem/coherent_bus.cc b/src/mem/coherent_bus.cc index b40e84762..ef8d68f00 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); -- cgit v1.2.3