48 #ifndef __MEM_CACHE_BLK_HH__
49 #define __MEM_CACHE_BLK_HH__
184 return (
status & needed_bits) == needed_bits;
196 return (
status & needed_bits) == needed_bits;
255 if (l->intersects(pkt->
req))
272 if (
l->intersects(req) &&
l->contextId != req->
contextId()) {
315 case 0b111: s =
'M';
break;
316 case 0b011: s =
'O';
break;
317 case 0b101: s =
'E';
break;
318 case 0b001: s =
'S';
break;
319 case 0b000: s =
'I';
break;
320 default: s =
'T';
break;
322 return csprintf(
"state: %x (%c) valid: %d writable: %d readable: %d "
345 bool success =
false;
348 while (!success &&
l !=
lockList.end()) {
349 if (
l->matches(pkt->
req)) {
387 void print(std::ostream &o,
int verbosity = 0,
388 const std::string &prefix =
"")
const;
407 #endif //__MEM_CACHE_BLK_HH__
bool isDirty() const
Check to see if a block has been written.
virtual bool operator()(CacheBlk &blk)=0
State status
The current status of this block.
Tick whenReady
Which curTick() will this block be accessable.
ContextID contextId() const
Accessor function for context ID.
Addr tag
Data block tag value.
void setExtraData(uint64_t extraData)
Accessor function for store conditional return value.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
void clearLoadLocks(RequestPtr req)
Clear the any load lock that intersect the request, and is from a different context.
Simple class to provide virtual print() method on cache blocks without allocating a vtable pointer fo...
unsigned refCount
Number of references to this block since it was brought in.
bool isWritable() const
Checks the write permissions of this block.
CacheBlkPrintWrapper(CacheBlk *_blk)
bool matches(const RequestPtr req) const
std::string csprintf(const char *format, const Args &...args)
bool checkWrite(PacketPtr pkt)
Handle interaction of load-locked operations and stores.
void trackLoadLocked(PacketPtr pkt)
Track the fact that a local locked was issued to the block.
block holds data from the secure memory space
uint64_t Tick
Tick count type.
unsigned State
block state: OR of CacheBlkStatusBit
const RequestPtr req
A pointer to the original request.
virtual ~CacheBlkVisitor()
void invalidate()
Invalidate the block and clear all state.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Abstract base class for objects which support being printed to a stream for debugging.
Represents that the indicated thread context has a "lock" on the block, in the LL/SC sense...
bool isTouched
whether this block has been touched
CacheBlk & operator=(const CacheBlk &)=delete
read permission (yes, block can be valid but not readable)
std::string print() const
Pretty-print a tag, and interpret state bits to readable form including mapping to a MOESI state...
Declaration of the Packet class.
int srcMasterId
holds the source requestor ID for this block.
std::list< Lock > lockList
List of thread contexts that have performed a load-locked (LL) on the block since the last store...
uint32_t task_id
Task Id associated with this block.
void print(std::ostream &o, int verbosity=0, const std::string &prefix="") const
int set
The set and way this block belongs to.
bool isReadable() const
Checks the read permissions of this block.
bool isValid() const
Checks that a block is valid.
bool intersects(const RequestPtr req) const
Base class for cache block visitor, operating on the cache block base class (later subclassed for the...
bool wasPrefetched() const
Check if this block was the result of a hardware prefetch, yet to be touched.
uint8_t * data
Contains a copy of the data in this block for easy access.
block was a hardware prefetch yet unaccessed
int ContextID
Globally unique thread context ID.
virtual ~CacheBlkPrintWrapper()
CacheBlkStatusBits
Cache block status bit assignments.
Lock(const RequestPtr req)
bool isSecure() const
Check if this block holds data from the secure memory space.