gem5  v22.1.0.0
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
gem5::MemCmd Class Reference

#include <packet.hh>

Classes

struct  CommandInfo
 Structure that defines attributes and other data associated with a Command. More...
 

Public Types

enum  Command {
  InvalidCmd , ReadReq , ReadResp , ReadRespWithInvalidate ,
  WriteReq , WriteResp , WriteCompleteResp , WritebackDirty ,
  WritebackClean , WriteClean , CleanEvict , SoftPFReq ,
  SoftPFExReq , HardPFReq , SoftPFResp , HardPFResp ,
  WriteLineReq , UpgradeReq , SCUpgradeReq , UpgradeResp ,
  SCUpgradeFailReq , UpgradeFailResp , ReadExReq , ReadExResp ,
  ReadCleanReq , ReadSharedReq , LoadLockedReq , StoreCondReq ,
  StoreCondFailReq , StoreCondResp , LockedRMWReadReq , LockedRMWReadResp ,
  LockedRMWWriteReq , LockedRMWWriteResp , SwapReq , SwapResp ,
  MemFenceReq = SwapResp + 3 , MemSyncReq , MemSyncResp , MemFenceResp ,
  CleanSharedReq , CleanSharedResp , CleanInvalidReq , CleanInvalidResp ,
  InvalidDestError , BadAddressError , ReadError , WriteError ,
  FunctionalReadError , FunctionalWriteError , PrintReq , FlushReq ,
  InvalidateReq , InvalidateResp , HTMReq , HTMReqResp ,
  HTMAbort , TlbiExtSync , NUM_MEM_CMDS
}
 List of all commands associated with a packet. More...
 

Public Member Functions

bool isRead () const
 
bool isWrite () const
 
bool isUpgrade () const
 
bool isRequest () const
 
bool isResponse () const
 
bool needsWritable () const
 
bool needsResponse () const
 
bool isInvalidate () const
 
bool isEviction () const
 
bool isClean () const
 
bool fromCache () const
 
bool isWriteback () const
 A writeback is an eviction that carries data. More...
 
bool hasData () const
 Check if this particular packet type carries payload data. More...
 
bool isLLSC () const
 
bool isLockedRMW () const
 
bool isSWPrefetch () const
 
bool isHWPrefetch () const
 
bool isPrefetch () const
 
bool isError () const
 
bool isPrint () const
 
bool isFlush () const
 
bool isDemand () const
 
Command responseCommand () const
 
const std::string & toString () const
 Return the string to a cmd given by idx. More...
 
int toInt () const
 
 MemCmd (Command _cmd)
 
 MemCmd (int _cmd)
 
 MemCmd ()
 
bool operator== (MemCmd c2) const
 
bool operator!= (MemCmd c2) const
 

Private Types

enum  Attribute {
  IsRead , IsWrite , IsUpgrade , IsInvalidate ,
  IsClean , NeedsWritable , IsRequest , IsResponse ,
  NeedsResponse , IsEviction , IsSWPrefetch , IsHWPrefetch ,
  IsLlsc , IsLockedRMW , HasData , IsError ,
  IsPrint , IsFlush , FromCache , NUM_COMMAND_ATTRIBUTES
}
 List of command attributes. More...
 

Private Member Functions

bool testCmdAttrib (MemCmd::Attribute attrib) const
 

Static Private Member Functions

static constexpr unsigned long long buildAttributes (std::initializer_list< Attribute > attrs)
 

Private Attributes

Command cmd
 

Static Private Attributes

static const CommandInfo commandInfo []
 Array to map Command enum to associated info. More...
 

Friends

class Packet
 Packet probe point. More...
 

Detailed Description

Definition at line 75 of file packet.hh.

Member Enumeration Documentation

◆ Attribute

List of command attributes.

Enumerator
IsRead 

Data flows from responder to requester.

IsWrite 

Data flows from requester to responder.

IsUpgrade 
IsInvalidate 
IsClean 

Cleans any existing dirty blocks.

NeedsWritable 

Requires writable copy to complete in-cache.

IsRequest 

Issued by requester.

IsResponse 

Issue by responder.

NeedsResponse 

Requester needs response from target.

IsEviction 
IsSWPrefetch 
IsHWPrefetch 
IsLlsc 

Alpha/MIPS LL or SC access.

IsLockedRMW 

x86 locked RMW access

HasData 

There is an associated payload.

IsError 

Error response.

IsPrint 

Print state matching address (for debugging)

IsFlush 

Flush the address from caches.

FromCache 

Request originated from a caching agent.

NUM_COMMAND_ATTRIBUTES 

Definition at line 158 of file packet.hh.

◆ Command

List of all commands associated with a packet.

