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:
commit
8a539a774f
5 changed files with 18 additions and 57 deletions
|
@ -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,42 +201,20 @@ 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;
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
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
|
||||
* transaction.*/
|
||||
|
|
|
@ -62,9 +62,6 @@ class Bus : public MemObject
|
|||
AddrRangeList defaultRange;
|
||||
std::vector<DevMap> portSnoopList;
|
||||
|
||||
std::vector<int> snoopCallbacks;
|
||||
|
||||
|
||||
/** Function called by the port when the bus is recieving a Timing
|
||||
transaction.*/
|
||||
bool recvTiming(Packet *pkt);
|
||||
|
@ -105,16 +102,11 @@ class Bus : public MemObject
|
|||
/** Snoop all relevant ports atomicly. */
|
||||
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.
|
||||
*/
|
||||
bool timingSnoopPhase1(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);
|
||||
bool timingSnoop(Packet *pkt);
|
||||
|
||||
/** Process address range request.
|
||||
* @param resp addresses that we can respond to
|
||||
|
|
7
src/mem/cache/base_cache.hh
vendored
7
src/mem/cache/base_cache.hh
vendored
|
@ -165,10 +165,6 @@ class BaseCache : public MemObject
|
|||
memSidePort->sendStatusChange(Port::RangeChange);
|
||||
}
|
||||
}
|
||||
else if (status == Port::SnoopSquash) {
|
||||
assert(snoopPhase2);
|
||||
snoopPhase2 = false;
|
||||
}
|
||||
}
|
||||
|
||||
virtual Packet *getPacket()
|
||||
|
@ -215,9 +211,6 @@ class BaseCache : public MemObject
|
|||
bool topLevelCache;
|
||||
|
||||
|
||||
/** True if we are now in phase 2 of the snoop process. */
|
||||
bool snoopPhase2;
|
||||
|
||||
/** Stores time the cache blocked for statistics. */
|
||||
Tick blockedCycle;
|
||||
|
||||
|
|
13
src/mem/cache/cache_impl.hh
vendored
13
src/mem/cache/cache_impl.hh
vendored
|
@ -72,16 +72,9 @@ doTimingAccess(Packet *pkt, CachePort *cachePort, bool isCpuSide)
|
|||
if (pkt->isResponse())
|
||||
handleResponse(pkt);
|
||||
else {
|
||||
//Check if we are in phase1
|
||||
if (!snoopPhase2) {
|
||||
snoopPhase2 = true;
|
||||
}
|
||||
else {
|
||||
//Check if we should do the snoop
|
||||
if (pkt->flags && SNOOP_COMMIT)
|
||||
snoop(pkt);
|
||||
snoopPhase2 = false;
|
||||
}
|
||||
//Check if we should do the snoop
|
||||
if (pkt->flags && SNOOP_COMMIT)
|
||||
snoop(pkt);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -106,8 +106,7 @@ class Port
|
|||
/** Holds the ports status. Currently just that a range recomputation needs
|
||||
* to be done. */
|
||||
enum Status {
|
||||
RangeChange,
|
||||
SnoopSquash
|
||||
RangeChange
|
||||
};
|
||||
|
||||
void setName(const std::string &name)
|
||||
|
|
Loading…
Reference in a new issue