Set size properly on uncache accesses
Don't use the senderState after you get a succesful sendTiming. Not guarnteed to be correct src/mem/cache/base_cache.cc: src/mem/cache/base_cache.hh: src/mem/cache/cache.hh: src/mem/cache/cache_impl.hh: src/mem/cache/miss/blocking_buffer.cc: src/mem/cache/miss/blocking_buffer.hh: src/mem/cache/miss/miss_queue.hh: Don't use the senderState after you get a succesful sendTiming. Not guarnteed to be correct --HG-- extra : convert_revision : 2e8e812bf7fd3ba2b4cba7f7173cb41862f761af
This commit is contained in:
parent
bc732b59fd
commit
afce51d10a
8 changed files with 31 additions and 21 deletions
16
src/mem/cache/base_cache.cc
vendored
16
src/mem/cache/base_cache.cc
vendored
|
@ -109,10 +109,11 @@ BaseCache::CachePort::recvRetry()
|
||||||
if (!isCpuSide)
|
if (!isCpuSide)
|
||||||
{
|
{
|
||||||
pkt = cache->getPacket();
|
pkt = cache->getPacket();
|
||||||
|
MSHR* mshr = (MSHR*)pkt->senderState;
|
||||||
bool success = sendTiming(pkt);
|
bool success = sendTiming(pkt);
|
||||||
DPRINTF(Cache, "Address %x was %s in sending the timing request\n",
|
DPRINTF(Cache, "Address %x was %s in sending the timing request\n",
|
||||||
pkt->getAddr(), success ? "succesful" : "unsuccesful");
|
pkt->getAddr(), success ? "succesful" : "unsuccesful");
|
||||||
cache->sendResult(pkt, success);
|
cache->sendResult(pkt, mshr, success);
|
||||||
if (success && cache->doMasterRequest())
|
if (success && cache->doMasterRequest())
|
||||||
{
|
{
|
||||||
//Still more to issue, rerequest in 1 cycle
|
//Still more to issue, rerequest in 1 cycle
|
||||||
|
@ -123,7 +124,9 @@ BaseCache::CachePort::recvRetry()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pkt = cache->getCoherencePacket();
|
//pkt = cache->getCoherencePacket();
|
||||||
|
//We save the packet, no reordering on CSHRS
|
||||||
|
pkt = cshrRetry;
|
||||||
bool success = sendTiming(pkt);
|
bool success = sendTiming(pkt);
|
||||||
if (success && cache->doSlaveRequest())
|
if (success && cache->doSlaveRequest())
|
||||||
{
|
{
|
||||||
|
@ -182,10 +185,11 @@ BaseCache::CacheEvent::process()
|
||||||
{
|
{
|
||||||
//MSHR
|
//MSHR
|
||||||
pkt = cachePort->cache->getPacket();
|
pkt = cachePort->cache->getPacket();
|
||||||
|
MSHR* mshr = (MSHR*) pkt->senderState;
|
||||||
bool success = cachePort->sendTiming(pkt);
|
bool success = cachePort->sendTiming(pkt);
|
||||||
DPRINTF(Cache, "Address %x was %s in sending the timing request\n",
|
DPRINTF(Cache, "Address %x was %s in sending the timing request\n",
|
||||||
pkt->getAddr(), success ? "succesful" : "unsuccesful");
|
pkt->getAddr(), success ? "succesful" : "unsuccesful");
|
||||||
cachePort->cache->sendResult(pkt, success);
|
cachePort->cache->sendResult(pkt, mshr, success);
|
||||||
if (success && cachePort->cache->doMasterRequest())
|
if (success && cachePort->cache->doMasterRequest())
|
||||||
{
|
{
|
||||||
//Still more to issue, rerequest in 1 cycle
|
//Still more to issue, rerequest in 1 cycle
|
||||||
|
@ -198,7 +202,11 @@ BaseCache::CacheEvent::process()
|
||||||
//CSHR
|
//CSHR
|
||||||
pkt = cachePort->cache->getCoherencePacket();
|
pkt = cachePort->cache->getCoherencePacket();
|
||||||
bool success = cachePort->sendTiming(pkt);
|
bool success = cachePort->sendTiming(pkt);
|
||||||
if (success && cachePort->cache->doSlaveRequest())
|
if (!success) {
|
||||||
|
//Need to send on a retry
|
||||||
|
cachePort->cshrRetry = pkt;
|
||||||
|
}
|
||||||
|
else if (cachePort->cache->doSlaveRequest())
|
||||||
{
|
{
|
||||||
//Still more to issue, rerequest in 1 cycle
|
//Still more to issue, rerequest in 1 cycle
|
||||||
pkt = NULL;
|
pkt = NULL;
|
||||||
|
|
5
src/mem/cache/base_cache.hh
vendored
5
src/mem/cache/base_cache.hh
vendored
|
@ -72,6 +72,7 @@ enum RequestCause{
|
||||||
Request_PF
|
Request_PF
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class MSHR;
|
||||||
/**
|
/**
|
||||||
* A basic cache interface. Implements some common functions for speed.
|
* A basic cache interface. Implements some common functions for speed.
|
||||||
*/
|
*/
|
||||||
|
@ -112,6 +113,8 @@ class BaseCache : public MemObject
|
||||||
bool isCpuSide;
|
bool isCpuSide;
|
||||||
|
|
||||||
std::list<Packet *> drainList;
|
std::list<Packet *> drainList;
|
||||||
|
|
||||||
|
Packet *cshrRetry;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CacheEvent : public Event
|
struct CacheEvent : public Event
|
||||||
|
@ -177,7 +180,7 @@ class BaseCache : public MemObject
|
||||||
fatal("No implementation");
|
fatal("No implementation");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void sendResult(Packet* &pkt, bool success)
|
virtual void sendResult(Packet* &pkt, MSHR* mshr, bool success)
|
||||||
{
|
{
|
||||||
|
|
||||||
fatal("No implementation");
|
fatal("No implementation");
|
||||||
|
|
2
src/mem/cache/cache.hh
vendored
2
src/mem/cache/cache.hh
vendored
|
@ -175,7 +175,7 @@ class Cache : public BaseCache
|
||||||
* @param pkt The request.
|
* @param pkt The request.
|
||||||
* @param success True if the request was sent successfully.
|
* @param success True if the request was sent successfully.
|
||||||
*/
|
*/
|
||||||
virtual void sendResult(Packet * &pkt, bool success);
|
virtual void sendResult(Packet * &pkt, MSHR* mshr, bool success);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles a response (cache line fill/write ack) from the bus.
|
* Handles a response (cache line fill/write ack) from the bus.
|
||||||
|
|
6
src/mem/cache/cache_impl.hh
vendored
6
src/mem/cache/cache_impl.hh
vendored
|
@ -287,10 +287,10 @@ Cache<TagStore,Buffering,Coherence>::getPacket()
|
||||||
|
|
||||||
template<class TagStore, class Buffering, class Coherence>
|
template<class TagStore, class Buffering, class Coherence>
|
||||||
void
|
void
|
||||||
Cache<TagStore,Buffering,Coherence>::sendResult(PacketPtr &pkt, bool success)
|
Cache<TagStore,Buffering,Coherence>::sendResult(PacketPtr &pkt, MSHR* mshr, bool success)
|
||||||
{
|
{
|
||||||
if (success) {
|
if (success) {
|
||||||
missQueue->markInService(pkt);
|
missQueue->markInService(pkt, mshr);
|
||||||
//Temp Hack for UPGRADES
|
//Temp Hack for UPGRADES
|
||||||
if (pkt->cmd == Packet::UpgradeReq) {
|
if (pkt->cmd == Packet::UpgradeReq) {
|
||||||
handleResponse(pkt);
|
handleResponse(pkt);
|
||||||
|
@ -444,7 +444,7 @@ Cache<TagStore,Buffering,Coherence>::snoop(Packet * &pkt)
|
||||||
|
|
||||||
if (pkt->isInvalidate()) {
|
if (pkt->isInvalidate()) {
|
||||||
//This must be an upgrade or other cache will take ownership
|
//This must be an upgrade or other cache will take ownership
|
||||||
missQueue->markInService(mshr->pkt);
|
missQueue->markInService(mshr->pkt, mshr);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
6
src/mem/cache/miss/blocking_buffer.cc
vendored
6
src/mem/cache/miss/blocking_buffer.cc
vendored
|
@ -123,12 +123,12 @@ BlockingBuffer::restoreOrigCmd(Packet * &pkt)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BlockingBuffer::markInService(Packet * &pkt)
|
BlockingBuffer::markInService(Packet * &pkt, MSHR* mshr)
|
||||||
{
|
{
|
||||||
if (!pkt->isCacheFill() && pkt->isWrite()) {
|
if (!pkt->isCacheFill() && pkt->isWrite()) {
|
||||||
// Forwarding a write/ writeback, don't need to change
|
// Forwarding a write/ writeback, don't need to change
|
||||||
// the command
|
// the command
|
||||||
assert((MSHR*)pkt->senderState == &wb);
|
assert(mshr == &wb);
|
||||||
cache->clearMasterRequest(Request_WB);
|
cache->clearMasterRequest(Request_WB);
|
||||||
if (!pkt->needsResponse()) {
|
if (!pkt->needsResponse()) {
|
||||||
assert(wb.getNumTargets() == 0);
|
assert(wb.getNumTargets() == 0);
|
||||||
|
@ -138,7 +138,7 @@ BlockingBuffer::markInService(Packet * &pkt)
|
||||||
wb.inService = true;
|
wb.inService = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert((MSHR*)pkt->senderState == &miss);
|
assert(mshr == &miss);
|
||||||
cache->clearMasterRequest(Request_MSHR);
|
cache->clearMasterRequest(Request_MSHR);
|
||||||
if (!pkt->needsResponse()) {
|
if (!pkt->needsResponse()) {
|
||||||
assert(miss.getNumTargets() == 0);
|
assert(miss.getNumTargets() == 0);
|
||||||
|
|
2
src/mem/cache/miss/blocking_buffer.hh
vendored
2
src/mem/cache/miss/blocking_buffer.hh
vendored
|
@ -152,7 +152,7 @@ public:
|
||||||
* are successfully sent.
|
* are successfully sent.
|
||||||
* @param pkt The request that was sent on the bus.
|
* @param pkt The request that was sent on the bus.
|
||||||
*/
|
*/
|
||||||
void markInService(Packet * &pkt);
|
void markInService(Packet * &pkt, MSHR* mshr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees the resources of the pktuest and unblock the cache.
|
* Frees the resources of the pktuest and unblock the cache.
|
||||||
|
|
13
src/mem/cache/miss/miss_queue.cc
vendored
13
src/mem/cache/miss/miss_queue.cc
vendored
|
@ -372,7 +372,7 @@ MissQueue::allocateMiss(Packet * &pkt, int size, Tick time)
|
||||||
MSHR*
|
MSHR*
|
||||||
MissQueue::allocateWrite(Packet * &pkt, int size, Tick time)
|
MissQueue::allocateWrite(Packet * &pkt, int size, Tick time)
|
||||||
{
|
{
|
||||||
MSHR* mshr = wb.allocate(pkt,blkSize);
|
MSHR* mshr = wb.allocate(pkt,size);
|
||||||
mshr->order = order++;
|
mshr->order = order++;
|
||||||
|
|
||||||
//REMOVING COMPRESSION FOR NOW
|
//REMOVING COMPRESSION FOR NOW
|
||||||
|
@ -446,7 +446,7 @@ MissQueue::handleMiss(Packet * &pkt, int blkSize, Tick time)
|
||||||
/**
|
/**
|
||||||
* @todo Add write merging here.
|
* @todo Add write merging here.
|
||||||
*/
|
*/
|
||||||
mshr = allocateWrite(pkt, blkSize, time);
|
mshr = allocateWrite(pkt, pkt->getSize(), time);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,9 +526,8 @@ MissQueue::restoreOrigCmd(Packet * &pkt)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MissQueue::markInService(Packet * &pkt)
|
MissQueue::markInService(Packet * &pkt, MSHR* mshr)
|
||||||
{
|
{
|
||||||
assert(pkt->senderState != 0);
|
|
||||||
bool unblock = false;
|
bool unblock = false;
|
||||||
BlockedCause cause = NUM_BLOCKED_CAUSES;
|
BlockedCause cause = NUM_BLOCKED_CAUSES;
|
||||||
|
|
||||||
|
@ -540,7 +539,7 @@ MissQueue::markInService(Packet * &pkt)
|
||||||
// Forwarding a write/ writeback, don't need to change
|
// Forwarding a write/ writeback, don't need to change
|
||||||
// the command
|
// the command
|
||||||
unblock = wb.isFull();
|
unblock = wb.isFull();
|
||||||
wb.markInService((MSHR*)pkt->senderState);
|
wb.markInService(mshr);
|
||||||
if (!wb.havePending()){
|
if (!wb.havePending()){
|
||||||
cache->clearMasterRequest(Request_WB);
|
cache->clearMasterRequest(Request_WB);
|
||||||
}
|
}
|
||||||
|
@ -551,11 +550,11 @@ MissQueue::markInService(Packet * &pkt)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unblock = mq.isFull();
|
unblock = mq.isFull();
|
||||||
mq.markInService((MSHR*)pkt->senderState);
|
mq.markInService(mshr);
|
||||||
if (!mq.havePending()){
|
if (!mq.havePending()){
|
||||||
cache->clearMasterRequest(Request_MSHR);
|
cache->clearMasterRequest(Request_MSHR);
|
||||||
}
|
}
|
||||||
if (((MSHR*)(pkt->senderState))->originalCmd == Packet::HardPFReq) {
|
if (mshr->originalCmd == Packet::HardPFReq) {
|
||||||
DPRINTF(HWPrefetch, "%s:Marking a HW_PF in service\n",
|
DPRINTF(HWPrefetch, "%s:Marking a HW_PF in service\n",
|
||||||
cache->name());
|
cache->name());
|
||||||
//Also clear pending if need be
|
//Also clear pending if need be
|
||||||
|
|
2
src/mem/cache/miss/miss_queue.hh
vendored
2
src/mem/cache/miss/miss_queue.hh
vendored
|
@ -256,7 +256,7 @@ class MissQueue
|
||||||
* are successfully sent.
|
* are successfully sent.
|
||||||
* @param pkt The request that was sent on the bus.
|
* @param pkt The request that was sent on the bus.
|
||||||
*/
|
*/
|
||||||
void markInService(Packet * &pkt);
|
void markInService(Packet * &pkt, MSHR* mshr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collect statistics and free resources of a satisfied pktuest.
|
* Collect statistics and free resources of a satisfied pktuest.
|
||||||
|
|
Loading…
Reference in a new issue