Enumerator
InvalidCmd 
ReadReq 
ReadResp 
ReadRespWithInvalidate 
WriteReq 
WriteResp 
WriteCompleteResp 
WritebackDirty 
WritebackClean 
WriteClean 
CleanEvict 
SoftPFReq 
SoftPFExReq 
HardPFReq 
SoftPFResp 
HardPFResp 
WriteLineReq 
UpgradeReq 
SCUpgradeReq 
UpgradeResp 
SCUpgradeFailReq 
UpgradeFailResp 
ReadExReq 
ReadExResp 
ReadCleanReq 
ReadSharedReq 
LoadLockedReq 
StoreCondReq 
StoreCondFailReq 
StoreCondResp 
LockedRMWReadReq 
LockedRMWReadResp 
LockedRMWWriteReq 
LockedRMWWriteResp 
SwapReq 
SwapResp 
MemFenceReq 
MemSyncReq 
MemSyncResp 
MemFenceResp 
CleanSharedReq 
CleanSharedResp 
CleanInvalidReq 
CleanInvalidResp 
InvalidDestError 
BadAddressError 
ReadError 
WriteError 
FunctionalReadError 
FunctionalWriteError 
PrintReq 
FlushReq 
InvalidateReq 
InvalidateResp 
HTMReq 
HTMReqResp 
HTMAbort 
TlbiExtSync 
NUM_MEM_CMDS 

Definition at line 83 of file packet.hh.

Constructor & Destructor Documentation

◆ MemCmd() [1/3]

gem5::MemCmd::MemCmd ( Command  _cmd)
inline

Definition at line 278 of file packet.hh.

◆ MemCmd() [2/3]

gem5::MemCmd::MemCmd ( int  _cmd)
inline

Definition at line 279 of file packet.hh.

◆ MemCmd() [3/3]

gem5::MemCmd::MemCmd ( )
inline

Definition at line 280 of file packet.hh.

Member Function Documentation

◆ buildAttributes()

static constexpr unsigned long long gem5::MemCmd::buildAttributes ( std::initializer_list< Attribute attrs)
inlinestaticconstexprprivate

Definition at line 183 of file packet.hh.

References gem5::ArmISA::attr.

◆ fromCache()

bool gem5::MemCmd::fromCache ( ) const
inline

Definition at line 236 of file packet.hh.

References FromCache, and testCmdAttrib().

Referenced by gem5::Packet::fromCache().

◆ hasData()

bool gem5::MemCmd::hasData ( ) const
inline

Check if this particular packet type carries payload data.

Note that this does not reflect if the data pointer of the packet is valid or not.

Definition at line 249 of file packet.hh.

References HasData, and testCmdAttrib().

Referenced by gem5::Packet::hasData(), and gem5::Packet::hasRespData().

◆ isClean()

bool gem5::MemCmd::isClean ( ) const
inline

Definition at line 235 of file packet.hh.

References IsClean, and testCmdAttrib().

Referenced by gem5::Packet::isClean(), and gem5::Packet::setSatisfied().

◆ isDemand()

bool gem5::MemCmd::isDemand ( ) const
inline

Definition at line 261 of file packet.hh.

References cmd, ReadCleanReq, ReadExReq, ReadReq, ReadSharedReq, WriteLineReq, and WriteReq.

Referenced by gem5::Packet::isDemand().

◆ isError()

bool gem5::MemCmd::isError ( ) const
inline

Definition at line 256 of file packet.hh.

References IsError, and testCmdAttrib().

Referenced by gem5::Packet::isError().

◆ isEviction()

bool gem5::MemCmd::isEviction ( ) const
inline

Definition at line 234 of file packet.hh.

References IsEviction, and testCmdAttrib().

Referenced by gem5::Packet::isEviction(), and gem5::Packet::setWriteThrough().

◆ isFlush()

bool gem5::MemCmd::isFlush ( ) const
inline

Definition at line 258 of file packet.hh.

References IsFlush, and testCmdAttrib().

Referenced by gem5::Packet::isFlush().

◆ isHWPrefetch()

bool gem5::MemCmd::isHWPrefetch ( ) const
inline

Definition at line 253 of file packet.hh.

References IsHWPrefetch, and testCmdAttrib().

Referenced by gem5::prefetch::BOP::notifyFill().

◆ isInvalidate()

bool gem5::MemCmd::isInvalidate ( ) const
inline

Definition at line 233 of file packet.hh.

References IsInvalidate, and testCmdAttrib().

Referenced by gem5::Packet::isInvalidate().

◆ isLLSC()

bool gem5::MemCmd::isLLSC ( ) const
inline

Definition at line 250 of file packet.hh.

References IsLlsc, and testCmdAttrib().

Referenced by gem5::BaseCache::allocOnFill(), and gem5::Packet::isLLSC().

◆ isLockedRMW()

bool gem5::MemCmd::isLockedRMW ( ) const
inline

