NUM_BLOCKED_CAUSES
};
- /**
- * Reasons for cache to request a bus.
- */
- enum RequestCause {
- Request_MSHR = MSHRQueue_MSHRs,
- Request_WB = MSHRQueue_WriteBuffer,
- Request_PF,
- NUM_REQUEST_CAUSES
- };
-
protected:
/**
* cache, and in addition to the basic timing port that only sends
* response packets through a transmit list, it also offers the
* ability to schedule and send request packets (requests &
- * writebacks). The send event is scheduled through requestBus,
+ * writebacks). The send event is scheduled through schedSendEvent,
* and the sendDeferredPacket of the timing port is modified to
* consider both the transmit list and the requests from the MSHR.
*/
* Schedule a send of a request packet (from the MSHR). Note
* that we could already have a retry outstanding.
*/
- void requestBus(RequestCause cause, Tick time)
+ void schedSendEvent(Tick time)
{
- DPRINTF(CachePort, "Scheduling request at %llu due to %d\n",
- time, cause);
+ DPRINTF(CachePort, "Scheduling send event at %llu\n", time);
reqQueue.schedSendEvent(time);
}
* - MSHR allocateMissBuffer (miss in MSHR queue);
*/
MSHR *allocateBufferInternal(MSHRQueue *mq, Addr addr, int size,
- PacketPtr pkt, Tick time, bool requestBus)
+ PacketPtr pkt, Tick time,
+ bool sched_send)
{
// check that the address is block aligned since we rely on
// this in a number of places when checking for matches and
setBlocked((BlockedCause)mq->index);
}
- if (requestBus) {
- requestMemSideBus((RequestCause)mq->index, time);
- }
+ if (sched_send)
+ // schedule the send
+ schedMemSideSendEvent(time);
return mshr;
}
const AddrRangeList &getAddrRanges() const { return addrRanges; }
- MSHR *allocateMissBuffer(PacketPtr pkt, Tick time, bool requestBus)
+ MSHR *allocateMissBuffer(PacketPtr pkt, Tick time, bool sched_send = true)
{
return allocateBufferInternal(&mshrQueue,
blockAlign(pkt->getAddr()), blkSize,
- pkt, time, requestBus);
+ pkt, time, sched_send);
}
- MSHR *allocateWriteBuffer(PacketPtr pkt, Tick time, bool requestBus)
+ MSHR *allocateWriteBuffer(PacketPtr pkt, Tick time)
{
// should only see clean evictions in a read-only cache
assert(!isReadOnly || pkt->cmd == MemCmd::CleanEvict);
assert(pkt->isWrite() && !pkt->isRead());
return allocateBufferInternal(&writeBuffer,
blockAlign(pkt->getAddr()), blkSize,
- pkt, time, requestBus);
+ pkt, time, true);
}
/**
}
/**
- * Request the master bus for the given cause and time.
- * @param cause The reason for the request.
- * @param time The time to make the request.
- */
- void requestMemSideBus(RequestCause cause, Tick time)
- {
- memSidePort->requestBus(cause, time);
- }
-
- /**
- * Clear the master bus request for the given cause.
- * @param cause The request reason to clear.
+ * Schedule a send event for the memory-side port. If already
+ * scheduled, this may reschedule the event at an earlier
+ * time. When the specified time is reached, the port is free to
+ * send either a response, a request, or a prefetch request.
+ *
+ * @param time The time when to attempt sending a packet.
*/
- void deassertMemSideBusRequest(RequestCause cause)
+ void schedMemSideSendEvent(Tick time)
{
- // Obsolete... we no longer signal bus requests explicitly so
- // we can't deassert them. Leaving this in as a no-op since
- // the prefetcher calls it to indicate that it no longer wants
- // to request a prefetch, and someday that might be
- // interesting again.
+ memSidePort->schedSendEvent(time);
}
virtual bool inCache(Addr addr, bool is_secure) const = 0;
Cache::markInService(MSHR *mshr, bool pending_dirty_resp)
{
markInServiceInternal(mshr, pending_dirty_resp);
-#if 0
- if (mshr->originalCmd == MemCmd::HardPFReq) {
- DPRINTF(HWPrefetch, "Marking a HW_PF in service\n");
- //Also clear pending if need be
- if (!prefetcher->havePending())
- {
- deassertMemSideBusRequest(Request_PF);
- }
- }
-#endif
}
// the Writeback does not reset the bit corresponding to this
// address in the snoop filter below.
wbPkt->setBlockCached();
- allocateWriteBuffer(wbPkt, forward_time, true);
+ allocateWriteBuffer(wbPkt, forward_time);
}
} else {
// If the block is not cached above, send packet below. Both
// CleanEvict and Writeback with BLOCK_CACHED flag cleared will
// reset the bit corresponding to this address in the snoop filter
// below.
- allocateWriteBuffer(wbPkt, forward_time, true);
+ allocateWriteBuffer(wbPkt, forward_time);
}
writebacks.pop_front();
}
if (pkt->evictingBlock() ||
(pkt->req->isUncacheable() && pkt->isWrite())) {
// We use forward_time here because there is an
- // uncached memory write, forwarded to WriteBuffer. It
- // specifies the latency to allocate an internal buffer and to
- // schedule an event to the queued port and also takes into
- // account the additional delay of the xbar.
- allocateWriteBuffer(pkt, forward_time, true);
+ // uncached memory write, forwarded to WriteBuffer.
+ allocateWriteBuffer(pkt, forward_time);
} else {
if (blk && blk->isValid()) {
// should have flushed and have no valid block
}
// Here we are using forward_time, modelling the latency of
// a miss (outbound) just as forwardLatency, neglecting the
- // lookupLatency component. In this case this latency value
- // specifies the latency to allocate an internal buffer and to
- // schedule an event to the queued port, when a cacheable miss
- // is forwarded to MSHR queue.
- // We take also into account the additional delay of the xbar.
- allocateMissBuffer(pkt, forward_time, true);
+ // lookupLatency component.
+ allocateMissBuffer(pkt, forward_time);
}
if (prefetcher) {
}
}
}
- // Here we condiser just forward_time.
+
if (next_pf_time != MaxTick)
- requestMemSideBus(Request_PF, std::max(clockEdge(forwardLatency),
- next_pf_time));
+ schedMemSideSendEvent(next_pf_time);
return true;
}
}
mq = mshr->queue;
mq->markPending(mshr);
- requestMemSideBus((RequestCause)mq->index, clockEdge() +
- pkt->payloadDelay);
+ schedMemSideSendEvent(clockEdge() + pkt->payloadDelay);
} else {
mq->deallocate(mshr);
if (wasFull && !mq->isFull()) {
// MSHRs for a prefetch to take place
if (prefetcher && mq == &mshrQueue && mshrQueue.canPrefetch()) {
Tick next_pf_time = std::max(prefetcher->nextPrefetchReadyTime(),
- curTick());
+ clockEdge());
if (next_pf_time != MaxTick)
- requestMemSideBus(Request_PF, next_pf_time);
+ schedMemSideSendEvent(next_pf_time);
}
}
// reset the xbar additional timinig as it is now accounted for
// queued port.
if (blk->isDirty()) {
PacketPtr wbPkt = writebackBlk(blk);
- allocateWriteBuffer(wbPkt, forward_time, true);
+ allocateWriteBuffer(wbPkt, forward_time);
// Set BLOCK_CACHED flag if cached above.
if (isCachedAbove(wbPkt))
wbPkt->setBlockCached();
if (isCachedAbove(wcPkt))
delete wcPkt;
else
- allocateWriteBuffer(wcPkt, forward_time, true);
+ allocateWriteBuffer(wcPkt, forward_time);
}
blk->invalidate();
}
// (hwpf_mshr_misses)
assert(pkt->req->masterId() < system->maxMasters());
mshr_misses[pkt->cmdToIndex()][pkt->req->masterId()]++;
- // Don't request bus, since we already have it
+
+ // allocate an MSHR and return it, note
+ // that we send the packet straight away, so do not
+ // schedule the send
return allocateMissBuffer(pkt, curTick(), false);
} else {
// free the request and packet