memory system: fix functional access bug.
Make sure not to keep processing functional accesses after they've been responded to. Also use checkFunctional() return value instead of checking packet command field where possible, mostly just for consistency. --HG-- extra : convert_revision : 29fc76bc18731bd93a4ed05a281297827028ef75
This commit is contained in:
parent
08474ccf68
commit
2f93db6f95
5 changed files with 20 additions and 19 deletions
4
src/mem/cache/base_cache.cc
vendored
4
src/mem/cache/base_cache.cc
vendored
|
@ -81,10 +81,10 @@ BaseCache::CachePort::deviceBlockSize()
|
|||
void
|
||||
BaseCache::CachePort::checkAndSendFunctional(PacketPtr pkt)
|
||||
{
|
||||
checkFunctional(pkt);
|
||||
if (!pkt->isResponse())
|
||||
if (!checkFunctional(pkt)) {
|
||||
sendFunctional(pkt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
|
|
8
src/mem/cache/cache_impl.hh
vendored
8
src/mem/cache/cache_impl.hh
vendored
|
@ -1253,10 +1253,10 @@ template<class TagStore>
|
|||
void
|
||||
Cache<TagStore>::CpuSidePort::recvFunctional(PacketPtr pkt)
|
||||
{
|
||||
checkFunctional(pkt);
|
||||
if (!pkt->isResponse())
|
||||
if (!checkFunctional(pkt)) {
|
||||
myCache()->functionalAccess(pkt, cache->memSidePort);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class TagStore>
|
||||
|
@ -1327,10 +1327,10 @@ template<class TagStore>
|
|||
void
|
||||
Cache<TagStore>::MemSidePort::recvFunctional(PacketPtr pkt)
|
||||
{
|
||||
checkFunctional(pkt);
|
||||
if (!pkt->isResponse())
|
||||
if (!checkFunctional(pkt)) {
|
||||
myCache()->functionalAccess(pkt, cache->cpuSidePort);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -400,13 +400,13 @@ PhysicalMemory::MemoryPort::recvAtomic(PacketPtr pkt)
|
|||
void
|
||||
PhysicalMemory::MemoryPort::recvFunctional(PacketPtr pkt)
|
||||
{
|
||||
checkFunctional(pkt);
|
||||
|
||||
if (!checkFunctional(pkt)) {
|
||||
// Default implementation of SimpleTimingPort::recvFunctional()
|
||||
// calls recvAtomic() and throws away the latency; we can save a
|
||||
// little here by just not calculating the latency.
|
||||
memory->doFunctionalAccess(pkt);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
PhysicalMemory::drain(Event *de)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "mem/tport.hh"
|
||||
|
||||
void
|
||||
bool
|
||||
SimpleTimingPort::checkFunctional(PacketPtr pkt)
|
||||
{
|
||||
DeferredPacketIterator i = transmitList.begin();
|
||||
|
@ -41,20 +41,21 @@ SimpleTimingPort::checkFunctional(PacketPtr pkt)
|
|||
// If the target contains data, and it overlaps the
|
||||
// probed request, need to update data
|
||||
if (pkt->checkFunctional(target)) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
SimpleTimingPort::recvFunctional(PacketPtr pkt)
|
||||
{
|
||||
checkFunctional(pkt);
|
||||
|
||||
if (!checkFunctional(pkt)) {
|
||||
// Just do an atomic access and throw away the returned latency
|
||||
if (!pkt->isResponse())
|
||||
recvAtomic(pkt);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
SimpleTimingPort::recvTiming(PacketPtr pkt)
|
||||
|
|
|
@ -99,7 +99,7 @@ class SimpleTimingPort : public Port
|
|||
|
||||
/** Check the list of buffered packets against the supplied
|
||||
* functional request. */
|
||||
void checkFunctional(PacketPtr funcPkt);
|
||||
bool checkFunctional(PacketPtr funcPkt);
|
||||
|
||||
/** Check whether we have a packet ready to go on the transmit list. */
|
||||
bool deferredPacketReady()
|
||||
|
|
Loading…
Reference in a new issue