Definition at line 251 of file packet.hh.

References IsLockedRMW, and testCmdAttrib().

Referenced by gem5::Packet::isLockedRMW().

◆ isPrefetch()

bool gem5::MemCmd::isPrefetch ( ) const
inline

Definition at line 254 of file packet.hh.

References IsHWPrefetch, IsSWPrefetch, and testCmdAttrib().

Referenced by gem5::BaseCache::allocOnFill().

◆ isPrint()

bool gem5::MemCmd::isPrint ( ) const
inline

Definition at line 257 of file packet.hh.

References IsPrint, and testCmdAttrib().

Referenced by gem5::Packet::isPrint().

◆ isRead()

bool gem5::MemCmd::isRead ( ) const
inline

◆ isRequest()

bool gem5::MemCmd::isRequest ( ) const
inline

Definition at line 229 of file packet.hh.

References IsRequest, and testCmdAttrib().

Referenced by gem5::MemFootprintProbe::handleRequest(), and gem5::Packet::isRequest().

◆ isResponse()

bool gem5::MemCmd::isResponse ( ) const
inline

Definition at line 230 of file packet.hh.

References IsResponse, and testCmdAttrib().

Referenced by gem5::Packet::isResponse().

◆ isSWPrefetch()

bool gem5::MemCmd::isSWPrefetch ( ) const
inline

◆ isUpgrade()

bool gem5::MemCmd::isUpgrade ( ) const
inline

Definition at line 228 of file packet.hh.

References IsUpgrade, and testCmdAttrib().

Referenced by gem5::Packet::isUpgrade().

◆ isWrite()

bool gem5::MemCmd::isWrite ( ) const
inline

◆ isWriteback()

bool gem5::MemCmd::isWriteback ( ) const
inline

A writeback is an eviction that carries data.

Definition at line 241 of file packet.hh.

References HasData, IsEviction, and testCmdAttrib().

Referenced by gem5::Packet::isWriteback().

◆ needsResponse()

bool gem5::MemCmd::needsResponse ( ) const
inline

Definition at line 232 of file packet.hh.

References NeedsResponse, and testCmdAttrib().

Referenced by gem5::Packet::needsResponse().

◆ needsWritable()

bool gem5::MemCmd::needsWritable ( ) const
inline

Definition at line 231 of file packet.hh.

References NeedsWritable, and testCmdAttrib().

Referenced by gem5::Packet::needsWritable().

◆ operator!=()

bool gem5::MemCmd::operator!= ( MemCmd  c2) const
inline

Definition at line 283 of file packet.hh.

References gem5::c2, and cmd.

◆ operator==()

bool gem5::MemCmd::operator== ( MemCmd  c2) const
inline

Definition at line 282 of file packet.hh.

References gem5::c2, and cmd.

◆ responseCommand()

Command gem5::MemCmd::responseCommand ( ) const
inline

◆ testCmdAttrib()

bool gem5::MemCmd::testCmdAttrib ( MemCmd::Attribute  attrib) const
inlineprivate

◆ toInt()

int gem5::MemCmd::toInt ( ) const
inline

Definition at line 276 of file packet.hh.

References cmd.

Referenced by gem5::Packet::cmdToIndex(), and gem5::MemTraceProbe::handleRequest().

◆ toString()

const std::string& gem5::MemCmd::toString ( ) const
inline

Friends And Related Function Documentation

◆ Packet

friend class Packet
friend

Packet probe point.

This probe point provides a unified interface for components that want to instrument Packets in the memory system. Components should when possible adhere to the following naming scheme:

  • PktRequest: Requests sent out on the memory side of a normal components and incoming requests for memories. Packets should not be duplicated (i.e., a packet should only appear once irrespective of the receiving end requesting a retry).

  • PktResponse: Response received from the memory side of a normal component or a response being sent out from a memory.

  • PktRequestCPU: Incoming, accepted, memory request on the CPU side of a two-sided component. This probe point is primarily intended for components that cache or forward requests (e.g., caches and XBars), single-sided components should use PktRequest instead. The probe point should only be called when a packet is accepted.

  • PktResponseCPU: Outgoing response memory request on the CPU side of a two-sided component. This probe point is primarily intended for components that cache or forward requests (e.g., caches and XBars), single-sided components should use PktRequest instead.

Definition at line 77 of file packet.hh.

Member Data Documentation

◆ cmd

Command gem5::MemCmd::cmd
private

◆ commandInfo

const MemCmd::CommandInfo gem5::MemCmd::commandInfo
staticprivate

Array to map Command enum to associated info.

Definition at line 212 of file packet.hh.

Referenced by responseCommand(), testCmdAttrib(), and toString().


The documentation for this class was generated from the following files:

Generated on Wed Dec 21 2022 10:23:27 for gem5 by doxygen 1.9.1