Go to the documentation of this file.
54 #include "debug/Cache.hh"
57 #include "params/NoncoherentCache.hh"
63 assert(
p.replacement_policy);
97 while (!writebacks.empty()) {
100 writebacks.pop_front();
107 while (!writebacks.empty()) {
110 writebacks.pop_front();
117 Tick forward_time,
Tick request_time)
126 assert(mshr || !blk || !blk->
isValid());
138 "Should only see read and writes at non-coherent cache\n");
146 bool is_whole_line_write)
const
153 assert(!blk || !blk->
isValid());
181 assert(bus_pkt->
isRead());
192 DPRINTF(
Cache,
"Block for addr %#llx being updated in Cache\n",
223 "Should only see read and writes at non-coherent cache\n");
232 panic_if(!from_cpu_side,
"Non-coherent cache received functional snoop"
246 for (
auto &target: targets) {
247 Packet *tgt_pkt = target.pkt;
249 switch (target.source) {
254 Tick completion_time;
264 if (transfer_offset < 0) {
276 completion_time - target.recvTime;
303 panic(
"Illegal target->source enum %d\n", target.source);
void makeAtomicResponse()
void maintainClusivity(bool from_cache, CacheBlk *blk)
Maintain the clusivity of this cache by potentially invalidating a block.
void makeTimingResponse()
bool cacheResponding() const
virtual void functionalAccess(PacketPtr pkt, bool from_cpu_side)
Performs the access specified by the request.
M5_NODISCARD PacketPtr evictBlock(CacheBlk *blk) override
Evict a cache block.
CacheBlk * handleFill(PacketPtr pkt, CacheBlk *blk, PacketList &writebacks, bool allocate)
Handle a fill operation caused by a received packet.
PacketPtr writebackBlk(CacheBlk *blk)
Create a writeback request for the given block.
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
System * system
System we are currently operating in.
int getNumTargets() const
Returns the current number of allocated targets.
NoncoherentCache(const NoncoherentCacheParams &p)
const unsigned blkSize
Block size of this cache.
Stats::Vector missLatency
Total number of cycles per thread/command spent waiting for a miss.
uint64_t Tick
Tick count type.
bool isInvalidate() const
RequestPtr req
A pointer to the original request.
void serviceMSHRTargets(MSHR *mshr, const PacketPtr pkt, CacheBlk *blk) override
Service non-deferred MSHR targets using the received response.
void schedTimingResp(PacketPtr pkt, Tick when)
Schedule the sending of a timing response.
bool access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat, PacketList &writebacks) override
Does all the processing necessary to perform the provided request.
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
TargetList extractServiceableTargets(PacketPtr pkt)
Extracts the subset of the targets that can be serviced given a received response.
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
const PacketPtr pkt
Pending request packet.
void copyError(Packet *pkt)
void recvTimingReq(PacketPtr pkt) override
Performs the access specified by the request.
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 b...
PacketPtr createMissPacket(PacketPtr cpu_pkt, CacheBlk *blk, bool needs_writable, bool is_whole_line_write) const override
Create an appropriate downstream bus request packet.
void allocateWriteBuffer(PacketPtr pkt, Tick time)
bool isWholeLineWrite(unsigned blk_size)
MSHRQueue mshrQueue
Miss status registers.
bool allocOnFill(MemCmd cmd) const
Determine whether we should allocate on a fill or not.
BaseCache::CacheStats stats
Addr getBlockAddr(unsigned int blk_size) const
void invalidateBlock(CacheBlk *blk)
Invalidate a cache block.
bool needsResponse() const
virtual void recvTimingReq(PacketPtr pkt)
Performs the access specified by the request.
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...
virtual bool access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat, PacketList &writebacks)
Does all the processing necessary to perform the provided request.
Addr getOffset(unsigned int blk_size) const
Entry * findMatch(Addr blk_addr, bool is_secure, bool ignore_uncacheable=true) const
Find the first entry that matches the provided address.
virtual bool isValid() const
Checks if the entry is valid.
@ WritableBit
write permission
ProbePointArg< PacketInfo > Packet
Packet probe point.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual void satisfyRequest(PacketPtr pkt, CacheBlk *blk, bool deferred_response=false, bool pending_downgrade=false)
Perform any necessary updates to the block and perform any data exchange between the packet and the b...
void setPrefetched()
Marks this blocks as a recently prefetched block.
QueueEntry::Target * getTarget() override
Returns a reference to the first target.
bool isSet(unsigned bits) const
Checks the given coherence bits are set.
void setCoherenceBits(unsigned bits)
Sets the corresponding coherence bits.
void handleTimingReqMiss(PacketPtr pkt, CacheBlk *blk, Tick forward_time, Tick request_time) override
const bool writebackClean
Determine if clean lines should be written back or not.
MemCmd cmd
The command field of the packet.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
void recvTimingResp(PacketPtr pkt) override
Handles a response (cache line fill/write ack) from the bus.
void doWritebacksAtomic(PacketList &writebacks) override
Send writebacks down the memory hierarchy in atomic mode.
RequestorID maxRequestors()
Get the number of requestors registered in the system.
Cycles ticksToCycles(Tick t) const
@ DirtyBit
dirty (modified)
virtual void handleTimingReqMiss(PacketPtr pkt, CacheBlk *blk, Tick forward_time, Tick request_time)=0
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void functionalAccess(PacketPtr pkt, bool from_cpu_side) override
Performs the access specified by the request.
Cycles is a wrapper class for representing cycle counts, i.e.
Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) override
Handle a request in atomic mode that missed in this cache.
const Cycles responseLatency
The latency of sending reponse to its upper level cache/core on a linefill.
void doWritebacks(PacketList &writebacks, Tick forward_time) override
Insert writebacks into the write buffer.
virtual void recvTimingResp(PacketPtr pkt)
Handles a response (cache line fill/write ack) from the bus.
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time,...
void allocate()
Allocate memory for the packet.
A coherent cache that can be arranged in flexible topologies.
virtual Tick recvAtomic(PacketPtr pkt)
Performs the access specified by the request.
CacheCmdStats & cmdStats(const PacketPtr p)
#define panic(...)
This implements a cprintf based panic() function.
Miss Status and handling Register.
Tick recvAtomic(PacketPtr pkt) override
Performs the access specified by the request.
Generated on Tue Jun 22 2021 15:28:29 for gem5 by doxygen 1.8.17