gem5
v20.1.0.0
|
A coherent cache that can be arranged in flexible topologies. More...
#include <cache.hh>
Public Member Functions | |
Cache (const CacheParams *p) | |
Instantiates a basic cache object. More... | |
bool | sendMSHRQueuePacket (MSHR *mshr) override |
Take an MSHR, turn it into a suitable downstream packet, and send it out. More... | |
Public Member Functions inherited from BaseCache | |
void | regProbePoints () override |
Registers probes. More... | |
BaseCache (const BaseCacheParams *p, unsigned blk_size) | |
~BaseCache () | |
void | init () override |
init() is called after all C++ SimObjects have been created and all ports are connected. More... | |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a port with a given name and index. More... | |
unsigned | getBlockSize () const |
Query block size of a cache. More... | |
const AddrRangeList & | getAddrRanges () const |
MSHR * | allocateMissBuffer (PacketPtr pkt, Tick time, bool sched_send=true) |
void | allocateWriteBuffer (PacketPtr pkt, Tick time) |
bool | isBlocked () const |
Returns true if the cache is blocked for accesses. More... | |
void | setBlocked (BlockedCause cause) |
Marks the access path of the cache as blocked for the given cause. More... | |
void | clearBlocked (BlockedCause cause) |
Marks the cache as unblocked for the given cause. More... | |
void | schedMemSideSendEvent (Tick time) |
Schedule a send event for the memory-side port. More... | |
bool | inCache (Addr addr, bool is_secure) const |
bool | hasBeenPrefetched (Addr addr, bool is_secure) const |
bool | inMissQueue (Addr addr, bool is_secure) const |
void | incMissCount (PacketPtr pkt) |
void | incHitCount (PacketPtr pkt) |
bool | coalesce () const |
Checks if the cache is coalescing writes. More... | |
void | writebackVisitor (CacheBlk &blk) |
Cache block visitor that writes back dirty cache blocks using functional writes. More... | |
void | invalidateVisitor (CacheBlk &blk) |
Cache block visitor that invalidates all blocks in the cache. More... | |
bool | sendWriteQueuePacket (WriteQueueEntry *wq_entry) |
Similar to sendMSHR, but for a write-queue entry instead. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize the state of the caches. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from ClockedObject | |
ClockedObject (const ClockedObjectParams *p) | |
const Params * | params () const |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from SimObject | |
const Params * | params () const |
SimObject (const Params *_params) | |
virtual | ~SimObject () |
virtual const std::string | name () const |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
virtual void | regProbeListeners () |
Register probe listeners for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More... | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. More... | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
Public Member Functions inherited from Stats::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. More... | |
virtual void | resetStats () |
Callback to reset stats. More... | |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (Stats::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. More... | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from Clocked | |
void | updateClockPeriod () |
Update the tick to the current tick. More... | |
Tick | clockEdge (Cycles cycles=Cycles(0)) const |
Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More... | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. More... | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More... | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Protected Member Functions | |
void | promoteWholeLineWrites (PacketPtr pkt) |
Turn line-sized writes into WriteInvalidate transactions. More... | |
bool | access (PacketPtr pkt, CacheBlk *&blk, Cycles &lat, PacketList &writebacks) override |
Does all the processing necessary to perform the provided request. More... | |
void | handleTimingReqHit (PacketPtr pkt, CacheBlk *blk, Tick request_time) override |
void | handleTimingReqMiss (PacketPtr pkt, CacheBlk *blk, Tick forward_time, Tick request_time) override |
void | recvTimingReq (PacketPtr pkt) override |
Performs the access specified by the request. More... | |
void | doWritebacks (PacketList &writebacks, Tick forward_time) override |
Insert writebacks into the write buffer. More... | |
void | doWritebacksAtomic (PacketList &writebacks) override |
Send writebacks down the memory hierarchy in atomic mode. More... | |
void | serviceMSHRTargets (MSHR *mshr, const PacketPtr pkt, CacheBlk *blk) override |
Service non-deferred MSHR targets using the received response. More... | |
void | recvTimingSnoopReq (PacketPtr pkt) override |
Snoops bus transactions to maintain coherence. More... | |
void | recvTimingSnoopResp (PacketPtr pkt) override |
Handle a snoop response. More... | |
Cycles | handleAtomicReqMiss (PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) override |
Handle a request in atomic mode that missed in this cache. More... | |
Tick | recvAtomic (PacketPtr pkt) override |
Performs the access specified by the request. More... | |
Tick | recvAtomicSnoop (PacketPtr pkt) override |
Snoop for the provided request in the cache and return the estimated time taken. More... | |
void | satisfyRequest (PacketPtr pkt, CacheBlk *blk, bool deferred_response=false, bool pending_downgrade=false) override |
Perform any necessary updates to the block and perform any data exchange between the packet and the block. More... | |
void | doTimingSupplyResponse (PacketPtr req_pkt, const uint8_t *blk_data, bool already_copied, bool pending_inval) |
uint32_t | handleSnoop (PacketPtr pkt, CacheBlk *blk, bool is_timing, bool is_deferred, bool pending_inval) |
Perform an upward snoop if needed, and update the block state (possibly invalidating the block). More... | |
M5_NODISCARD PacketPtr | evictBlock (CacheBlk *blk) override |
Evict a cache block. More... | |
PacketPtr | cleanEvictBlk (CacheBlk *blk) |
Create a CleanEvict request for the given block. More... | |
PacketPtr | createMissPacket (PacketPtr cpu_pkt, CacheBlk *blk, bool needs_writable, bool is_whole_line_write) const override |
Create an appropriate downstream bus request packet. More... | |
bool | isCachedAbove (PacketPtr pkt, bool is_timing=true) |
Send up a snoop request and find cached copies. More... | |
Protected Member Functions inherited from BaseCache | |
void | markInService (MSHR *mshr, bool pending_modified_resp) |
Mark a request as in service (sent downstream in the memory system), effectively making this MSHR the ordering point. More... | |
void | markInService (WriteQueueEntry *entry) |
bool | allocOnFill (MemCmd cmd) const |
Determine whether we should allocate on a fill or not. More... | |
Addr | regenerateBlkAddr (CacheBlk *blk) |
Regenerate block address using tags. More... | |
Cycles | calculateTagOnlyLatency (const uint32_t delay, const Cycles lookup_lat) const |
Calculate latency of accesses that only touch the tag array. More... | |
Cycles | calculateAccessLatency (const CacheBlk *blk, const uint32_t delay, const Cycles lookup_lat) const |
Calculate access latency in ticks given a tag lookup latency, and whether access was a hit or miss. More... | |
void | handleTimingReqMiss (PacketPtr pkt, MSHR *mshr, CacheBlk *blk, Tick forward_time, Tick request_time) |
void | handleUncacheableWriteResp (PacketPtr pkt) |
Handling the special case of uncacheable write responses to make recvTimingResp less cluttered. More... | |
virtual void | recvTimingResp (PacketPtr pkt) |
Handles a response (cache line fill/write ack) from the bus. More... | |
virtual void | functionalAccess (PacketPtr pkt, bool from_cpu_side) |
Performs the access specified by the request. More... | |
void | cmpAndSwap (CacheBlk *blk, PacketPtr pkt) |
Handle doing the Compare and Swap function for SPARC. More... | |
QueueEntry * | getNextQueueEntry () |
Return the next queue entry to service, either a pending miss from the MSHR queue, a buffered write from the write buffer, or something from the prefetcher. More... | |
void | writebackTempBlockAtomic () |
Send the outstanding tempBlock writeback. More... | |
bool | updateCompressionData (CacheBlk *blk, const uint64_t *data, PacketList &writebacks) |
When a block is overwriten, its compression information must be updated, and it may need to be recompressed. More... | |
void | maintainClusivity (bool from_cache, CacheBlk *blk) |
Maintain the clusivity of this cache by potentially invalidating a block. More... | |
bool | handleEvictions (std::vector< CacheBlk * > &evict_blks, PacketList &writebacks) |
Try to evict the given blocks. More... | |
CacheBlk * | handleFill (PacketPtr pkt, CacheBlk *blk, PacketList &writebacks, bool allocate) |
Handle a fill operation caused by a received packet. More... | |
CacheBlk * | allocateBlock (const PacketPtr pkt, PacketList &writebacks) |
Allocate a new block and perform any necessary writebacks. More... | |
void | evictBlock (CacheBlk *blk, PacketList &writebacks) |
Evict a cache block. More... | |
void | invalidateBlock (CacheBlk *blk) |
Invalidate a cache block. More... | |
PacketPtr | writebackBlk (CacheBlk *blk) |
Create a writeback request for the given block. More... | |
PacketPtr | writecleanBlk (CacheBlk *blk, Request::Flags dest, PacketId id) |
Create a writeclean request for the given block. More... | |
virtual void | memWriteback () override |
Write back dirty blocks in the cache using functional accesses. More... | |
virtual void | memInvalidate () override |
Invalidates all blocks in the cache. More... | |
bool | isDirty () const |
Determine if there are any dirty blocks in the cache. More... | |
bool | inRange (Addr addr) const |
Determine if an address is in the ranges covered by this cache. More... | |
Tick | nextQueueReadyTime () const |
Find next request ready time from among possible sources. More... | |
Protected Member Functions inherited from Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
Protected Member Functions inherited from Clocked | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. More... | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. More... | |
void | resetClock () const |
Reset the object's clock using the current global tick value. More... | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More... | |
Protected Attributes | |
const bool | doFastWrites |
This cache should allocate a block on a line-sized write miss. More... | |
std::unordered_set< RequestPtr > | outstandingSnoop |
Store the outstanding requests that we are expecting snoop responses from so we can determine which snoop responses we generated and which ones were merely forwarded. More... | |
Protected Attributes inherited from BaseCache | |
CpuSidePort | cpuSidePort |
MemSidePort | memSidePort |
MSHRQueue | mshrQueue |
Miss status registers. More... | |
WriteQueue | writeBuffer |
Write/writeback buffer. More... | |
BaseTags * | tags |
Tag and data Storage. More... | |
Compressor::Base * | compressor |
Compression method being used. More... | |
Prefetcher::Base * | prefetcher |
Prefetcher. More... | |
ProbePointArg< PacketPtr > * | ppHit |
To probe when a cache hit occurs. More... | |
ProbePointArg< PacketPtr > * | ppMiss |
To probe when a cache miss occurs. More... | |
ProbePointArg< PacketPtr > * | ppFill |
To probe when a cache fill occurs. More... | |
WriteAllocator *const | writeAllocator |
The writeAllocator drive optimizations for streaming writes. More... | |
TempCacheBlk * | tempBlock |
Temporary cache block for occasional transitory use. More... | |
std::unique_ptr< Packet > | pendingDelete |
Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent call. More... | |
const bool | writebackClean |
Determine if clean lines should be written back or not. More... | |
PacketPtr | tempBlockWriteback |
Writebacks from the tempBlock, resulting on the response path in atomic mode, must happen after the call to recvAtomic has finished (for the right ordering of the packets). More... | |
EventFunctionWrapper | writebackTempBlockAtomicEvent |
An event to writeback the tempBlock after recvAtomic finishes. More... | |
const unsigned | blkSize |
Block size of this cache. More... | |
const Cycles | lookupLatency |
The latency of tag lookup of a cache. More... | |
const Cycles | dataLatency |
The latency of data access of a cache. More... | |
const Cycles | forwardLatency |
This is the forward latency of the cache. More... | |
const Cycles | fillLatency |
The latency to fill a cache block. More... | |
const Cycles | responseLatency |
The latency of sending reponse to its upper level cache/core on a linefill. More... | |
const bool | sequentialAccess |
Whether tags and data are accessed sequentially. More... | |
const int | numTarget |
The number of targets for each MSHR. More... | |
bool | forwardSnoops |
Do we forward snoops from mem side port through to cpu side port? More... | |
const Enums::Clusivity | clusivity |
Clusivity with respect to the upstream cache, determining if we fill into both this cache and the cache above on a miss. More... | |
const bool | isReadOnly |
Is this cache read only, for example the instruction cache, or table-walker cache. More... | |
uint8_t | blocked |
Bit vector of the blocking reasons for the access path. More... | |
uint64_t | order |
Increasing order number assigned to each incoming request. More... | |
Cycles | blockedCycle |
Stores time the cache blocked for statistics. More... | |
MSHR * | noTargetMSHR |
Pointer to the MSHR that has no targets. More... | |
Counter | missCount |
The number of misses to trigger an exit event. More... | |
const AddrRangeList | addrRanges |
The address range to which the cache responds on the CPU side. More... | |
Protected Attributes inherited from SimObject | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
Protected Attributes inherited from EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Additional Inherited Members | |
Public Types inherited from BaseCache | |
enum | BlockedCause { Blocked_NoMSHRs = MSHRQueue_MSHRs, Blocked_NoWBBuffers = MSHRQueue_WriteBuffer, Blocked_NoTargets, NUM_BLOCKED_CAUSES } |
Reasons for caches to be blocked. More... | |
Public Types inherited from ClockedObject | |
typedef ClockedObjectParams | Params |
Parameters of ClockedObject. More... | |
Public Types inherited from SimObject | |
typedef SimObjectParams | Params |
Static Public Member Functions inherited from SimObject | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Public Attributes inherited from BaseCache | |
System * | system |
System we are currently operating in. More... | |
BaseCache::CacheStats | stats |
Public Attributes inherited from ClockedObject | |
PowerState * | powerState |
Protected Types inherited from BaseCache | |
enum | MSHRQueueIndex { MSHRQueue_MSHRs, MSHRQueue_WriteBuffer } |
Indexes to enumerate the MSHR queues. More... | |
A coherent cache that can be arranged in flexible topologies.
Cache::Cache | ( | const CacheParams * | p | ) |
|
overrideprotectedvirtual |
Does all the processing necessary to perform the provided request.
pkt | The memory request to perform. |
blk | The cache block to be updated. |
lat | The latency of the access. |
writebacks | List for any writebacks that need to be performed. |
Reimplemented from BaseCache.
Definition at line 156 of file cache.cc.
References BaseCache::access(), chatty_assert, DPRINTF, BaseCache::evictBlock(), BaseTags::findBlock(), Packet::getAddr(), BaseCache::isReadOnly, Packet::isRequest(), Packet::isSecure(), CacheBlk::isValid(), Packet::isWrite(), BaseCache::lookupLatency, SimObject::name(), Packet::print(), Packet::req, and BaseCache::tags.
Create a CleanEvict request for the given block.
blk | The block to evict. |
Definition at line 908 of file cache.cc.
References Packet::allocate(), BaseCache::blkSize, MemCmd::CleanEvict, DPRINTF, CacheBlk::isDirty(), CacheBlk::isSecure(), CacheBlk::isValid(), Packet::print(), BaseCache::regenerateBlkAddr(), Request::SECURE, CacheBlk::task_id, Request::wbRequestorId, and BaseCache::writebackClean.
Referenced by evictBlock().
|
overrideprotectedvirtual |
Create an appropriate downstream bus request packet.
Creates a new packet with the request to be send to the memory below, or nullptr if the current request in cpu_pkt should just be forwarded on.
cpu_pkt | The miss packet that needs to be satisfied. |
blk | The referenced block, can be nullptr. |
needs_writable | Indicates that the block must be writable even if the request in cpu_pkt doesn't indicate that. |
is_whole_line_write | True if there are writes for the whole line |
Implements BaseCache.
Definition at line 472 of file cache.cc.
References Packet::allocate(), BaseCache::blkSize, BaseCache::clusivity, Packet::cmd, DPRINTF, Packet::getAddr(), Packet::getBlockAddr(), Packet::hasSharers(), MemCmd::InvalidateReq, Packet::isClean(), Packet::isEviction(), Packet::isLLSC(), BaseCache::isReadOnly, Packet::isUpgrade(), CacheBlk::isValid(), CacheBlk::isWritable(), Packet::needsResponse(), Packet::print(), MemCmd::ReadCleanReq, MemCmd::ReadExReq, MemCmd::ReadSharedReq, Packet::req, MemCmd::SCUpgradeFailReq, MemCmd::SCUpgradeReq, Packet::setHasSharers(), MemCmd::StoreCondFailReq, MemCmd::UpgradeReq, and MemCmd::WriteLineReq.
Referenced by handleAtomicReqMiss().
|
protected |
Definition at line 936 of file cache.cc.
References BaseCache::blkSize, Clocked::clockEdge(), Packet::cmd, DPRINTF, BaseCache::forwardLatency, Packet::hasSharers(), Packet::headerDelay, Packet::isInvalidate(), Packet::isRead(), Packet::isRequest(), Packet::makeTimingResponse(), BaseCache::memSidePort, Packet::needsResponse(), Packet::payloadDelay, Packet::print(), MemCmd::ReadResp, MemCmd::ReadRespWithInvalidate, Packet::req, QueuedRequestPort::schedTimingSnoopResp(), and Packet::setDataFromBlock().
Referenced by handleSnoop(), and recvTimingSnoopReq().
|
overrideprotectedvirtual |
Insert writebacks into the write buffer.
Implements BaseCache.
Definition at line 185 of file cache.cc.
References BaseCache::allocateWriteBuffer(), MemCmd::CleanEvict, Packet::cmd, isCachedAbove(), Packet::setBlockCached(), MemCmd::WritebackClean, BaseCache::writebackClean, MemCmd::WritebackDirty, and MemCmd::WriteClean.
Referenced by handleSnoop().
|
overrideprotectedvirtual |
Send writebacks down the memory hierarchy in atomic mode.
Implements BaseCache.
Definition at line 227 of file cache.cc.
References Packet::cmd, isCachedAbove(), BaseCache::memSidePort, RequestPort::sendAtomic(), MemCmd::WritebackDirty, and MemCmd::WriteClean.
Referenced by handleSnoop().
Evict a cache block.
Performs a writeback if necesssary and invalidates the block
blk | Block to invalidate |
Implements BaseCache.
Definition at line 897 of file cache.cc.
References cleanEvictBlk(), BaseCache::invalidateBlock(), CacheBlk::isDirty(), BaseCache::writebackBlk(), and BaseCache::writebackClean.
|
overrideprotectedvirtual |
Handle a request in atomic mode that missed in this cache.
Creates a downstream request, sends it to the memory below and handles the response. As we are in atomic mode all operations are performed immediately.
pkt | The packet with the requests |
blk | The referenced block |
writebacks | A list with packets for any performed writebacks |
Implements BaseCache.
Definition at line 558 of file cache.cc.
References WriteAllocator::allocate(), BaseCache::allocOnFill(), BaseCache::blkSize, Packet::cmd, Packet::copyError(), createMissPacket(), DPRINTF, Packet::fromCache(), BaseCache::handleFill(), BaseCache::invalidateBlock(), Packet::isError(), Packet::isEviction(), Packet::isInvalidate(), Packet::isRead(), Packet::isResponse(), CacheBlk::isValid(), Packet::isWholeLineWrite(), Packet::isWrite(), BaseCache::maintainClusivity(), Packet::makeAtomicResponse(), BaseCache::memSidePort, Packet::needsResponse(), Packet::needsWritable(), Packet::print(), Packet::req, satisfyRequest(), RequestPort::sendAtomic(), CacheBlk::status, Clocked::ticksToCycles(), MemCmd::UpgradeResp, BaseCache::writeAllocator, and MemCmd::WriteClean.
|
protected |
Perform an upward snoop if needed, and update the block state (possibly invalidating the block).
Also create a response if required.
pkt | Snoop packet |
blk | Cache block being snooped |
is_timing | Timing or atomic for the response |
is_deferred | Is this a deferred snoop or not? |
pending_inval | Do we have a pending invalidation? |
Definition at line 981 of file cache.cc.
References BaseCache::blkSize, BlkWritable, Packet::cacheResponding(), chatty_assert, Clocked::clockEdge(), BaseCache::compressor, Packet::copyResponderFlags(), BaseCache::cpuSidePort, CacheBlk::data, doTimingSupplyResponse(), doWritebacks(), doWritebacksAtomic(), DPRINTF, BaseCache::forwardLatency, BaseCache::forwardSnoops, Packet::getAddr(), Compressor::Base::getDecompressionLatency(), Packet::hasData(), Packet::hasSharers(), Packet::headerDelay, Packet::id, BaseCache::invalidateBlock(), Packet::isBlockCached(), Packet::isClean(), CacheBlk::isDirty(), Packet::isInvalidate(), Packet::isRead(), BaseCache::isReadOnly, Packet::isRequest(), Packet::isResponse(), CacheBlk::isValid(), CacheBlk::isWritable(), Packet::makeAtomicResponse(), Packet::mustCheckAbove(), SimObject::name(), Packet::needsResponse(), Packet::needsWritable(), panic_if, Packet::payloadDelay, CacheBlk::print(), Packet::print(), Packet::req, Packet::satisfied(), ResponsePort::sendAtomicSnoop(), ResponsePort::sendTimingSnoopReq(), Packet::setBlockCached(), Packet::setCacheResponding(), Packet::setDataFromBlock(), Packet::setExpressSnoop(), Packet::setHasSharers(), Packet::setResponderHadWritable(), Packet::setSatisfied(), CacheBlk::status, and BaseCache::writecleanBlk().
Referenced by recvAtomicSnoop(), recvTimingSnoopReq(), and serviceMSHRTargets().
|
overrideprotectedvirtual |
Reimplemented from BaseCache.
Definition at line 308 of file cache.cc.
References BaseCache::handleTimingReqHit(), and Packet::req.
|
overrideprotectedvirtual |
Implements BaseCache.
Definition at line 319 of file cache.cc.
References BaseCache::allocateMissBuffer(), BaseCache::allocateWriteBuffer(), BaseCache::blkSize, Packet::cmd, BaseCache::CacheStats::cmdStats(), BaseCache::cpuSidePort, Queue< Entry >::findMatch(), Packet::getBlockAddr(), Packet::getSize(), BaseCache::handleTimingReqMiss(), Packet::isRead(), Packet::isSecure(), MemCmd::isSWPrefetch(), CacheBlk::isValid(), Packet::isWrite(), Packet::makeTimingResponse(), BaseCache::CacheCmdStats::mshr_uncacheable, BaseCache::mshrQueue, Packet::needsResponse(), X86ISA::pf, Packet::req, QueuedResponsePort::schedTimingResp(), and BaseCache::stats.
|
protected |
Send up a snoop request and find cached copies.
If cached copies are found, set the BLOCK_CACHED flag in pkt.
Definition at line 1325 of file cache.cc.
References Packet::cacheResponding(), Packet::cmd, BaseCache::cpuSidePort, BaseCache::forwardSnoops, Packet::isBlockCached(), Packet::isEviction(), ResponsePort::sendAtomicSnoop(), Packet::senderState, ResponsePort::sendTimingSnoopReq(), Packet::setExpressSnoop(), and MemCmd::WriteClean.
Referenced by doWritebacks(), and doWritebacksAtomic().
|
protected |
Turn line-sized writes into WriteInvalidate transactions.
Definition at line 296 of file cache.cc.
References BaseCache::blkSize, Packet::cmd, doFastWrites, DPRINTF, Packet::getOffset(), Packet::getSize(), Packet::isMaskedWrite(), MemCmd::WriteLineReq, and MemCmd::WriteReq.
Referenced by recvAtomic(), and recvTimingReq().
Performs the access specified by the request.
pkt | The request to perform. |
Reimplemented from BaseCache.
Definition at line 650 of file cache.cc.
References Packet::cacheResponding(), DPRINTF, BaseCache::memSidePort, Packet::needsWritable(), Packet::print(), promoteWholeLineWrites(), BaseCache::recvAtomic(), Packet::req, Packet::responderHadWritable(), and RequestPort::sendAtomic().
Snoop for the provided request in the cache and return the estimated time taken.
pkt | The memory request to snoop |
Implements BaseCache.
Definition at line 1312 of file cache.cc.
References Clocked::clockPeriod(), BaseTags::findBlock(), Packet::getAddr(), handleSnoop(), BaseCache::inRange(), Packet::isSecure(), BaseCache::lookupLatency, and BaseCache::tags.
|
overrideprotectedvirtual |
Performs the access specified by the request.
pkt | The request to perform. |
Reimplemented from BaseCache.
Definition at line 398 of file cache.cc.
References Packet::cacheResponding(), DPRINTF, Packet::headerDelay, BaseCache::memSidePort, Packet::needsWritable(), Packet::payloadDelay, BaseCache::pendingDelete, BaseTags::print(), Packet::print(), promoteWholeLineWrites(), BaseCache::recvTimingReq(), Packet::responderHadWritable(), RequestPort::sendTimingReq(), Packet::setCacheResponding(), Packet::setExpressSnoop(), and BaseCache::tags.
|
overrideprotectedvirtual |
Snoops bus transactions to maintain coherence.
pkt | The current bus transaction. |
Implements BaseCache.
Definition at line 1194 of file cache.cc.
References BaseCache::blkSize, Clocked::clockPeriod(), Packet::cmd, doTimingSupplyResponse(), DPRINTF, BaseTags::findBlock(), Queue< Entry >::findMatch(), Packet::getAddr(), Packet::getBlockAddr(), Packet::getConstPtr(), WriteQueueEntry::getNumTargets(), MSHR::getNumTargets(), WriteQueueEntry::getTarget(), handleSnoop(), MSHR::handleSnoop(), Packet::hasSharers(), BaseCache::inRange(), Packet::isEviction(), Packet::isInvalidate(), Packet::isRead(), Packet::isSecure(), QueueEntry::isUncacheable(), BaseCache::lookupLatency, BaseCache::markInService(), BaseCache::mshrQueue, Packet::mustCheckAbove(), Packet::needsResponse(), Packet::needsWritable(), BaseCache::numTarget, BaseCache::order, QueueEntry::Target::pkt, MSHR::print(), Packet::print(), Packet::req, Packet::setBlockCached(), Packet::setCacheResponding(), Packet::setHasSharers(), Packet::setResponderHadWritable(), Packet::snoopDelay, BaseCache::tags, warn, MemCmd::WritebackDirty, BaseCache::writeBuffer, and MemCmd::WriteClean.
|
overrideprotectedvirtual |
Handle a snoop response.
pkt | Snoop response packet |
Implements BaseCache.
Definition at line 262 of file cache.cc.
References Clocked::clockEdge(), Packet::cmd, DPRINTF, BaseCache::forwardLatency, Packet::getAddr(), MemCmd::HardPFResp, Packet::headerDelay, Packet::isSecure(), BaseCache::memSidePort, outstandingSnoop, Packet::payloadDelay, Packet::print(), BaseCache::recvTimingResp(), Packet::req, and QueuedRequestPort::schedTimingSnoopResp().
|
overrideprotectedvirtual |
Perform any necessary updates to the block and perform any data exchange between the packet and the block.
The flags of the packet are also set accordingly.
pkt | Request packet from upstream that hit a block |
blk | Cache block that the packet hit |
deferred_response | Whether this request originally missed |
pending_downgrade | Whether the writable flag is to be removed |
Reimplemented from BaseCache.
Definition at line 73 of file cache.cc.
References BlkDirty, BaseCache::blkSize, Packet::cmd, Packet::fromCache(), Packet::getSize(), Packet::hasSharers(), CacheBlk::isDirty(), Packet::isRead(), CacheBlk::isWritable(), Packet::needsWritable(), MemCmd::ReadCleanReq, MemCmd::ReadExReq, BaseCache::satisfyRequest(), MemCmd::SCUpgradeFailReq, Packet::setCacheResponding(), Packet::setHasSharers(), and CacheBlk::status.
Referenced by handleAtomicReqMiss(), and serviceMSHRTargets().
|
overridevirtual |
Take an MSHR, turn it into a suitable downstream packet, and send it out.
This construct allows a queue entry to choose a suitable approach based on its type.
mshr | The MSHR to turn into a packet and send |
Reimplemented from BaseCache.
Definition at line 1353 of file cache.cc.
References QueueEntry::blkAddr, BaseCache::Blocked_NoMSHRs, Packet::cacheResponding(), BaseCache::clearBlocked(), Packet::cmd, BaseCache::cpuSidePort, DPRINTF, BaseTags::findBlock(), MSHRQueue::forceDeallocateTarget(), BaseCache::forwardSnoops, Packet::getAddr(), MSHR::getTarget(), MemCmd::HardPFReq, Packet::hasSharers(), Packet::isBlockCached(), QueueEntry::isSecure, Packet::isSecure(), BaseCache::markInService(), BaseCache::mshrQueue, outstandingSnoop, QueueEntry::Target::pkt, Packet::print(), MipsISA::r, Packet::req, Packet::senderState, BaseCache::sendMSHRQueuePacket(), ResponsePort::sendTimingSnoopReq(), Packet::setExpressSnoop(), and BaseCache::tags.
|
overrideprotectedvirtual |
Service non-deferred MSHR targets using the received response.
Iterates through the list of targets that can be serviced with the current response.
mshr | The MSHR that corresponds to the reponse |
pkt | The response packet |
blk | The reference block |
Implements BaseCache.
Definition at line 681 of file cache.cc.
References BlkDirty, BlkHWPrefetched, BaseCache::blkSize, BlkWritable, Clocked::clockEdge(), Packet::cmd, BaseCache::CacheStats::cmdStats(), Packet::copyError(), Packet::copyResponderFlags(), BaseCache::cpuSidePort, DPRINTF, MSHR::extractServiceableTargets(), MSHR::Target::FromCPU, MSHR::Target::FromPrefetcher, MSHR::Target::FromSnoop, Packet::getConstPtr(), Packet::getOffset(), Packet::getSize(), MSHR::getTarget(), handleSnoop(), MemCmd::HardPFReq, Packet::hasData(), MSHR::hasPostDowngrade(), MSHR::hasPostInvalidate(), Packet::hasRespData(), Packet::headerDelay, BaseCache::invalidateBlock(), MemCmd::InvalidateResp, Packet::isError(), MSHR::isForward, Packet::isInvalidate(), Packet::isRead(), BaseCache::isReadOnly, MemCmd::isSWPrefetch(), CacheBlk::isValid(), CacheBlk::isWritable(), BaseCache::maintainClusivity(), Packet::makeTimingResponse(), Packet::matchAddr(), System::maxRequestors(), BaseCache::CacheCmdStats::missLatency, SimObject::name(), Packet::needsWritable(), panic, panic_if, Packet::payloadDelay, QueueEntry::Target::pkt, Packet::print(), MemCmd::ReadResp, MemCmd::ReadRespWithInvalidate, Packet::req, BaseCache::responseLatency, satisfyRequest(), QueuedResponsePort::schedTimingResp(), MemCmd::SCUpgradeFailReq, Packet::setData(), BaseCache::stats, CacheBlk::status, MemCmd::StoreCondFailReq, MemCmd::StoreCondReq, BaseCache::system, MemCmd::UpgradeFailResp, MSHR::wasWholeLineWrite, and MemCmd::WriteLineReq.
|
protected |
This cache should allocate a block on a line-sized write miss.
Definition at line 69 of file cache.hh.
Referenced by promoteWholeLineWrites().
|
protected |
Store the outstanding requests that we are expecting snoop responses from so we can determine which snoop responses we generated and which ones were merely forwarded.
Definition at line 76 of file cache.hh.
Referenced by recvTimingSnoopResp(), and sendMSHRQueuePacket().