Debugging info
src/base/traceflags.py: Add new flags for cacheport src/mem/bus.cc: Add debugging info src/mem/cache/base_cache.cc: Add debuggin info --HG-- extra : convert_revision : a6c4b452466a8e0b50a86e886833cb6e29edc748
This commit is contained in:
parent
27c59dc370
commit
1de8eae43a
3 changed files with 34 additions and 4 deletions
|
@ -58,6 +58,7 @@ baseFlags = [
|
||||||
'BusAddrRanges',
|
'BusAddrRanges',
|
||||||
'BusBridge',
|
'BusBridge',
|
||||||
'Cache',
|
'Cache',
|
||||||
|
'CachePort',
|
||||||
'Chains',
|
'Chains',
|
||||||
'Checker',
|
'Checker',
|
||||||
'Clock',
|
'Clock',
|
||||||
|
|
|
@ -95,6 +95,7 @@ Bus::recvTiming(Packet *pkt)
|
||||||
// one, put this device on the retry list.
|
// one, put this device on the retry list.
|
||||||
if (tickNextIdle > curTick ||
|
if (tickNextIdle > curTick ||
|
||||||
(retryList.size() && (!inRetry || pktPort != retryList.front()))) {
|
(retryList.size() && (!inRetry || pktPort != retryList.front()))) {
|
||||||
|
DPRINTF(Bus, "Adding RETRY for %i\n", pktPort);
|
||||||
addToRetryList(pktPort);
|
addToRetryList(pktPort);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -108,6 +109,7 @@ Bus::recvTiming(Packet *pkt)
|
||||||
if (pkt->flags & SATISFIED) {
|
if (pkt->flags & SATISFIED) {
|
||||||
//Cache-Cache transfer occuring
|
//Cache-Cache transfer occuring
|
||||||
if (inRetry) {
|
if (inRetry) {
|
||||||
|
DPRINTF(Bus, "Removing RETRY %i\n", retryList.front());
|
||||||
retryList.pop_front();
|
retryList.pop_front();
|
||||||
inRetry = false;
|
inRetry = false;
|
||||||
}
|
}
|
||||||
|
@ -116,6 +118,7 @@ Bus::recvTiming(Packet *pkt)
|
||||||
port = findPort(pkt->getAddr(), pkt->getSrc());
|
port = findPort(pkt->getAddr(), pkt->getSrc());
|
||||||
} else {
|
} else {
|
||||||
//Snoop didn't succeed
|
//Snoop didn't succeed
|
||||||
|
DPRINTF(Bus, "Snoop caused adding to RETRY list %i\n", pktPort);
|
||||||
addToRetryList(pktPort);
|
addToRetryList(pktPort);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -181,6 +184,7 @@ Bus::recvTiming(Packet *pkt)
|
||||||
// Packet was successfully sent. Return true.
|
// Packet was successfully sent. Return true.
|
||||||
// Also take care of retries
|
// Also take care of retries
|
||||||
if (inRetry) {
|
if (inRetry) {
|
||||||
|
DPRINTF(Bus, "Remove retry from list %i\n", retryList.front());
|
||||||
retryList.pop_front();
|
retryList.pop_front();
|
||||||
inRetry = false;
|
inRetry = false;
|
||||||
}
|
}
|
||||||
|
@ -188,6 +192,7 @@ Bus::recvTiming(Packet *pkt)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Packet not successfully sent. Leave or put it on the retry list.
|
// Packet not successfully sent. Leave or put it on the retry list.
|
||||||
|
DPRINTF(Bus, "Adding a retry to RETRY list %i\n", pktPort);
|
||||||
addToRetryList(pktPort);
|
addToRetryList(pktPort);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -195,10 +200,12 @@ Bus::recvTiming(Packet *pkt)
|
||||||
void
|
void
|
||||||
Bus::recvRetry(int id)
|
Bus::recvRetry(int id)
|
||||||
{
|
{
|
||||||
|
DPRINTF(Bus, "Received a retry\n");
|
||||||
// If there's anything waiting...
|
// If there's anything waiting...
|
||||||
if (retryList.size()) {
|
if (retryList.size()) {
|
||||||
//retryingPort = retryList.front();
|
//retryingPort = retryList.front();
|
||||||
inRetry = true;
|
inRetry = true;
|
||||||
|
DPRINTF(Bus, "Sending a retry\n");
|
||||||
retryList.front()->sendRetry();
|
retryList.front()->sendRetry();
|
||||||
// If inRetry is still true, sendTiming wasn't called
|
// If inRetry is still true, sendTiming wasn't called
|
||||||
if (inRetry)
|
if (inRetry)
|
||||||
|
@ -258,8 +265,8 @@ Bus::findSnoopPorts(Addr addr, int id)
|
||||||
//Careful to not overlap ranges
|
//Careful to not overlap ranges
|
||||||
//or snoop will be called more than once on the port
|
//or snoop will be called more than once on the port
|
||||||
ports.push_back(portSnoopList[i].portId);
|
ports.push_back(portSnoopList[i].portId);
|
||||||
DPRINTF(Bus, " found snoop addr %#llx on device%d\n", addr,
|
// DPRINTF(Bus, " found snoop addr %#llx on device%d\n", addr,
|
||||||
portSnoopList[i].portId);
|
// portSnoopList[i].portId);
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
26
src/mem/cache/base_cache.cc
vendored
26
src/mem/cache/base_cache.cc
vendored
|
@ -116,12 +116,16 @@ BaseCache::CachePort::recvRetry()
|
||||||
Packet *pkt;
|
Packet *pkt;
|
||||||
assert(waitingOnRetry);
|
assert(waitingOnRetry);
|
||||||
if (!drainList.empty()) {
|
if (!drainList.empty()) {
|
||||||
|
DPRINTF(CachePort, "%s attempting to send a retry for response\n", name());
|
||||||
//We have some responses to drain first
|
//We have some responses to drain first
|
||||||
if (sendTiming(drainList.front())) {
|
if (sendTiming(drainList.front())) {
|
||||||
|
DPRINTF(CachePort, "%s sucessful in sending a retry for response\n", name());
|
||||||
drainList.pop_front();
|
drainList.pop_front();
|
||||||
if (!drainList.empty() ||
|
if (!drainList.empty() ||
|
||||||
!isCpuSide && cache->doMasterRequest() ||
|
!isCpuSide && cache->doMasterRequest() ||
|
||||||
isCpuSide && cache->doSlaveRequest()) {
|
isCpuSide && cache->doSlaveRequest()) {
|
||||||
|
|
||||||
|
DPRINTF(CachePort, "%s has more responses/requests\n", name());
|
||||||
BaseCache::CacheEvent * reqCpu = new BaseCache::CacheEvent(this);
|
BaseCache::CacheEvent * reqCpu = new BaseCache::CacheEvent(this);
|
||||||
reqCpu->schedule(curTick + 1);
|
reqCpu->schedule(curTick + 1);
|
||||||
}
|
}
|
||||||
|
@ -130,6 +134,7 @@ BaseCache::CachePort::recvRetry()
|
||||||
}
|
}
|
||||||
else if (!isCpuSide)
|
else if (!isCpuSide)
|
||||||
{
|
{
|
||||||
|
DPRINTF(CachePort, "%s attempting to send a retry for MSHR\n", name());
|
||||||
assert(cache->doMasterRequest());
|
assert(cache->doMasterRequest());
|
||||||
pkt = cache->getPacket();
|
pkt = cache->getPacket();
|
||||||
MSHR* mshr = (MSHR*)pkt->senderState;
|
MSHR* mshr = (MSHR*)pkt->senderState;
|
||||||
|
@ -140,6 +145,7 @@ BaseCache::CachePort::recvRetry()
|
||||||
waitingOnRetry = !success;
|
waitingOnRetry = !success;
|
||||||
if (success && cache->doMasterRequest())
|
if (success && cache->doMasterRequest())
|
||||||
{
|
{
|
||||||
|
DPRINTF(CachePort, "%s has more requests\n", name());
|
||||||
//Still more to issue, rerequest in 1 cycle
|
//Still more to issue, rerequest in 1 cycle
|
||||||
pkt = NULL;
|
pkt = NULL;
|
||||||
BaseCache::CacheEvent * reqCpu = new BaseCache::CacheEvent(this);
|
BaseCache::CacheEvent * reqCpu = new BaseCache::CacheEvent(this);
|
||||||
|
@ -163,6 +169,8 @@ BaseCache::CachePort::recvRetry()
|
||||||
cshrRetry = NULL;
|
cshrRetry = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (waitingOnRetry) DPRINTF(CachePort, "%s STILL Waiting on retry\n", name());
|
||||||
|
else DPRINTF(CachePort, "%s no longer waiting on retry\n", name());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
|
@ -210,17 +218,26 @@ BaseCache::CacheEvent::process()
|
||||||
if (cachePort->waitingOnRetry) return;
|
if (cachePort->waitingOnRetry) return;
|
||||||
//We have some responses to drain first
|
//We have some responses to drain first
|
||||||
if (!cachePort->drainList.empty()) {
|
if (!cachePort->drainList.empty()) {
|
||||||
|
DPRINTF(CachePort, "%s trying to drain a response\n", cachePort->name());
|
||||||
if (cachePort->sendTiming(cachePort->drainList.front())) {
|
if (cachePort->sendTiming(cachePort->drainList.front())) {
|
||||||
|
DPRINTF(CachePort, "%s drains a response succesfully\n", cachePort->name());
|
||||||
cachePort->drainList.pop_front();
|
cachePort->drainList.pop_front();
|
||||||
if (!cachePort->drainList.empty() ||
|
if (!cachePort->drainList.empty() ||
|
||||||
!cachePort->isCpuSide && cachePort->cache->doMasterRequest() ||
|
!cachePort->isCpuSide && cachePort->cache->doMasterRequest() ||
|
||||||
cachePort->isCpuSide && cachePort->cache->doSlaveRequest())
|
cachePort->isCpuSide && cachePort->cache->doSlaveRequest()) {
|
||||||
|
|
||||||
|
DPRINTF(CachePort, "%s still has outstanding bus reqs\n", cachePort->name());
|
||||||
this->schedule(curTick + 1);
|
this->schedule(curTick + 1);
|
||||||
}
|
}
|
||||||
else cachePort->waitingOnRetry = true;
|
}
|
||||||
|
else {
|
||||||
|
cachePort->waitingOnRetry = true;
|
||||||
|
DPRINTF(CachePort, "%s now waiting on a retry\n", cachePort->name());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!cachePort->isCpuSide)
|
else if (!cachePort->isCpuSide)
|
||||||
{
|
{
|
||||||
|
DPRINTF(CachePort, "%s trying to send a MSHR request\n", cachePort->name());
|
||||||
assert(cachePort->cache->doMasterRequest());
|
assert(cachePort->cache->doMasterRequest());
|
||||||
//MSHR
|
//MSHR
|
||||||
pkt = cachePort->cache->getPacket();
|
pkt = cachePort->cache->getPacket();
|
||||||
|
@ -230,8 +247,10 @@ BaseCache::CacheEvent::process()
|
||||||
pkt->getAddr(), success ? "succesful" : "unsuccesful");
|
pkt->getAddr(), success ? "succesful" : "unsuccesful");
|
||||||
cachePort->cache->sendResult(pkt, mshr, success);
|
cachePort->cache->sendResult(pkt, mshr, success);
|
||||||
cachePort->waitingOnRetry = !success;
|
cachePort->waitingOnRetry = !success;
|
||||||
|
if (cachePort->waitingOnRetry) DPRINTF(CachePort, "%s now waiting on a retry\n", cachePort->name());
|
||||||
if (success && cachePort->cache->doMasterRequest())
|
if (success && cachePort->cache->doMasterRequest())
|
||||||
{
|
{
|
||||||
|
DPRINTF(CachePort, "%s still more MSHR requests to send\n", cachePort->name());
|
||||||
//Still more to issue, rerequest in 1 cycle
|
//Still more to issue, rerequest in 1 cycle
|
||||||
pkt = NULL;
|
pkt = NULL;
|
||||||
this->schedule(curTick+1);
|
this->schedule(curTick+1);
|
||||||
|
@ -264,12 +283,15 @@ BaseCache::CacheEvent::process()
|
||||||
else
|
else
|
||||||
pkt->result = Packet::Success;
|
pkt->result = Packet::Success;
|
||||||
pkt->makeTimingResponse();
|
pkt->makeTimingResponse();
|
||||||
|
DPRINTF(CachePort, "%s attempting to send a response\n", cachePort->name());
|
||||||
if (!cachePort->drainList.empty()) {
|
if (!cachePort->drainList.empty()) {
|
||||||
//Already have a list, just append
|
//Already have a list, just append
|
||||||
cachePort->drainList.push_back(pkt);
|
cachePort->drainList.push_back(pkt);
|
||||||
|
DPRINTF(CachePort, "%s appending response onto drain list\n", cachePort->name());
|
||||||
}
|
}
|
||||||
else if (!cachePort->sendTiming(pkt)) {
|
else if (!cachePort->sendTiming(pkt)) {
|
||||||
//It failed, save it to list of drain events
|
//It failed, save it to list of drain events
|
||||||
|
DPRINTF(CachePort, "%s now waiting for a retry\n", cachePort->name());
|
||||||
cachePort->drainList.push_back(pkt);
|
cachePort->drainList.push_back(pkt);
|
||||||
cachePort->waitingOnRetry = true;
|
cachePort->waitingOnRetry = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue