Go to the documentation of this file.
45 #ifndef __MEM_CACHE_CACHE_BLK_HH__
46 #define __MEM_CACHE_CACHE_BLK_HH__
140 Addr req_low = req->getPaddr();
141 Addr req_high = req_low + req->getSize() -1;
142 return (
contextId == req->contextId()) &&
149 Addr req_low = req->getPaddr();
150 Addr req_high = req_low + req->getSize() - 1;
184 return (
status & needed_bits) == needed_bits;
196 return (
status & needed_bits) == needed_bits;
303 const int src_requestor_ID,
const uint32_t task_ID);
314 if (
l->intersects(pkt->
req))
331 if (
l->intersects(req) &&
l->contextId != req->contextId()) {
375 case 0b111:
s =
'M';
break;
376 case 0b011:
s =
'O';
break;
377 case 0b101:
s =
'E';
break;
378 case 0b001:
s =
'S';
break;
379 case 0b000:
s =
'I';
break;
380 default:
s =
'T';
break;
382 return csprintf(
"state: %x (%c) valid: %d writable: %d readable: %d "
383 "dirty: %d | tag: %#x %s",
status,
s,
406 bool success =
false;
409 while (!success &&
l !=
lockList.end()) {
410 if (
l->matches(pkt->
req)) {
421 req->setExtraData(success ? 1 : 0);
456 data =
new uint8_t[size];
472 const int src_requestor_ID=0,
const uint32_t task_ID=0)
513 void print(std::ostream &o,
int verbosity = 0,
514 const std::string &prefix =
"")
const;
517 #endif //__MEM_CACHE_CACHE_BLK_HH__
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
bool isWritable() const
Checks the write permissions of this block.
virtual void setValid()
Set valid bit.
virtual std::string print() const
Prints relevant information about this entry.
bool intersects(const RequestPtr &req) const
void clearLoadLocks(const RequestPtr &req)
Clear the any load lock that intersect the request, and is from a different context.
Tick getWhenReady() const
Get tick at which block's data will be available for access.
CacheBlkStatusBits
Cache block status bit assignments.
bool matches(const RequestPtr &req) const
int ContextID
Globally unique thread context ID.
uint64_t Tick
Tick count type.
virtual ~CacheBlkPrintWrapper()
@ BlkCompressed
block holds compressed data
@ BlkSecure
block holds data from the secure memory space
std::shared_ptr< Request > RequestPtr
@ BlkDirty
dirty (modified)
RequestPtr req
A pointer to the original request.
Lock(const RequestPtr &req)
unsigned State
block state: OR of CacheBlkStatusBit
uint32_t task_id
Task Id associated with this block.
std::list< Lock > lockList
List of thread contexts that have performed a load-locked (LL) on the block since the last store.
bool isDirty() const
Check to see if a block has been written.
State status
The current status of this block.
@ invldRequestorId
Invalid requestor id for assertion checking only.
std::string print() const override
Pretty-print tag, set and way, and interpret state bits to readable form including mapping to a MOESI...
Abstract base class for objects which support being printed to a stream for debugging.
virtual void invalidate()
Invalidate the block and clear all state.
Simple class to provide virtual print() method on cache blocks without allocating a vtable pointer fo...
bool isReadable() const
Checks the read permissions of this block.
bool checkWrite(PacketPtr pkt)
Handle interaction of load-locked operations and stores.
@ BlkHWPrefetched
block was a hardware prefetch yet unaccessed
TempCacheBlk(unsigned size)
Creates a temporary cache block, with its own storage.
unsigned refCount
Number of references to this block since it was brought in.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
@ BlkReadable
read permission (yes, block can be valid but not readable)
bool wasPrefetched() const
Check if this block was the result of a hardware prefetch, yet to be touched.
void insert(const Addr addr, const bool is_secure, const int src_requestor_ID=0, const uint32_t task_ID=0) override
Set member variables when a block insertion occurs.
@ BlkValid
valid, readable
virtual void setSecure()
Set secure bit.
Addr _addr
Copy of the block's address, used to regenerate tempBlock's address.
void setWhenReady(const Tick tick)
Set tick at which block's data will be available for access.
Addr tag
Data block tag value.
Tick tickInserted
Tick on which the block was inserted in the cache.
bool isValid() const
Checks that a block is valid.
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
@ BlkWritable
write permission
uint8_t * data
Contains a copy of the data in this block for easy access.
virtual void insert(const Addr tag, const bool is_secure, const int src_requestor_ID, const uint32_t task_ID)
Set member variables when a block insertion occurs.
TempCacheBlk & operator=(const TempCacheBlk &)=delete
void trackLoadLocked(PacketPtr pkt)
Track the fact that a local locked was issued to the block.
Tick whenReady
Which curTick() will this block be accessible.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
CacheBlk & operator=(const CacheBlk &)=delete
CacheBlkPrintWrapper(CacheBlk *_blk)
void invalidate() override
Invalidate the block and clear all state.
Special instance of CacheBlk for use with tempBlk that deals with its block address regeneration.
int srcRequestorId
holds the source requestor ID for this block.
std::string csprintf(const char *format, const Args &...args)
bool isSecure() const
Check if this block holds data from the secure memory space.
Represents that the indicated thread context has a "lock" on the block, in the LL/SC sense.
Addr getAddr() const
Get block's address.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17