Merge zizzer:/z/m5/Bitkeeper/newmem

into  zazzer.eecs.umich.edu:/z/rdreslin/m5bk/newmemcleanest

--HG--
extra : convert_revision : f3067efb7f3ff30158d541dfc52de4ea8edae576
This commit is contained in:
Ron Dreslinski 2006-10-08 18:49:30 -04:00
commit 8a539a774f
5 changed files with 18 additions and 57 deletions

View file

@ -79,9 +79,15 @@ Bus::recvTiming(Packet *pkt)
short dest = pkt->getDest(); short dest = pkt->getDest();
if (dest == Packet::Broadcast) { 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()); port = findPort(pkt->getAddr(), pkt->getSrc());
} }
else else
@ -195,42 +201,20 @@ Bus::atomicSnoop(Packet *pkt)
} }
bool bool
Bus::timingSnoopPhase1(Packet *pkt) Bus::timingSnoop(Packet *pkt)
{ {
std::vector<int> ports = findSnoopPorts(pkt->getAddr(), pkt->getSrc()); std::vector<int> ports = findSnoopPorts(pkt->getAddr(), pkt->getSrc());
bool success = true; bool success = true;
while (!ports.empty() && success) while (!ports.empty() && success)
{ {
snoopCallbacks.push_back(ports.back());
success = interfaces[ports.back()]->sendTiming(pkt); success = interfaces[ports.back()]->sendTiming(pkt);
ports.pop_back(); ports.pop_back();
} }
if (!success)
{ return 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();
}
}
/** Function called by the port when the bus is receiving a Atomic /** Function called by the port when the bus is receiving a Atomic
* transaction.*/ * transaction.*/

View file

@ -62,9 +62,6 @@ class Bus : public MemObject
AddrRangeList defaultRange; AddrRangeList defaultRange;
std::vector<DevMap> portSnoopList; std::vector<DevMap> portSnoopList;
std::vector<int> snoopCallbacks;
/** Function called by the port when the bus is recieving a Timing /** Function called by the port when the bus is recieving a Timing
transaction.*/ transaction.*/
bool recvTiming(Packet *pkt); bool recvTiming(Packet *pkt);
@ -105,16 +102,11 @@ class Bus : public MemObject
/** Snoop all relevant ports atomicly. */ /** Snoop all relevant ports atomicly. */
void atomicSnoop(Packet *pkt); void atomicSnoop(Packet *pkt);
/** Snoop for NACK and Blocked in phase 1 /** Call snoop on caches, be sure to set SNOOP_COMMIT bit if you want
* the snoop to happen
* @return True if succeds. * @return True if succeds.
*/ */
bool timingSnoopPhase1(Packet *pkt); bool timingSnoop(Packet *pkt);
/** @todo Don't need to commit all snoops just those that need it
*(register somehow). */
/** Commit all snoops now that we know if any of them would have blocked.
*/
void timingSnoopPhase2(Packet *pkt);
/** Process address range request. /** Process address range request.
* @param resp addresses that we can respond to * @param resp addresses that we can respond to

View file

@ -165,10 +165,6 @@ class BaseCache : public MemObject
memSidePort->sendStatusChange(Port::RangeChange); memSidePort->sendStatusChange(Port::RangeChange);
} }
} }
else if (status == Port::SnoopSquash) {
assert(snoopPhase2);
snoopPhase2 = false;
}
} }
virtual Packet *getPacket() virtual Packet *getPacket()
@ -215,9 +211,6 @@ class BaseCache : public MemObject
bool topLevelCache; bool topLevelCache;
/** True if we are now in phase 2 of the snoop process. */
bool snoopPhase2;
/** Stores time the cache blocked for statistics. */ /** Stores time the cache blocked for statistics. */
Tick blockedCycle; Tick blockedCycle;

View file

@ -71,17 +71,10 @@ doTimingAccess(Packet *pkt, CachePort *cachePort, bool isCpuSide)
{ {
if (pkt->isResponse()) if (pkt->isResponse())
handleResponse(pkt); handleResponse(pkt);
else {
//Check if we are in phase1
if (!snoopPhase2) {
snoopPhase2 = true;
}
else { else {
//Check if we should do the snoop //Check if we should do the snoop
if (pkt->flags && SNOOP_COMMIT) if (pkt->flags && SNOOP_COMMIT)
snoop(pkt); snoop(pkt);
snoopPhase2 = false;
}
} }
} }
return true; return true;

View file

@ -106,8 +106,7 @@ class Port
/** Holds the ports status. Currently just that a range recomputation needs /** Holds the ports status. Currently just that a range recomputation needs
* to be done. */ * to be done. */
enum Status { enum Status {
RangeChange, RangeChange
SnoopSquash
}; };
void setName(const std::string &name) void setName(const std::string &name)