summaryrefslogtreecommitdiff
path: root/src/mem/bus.cc
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-10-08 18:48:03 -0400
committerRon Dreslinski <rdreslin@umich.edu>2006-10-08 18:48:03 -0400
commit1345183a89a148bf48110c4559448dd708549252 (patch)
treef529e34699e77352827f502b3811ed459585858f /src/mem/bus.cc
parentc2f954ac692e664ba105f94c64c8c408cf1b4380 (diff)
downloadgem5-1345183a89a148bf48110c4559448dd708549252.tar.xz
Move away from using the statusChange function on snoops. Clean up snooping code in general.
--HG-- extra : convert_revision : 5a57bfd7742a212047fc32e8cae0dc602fdc915c
Diffstat (limited to 'src/mem/bus.cc')
-rw-r--r--src/mem/bus.cc38
1 files changed, 11 insertions, 27 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index 3c5283a77..daca6f985 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -79,9 +79,15 @@ Bus::recvTiming(Packet *pkt)
short dest = pkt->getDest();
if (dest == Packet::Broadcast) {
- if ( timingSnoopPhase1(pkt) )
+ if (timingSnoop(pkt))
{
- timingSnoopPhase2(pkt);
+ pkt->flags |= SNOOP_COMMIT;
+ bool success = timingSnoop(pkt);
+ assert(success);
+ if (pkt->flags & SATISFIED) {
+ //Cache-Cache transfer occuring
+ return true;
+ }
port = findPort(pkt->getAddr(), pkt->getSrc());
}
else
@@ -195,43 +201,21 @@ Bus::atomicSnoop(Packet *pkt)
}
bool
-Bus::timingSnoopPhase1(Packet *pkt)
+Bus::timingSnoop(Packet *pkt)
{
std::vector<int> ports = findSnoopPorts(pkt->getAddr(), pkt->getSrc());
bool success = true;
while (!ports.empty() && success)
{
- snoopCallbacks.push_back(ports.back());
success = interfaces[ports.back()]->sendTiming(pkt);
ports.pop_back();
}
- if (!success)
- {
- while (!snoopCallbacks.empty())
- {
- interfaces[snoopCallbacks.back()]->sendStatusChange(Port::SnoopSquash);
- snoopCallbacks.pop_back();
- }
- return false;
- }
- return true;
-}
-void
-Bus::timingSnoopPhase2(Packet *pkt)
-{
- bool success;
- pkt->flags |= SNOOP_COMMIT;
- while (!snoopCallbacks.empty())
- {
- success = interfaces[snoopCallbacks.back()]->sendTiming(pkt);
- //We should not fail on snoop callbacks
- assert(success);
- snoopCallbacks.pop_back();
- }
+ return success;
}
+
/** Function called by the port when the bus is receiving a Atomic
* transaction.*/
Tick