54 #include "debug/Cache.hh" 57 #include "params/NoncoherentCache.hh" 95 while (!writebacks.empty()) {
98 writebacks.pop_front();
105 while (!writebacks.empty()) {
108 writebacks.pop_front();
115 Tick forward_time,
Tick request_time)
124 assert(mshr || !blk || !blk->
isValid());
136 "Should only see read and writes at non-coherent cache\n");
144 bool is_whole_line_write)
const 151 assert(!blk || !blk->
isValid());
156 assert(pkt->getAddr() == pkt->getBlockAddr(
blkSize));
159 DPRINTF(
Cache,
"%s created %s from %s\n", __func__, pkt->print(),
179 assert(bus_pkt->
isRead());
190 DPRINTF(
Cache,
"Block for addr %#llx being updated in Cache\n",
221 "Should only see read and writes at non-coherent cache\n");
230 panic_if(!from_cpu_side,
"Non-coherent cache received functional snoop" 244 for (
auto &target: targets) {
245 Packet *tgt_pkt = target.pkt;
247 switch (target.source) {
252 Tick completion_time;
262 if (transfer_offset < 0) {
274 completion_time - target.recvTime;
301 panic(
"Illegal target->source enum %d\n", target.source);
352 NoncoherentCacheParams::create()
355 assert(replacement_policy);
Miss Status and Handling Register (MSHR) declaration.
virtual bool access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat, PacketList &writebacks)
Does all the processing necessary to perform the provided request.
#define panic(...)
This implements a cprintf based panic() function.
void handleTimingReqMiss(PacketPtr pkt, CacheBlk *blk, Tick forward_time, Tick request_time) override
PacketPtr writebackBlk(CacheBlk *blk)
Create a writeback request for the given block.
State status
The current status of this block.
Cycles is a wrapper class for representing cycle counts, i.e.
Stats::Vector missLatency
Total number of cycles per thread/command spent waiting for a miss.
bool isValid() const
Checks that a block is valid.
void makeTimingResponse()
int getNumTargets() const
Returns the current number of allocated targets.
System * system
System we are currently operating in.
bool cacheResponding() const
virtual void handleTimingReqMiss(PacketPtr pkt, CacheBlk *blk, Tick forward_time, Tick request_time)=0
BaseCache::CacheStats stats
void invalidateBlock(CacheBlk *blk)
Invalidate a cache block.
void doWritebacks(PacketList &writebacks, Tick forward_time) override
Insert writebacks into the write buffer.
void doWritebacksAtomic(PacketList &writebacks) override
Send writebacks down the memory hierarchy in atomic mode.
bool isInvalidate() const
Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) override
Handle a request in atomic mode that missed in this cache.
block was a hardware prefetch yet unaccessed
CacheCmdStats & cmdStats(const PacketPtr p)
Addr getBlockAddr(unsigned int blk_size) const
RequestPtr req
A pointer to the original request.
const Cycles responseLatency
The latency of sending reponse to its upper level cache/core on a linefill.
virtual void recvTimingReq(PacketPtr pkt)
Performs the access specified by the request.
void recvTimingResp(PacketPtr pkt) override
Handles a response (cache line fill/write ack) from the bus.
A coherent cache that can be arranged in flexible topologies.
virtual Tick recvAtomic(PacketPtr pkt)
Performs the access specified by the request.
void functionalAccess(PacketPtr pkt, bool from_cpu_side) override
Performs the access specified by the request.
bool needsResponse() const
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Addr getOffset(unsigned int blk_size) const
void schedTimingResp(PacketPtr pkt, Tick when)
Schedule the sending of a timing response.
void makeAtomicResponse()
uint64_t Tick
Tick count type.
Miss Status and handling Register.
virtual void recvTimingResp(PacketPtr pkt)
Handles a response (cache line fill/write ack) from the bus.
QueueEntry::Target * getTarget() override
Returns a reference to the first target.
Tick recvAtomic(PacketPtr pkt) override
Performs the access specified by the request.
void allocateWriteBuffer(PacketPtr pkt, Tick time)
NoncoherentCache(const NoncoherentCacheParams *p)
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
CacheBlk * handleFill(PacketPtr pkt, CacheBlk *blk, PacketList &writebacks, bool allocate)
Handle a fill operation caused by a received packet.
const bool writebackClean
Determine if clean lines should be written back or not.
const unsigned blkSize
Block size of this cache.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Entry * findMatch(Addr blk_addr, bool is_secure, bool ignore_uncacheable=true) const
Find the first entry that matches the provided address.
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...
MasterID maxMasters()
Get the number of masters registered in the system.
Definitions of a simple cache block class.
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 recvTimingReq(PacketPtr pkt) override
Performs the access specified by the request.
bool allocOnFill(MemCmd cmd) const
Determine whether we should allocate on a fill or not.
Cycles ticksToCycles(Tick t) const
M5_NODISCARD PacketPtr evictBlock(CacheBlk *blk) override
Evict a cache block.
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
MemCmd cmd
The command field of the packet.
TargetList extractServiceableTargets(PacketPtr pkt)
Extracts the subset of the targets that can be serviced given a received response.
const PacketPtr pkt
Pending request packet.
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...
void serviceMSHRTargets(MSHR *mshr, const PacketPtr pkt, CacheBlk *blk) override
Service non-deferred MSHR targets using the received response.
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 copyError(Packet *pkt)
Specifies a non-coherent cache.
bool isWholeLineWrite(unsigned blk_size)
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
BaseTags * tags
Tag and data Storage.
bool access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat, PacketList &writebacks) override
Does all the processing necessary to perform the provided request.
virtual void functionalAccess(PacketPtr pkt, bool from_cpu_side)
Performs the access specified by the request.
ProbePointArg< PacketInfo > Packet
Packet probe point.
MSHRQueue mshrQueue
Miss status registers.
void maintainClusivity(bool from_cache, CacheBlk *blk)
Maintain the clusivity of this cache by potentially invalidating a block.
bool isDirty() const
Check to see if a block has been written.