48#ifndef __MEM_REQUEST_HH__
49#define __MEM_REQUEST_HH__
78namespace context_switch_task_id
533 auto mgmt_req = std::make_shared<Request>();
534 mgmt_req->_flags.set(
flags);
535 mgmt_req->_requestorId =
id;
538 assert(mgmt_req->isMemMgmt());
615 req1 = std::make_shared<Request>(*
this);
616 req2 = std::make_shared<Request>(*
this);
617 req1->_size = split_addr -
_vaddr;
618 req2->_vaddr = split_addr;
619 req2->_size =
_size - req1->_size;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Cycles is a wrapper class for representing cycle counts, i.e.
Wrapper that groups a few flag bits under the same undelying container.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Tick _time
The time this request was started.
uint32_t streamId() const
bool isGLCSet() const
Accessor functions for the cache bypass flags.
void setAccessLatency()
Set/Get the time taken to complete this request's access, not including the time to successfully tran...
Request(Addr paddr, unsigned size, Flags flags, RequestorID id)
Constructor for physical (e.g.
@ PT_WALK
The request is a page table walk.
@ SECURE
The request targets the secure memory space.
@ ATOMIC_RETURN_OP
The request is an atomic that returns data.
@ KERNEL
The request should be marked with KERNEL.
@ ACQUIRE
The request should be marked with ACQUIRE.
@ LOCKED_RMW
This request will lock or unlock the accessed memory.
@ INVALIDATE
The request invalidates a memory location.
@ STRICT_ORDER
The request is required to be strictly ordered by CPU models and is non-speculative.
@ ARCH_BITS
Architecture specific flags.
@ PHYSICAL
The virtual address is also the physical address.
@ CLEAN
The request cleans a memory location.
@ STICKY_FLAGS
These flags are not cleared when a Request object is reused (assigned a new address).
@ DST_POC
The request targets the point of coherence.
@ ATOMIC_NO_RETURN_OP
The request is an atomic that does not return data.
@ DST_BITS
Bits to define the destination of a request.
@ UNCACHEABLE
The request is to an uncacheable address.
@ PRIVILEGED
This request is made in privileged mode.
@ TLBI
The Request is a TLB shootdown.
@ HTM_COMMIT
The request commits a HTM transaction.
@ DST_POU
The request targets the point of unification.
@ HTM_ABORT
The request aborts a HTM transaction.
@ TLBI_EXT_SYNC
The Request tells the CPU model that a remote TLB Sync has been requested.
@ PF_EXCLUSIVE
The request should be prefetched into the exclusive state.
@ TLBI_EXT_SYNC_COMP
The Request tells the interconnect that a remote TLB Sync request has completed.
@ RELEASE
The request should be marked with RELEASE.
@ HTM_CANCEL
The request cancels a HTM transaction.
@ INST_FETCH
The request was an instruction fetch.
@ READ_MODIFY_WRITE
This request is a read which will be followed by a write.
@ MEM_SWAP
This request is for a memory swap.
@ PREFETCH
The request is a prefetch.
@ TLBI_SYNC
The Request is a TLB shootdown sync.
@ NO_ACCESS
The request should not cause a memory access.
@ EVICT_NEXT
The request should be marked as LRU.
@ HTM_START
hardware transactional memory
@ LLSC
The request is a Load locked/store conditional.
@ CACHE_BLOCK_ZERO
This is a write that is targeted and zeroing an entire cache block.
uint64_t CacheCoherenceFlagsType
static RequestPtr createMemManagement(Flags flags, RequestorID id)
Factory method for creating memory management requests, with unspecified addr and size.
std::function< Cycles(ThreadContext *tc, Packet *pkt)> LocalAccessor
void setInstCount(Counter val)
uint32_t _streamId
The stream ID uniquely identifies a device behind the SMMU/IOMMU Each transaction arriving at the SMM...
void setCacheCoherenceFlags(CacheCoherenceFlags extraFlags)
Counter getInstCount() const
int depth
Level of the cache hierachy where this request was responded to (e.g.
AtomicOpFunctorPtr atomicOpFunctor
A pointer to an atomic operation.
RequestorID requestorId() const
Accesssor for the requestor id.
Tick time() const
Accessor for time.
void setAtomicOpFunctor(AtomicOpFunctorPtr amo_op)
void setHtmAbortCause(HtmFailureFaultCause val)
bool isStrictlyOrdered() const
@ funcRequestorId
This requestor id is used for functional requests that don't come from a particular device.
@ invldRequestorId
Invalid requestor id for assertion checking only.
@ wbRequestorId
This requestor id is used for writeback requests by the caches.
@ intRequestorId
This requestor id is used for message signaled interrupts.
ContextID _contextId
The context ID (for statistics, locks, and wakeups).
bool hasContextId() const
Flags getFlags()
Accessor for flags.
Tick getTranslateLatency() const
bool isTlbiExtSyncComp() const
void setExtraData(uint64_t extraData)
Accessor function for store conditional return value.
const std::vector< bool > & getByteEnable() const
HtmFailureFaultCause _htmAbortCause
The cause for HTM transaction abort.
AtomicOpFunctor * getAtomicOpFunctor()
void setTranslateLatency()
Set/Get the time taken for this request to be successfully translated.
Cycles localAccessor(ThreadContext *tc, Packet *pkt)
Perform the installed local access.
Request(Addr vaddr, unsigned size, Flags flags, RequestorID id, Addr pc, ContextID cid, AtomicOpFunctorPtr atomic_op=nullptr)
bool isTlbiExtSync() const
bool hasPaddr() const
Accessor for paddr.
bool isAtomicNoReturn() const
gem5::Flags< PrivateFlagsType > PrivateFlags
void clearFlags(Flags flags)
bool hasHtmAbortCause() const
Accessor for hardware transactional memory abort cause.
static const FlagsType TLBI_CMD
Addr _paddr
The physical address of the request.
bool isPrefetchEx() const
bool hasVaddr() const
Accessor function for vaddr.
uint32_t _taskId
The task id associated with this request.
bool hasSize() const
Accessor for size.
bool isCacheClean() const
Accessor functions to determine whether this request is part of a cache maintenance operation.
uint64_t getExtraData() const
Accessor function for store conditional return value.
RequestorID _requestorId
The requestor ID which is unique in the system for all ports that are capable of issuing a transactio...
uint32_t _substreamId
The substream ID identifies an "execution context" within a device behind an SMMU/IOMMU.
bool isInvL1() const
Accessor functions for the memory space configuration flags and used by GPU ISAs such as the Heteroge...
bool hasAtomicOpFunctor()
Accessor for atomic-op functor.
bool isCacheInvalidate() const
void setLocalAccessor(LocalAccessor acc)
Set the function which will enact that access.
static const FlagsType HTM_CMD
bool hasSubstreamId() const
CacheCoherenceFlags _cacheCoherenceFlags
Flags that control how downstream cache system maintains coherence.
Addr _vaddr
The virtual address of the request.
bool isToPOU() const
Accessor functions for the destination of a memory request.
LocalAccessor _localAccessor
void setByteEnable(const std::vector< bool > &be)
Tick getAccessLatency() const
Request(const Request &other)
@ I_CACHE_INV
mem_sync_op flags
@ SLC_BIT
user-policy flags
void setFlags(Flags flags)
Note that unlike other accessors, this function sets specific flags (ORs them in); it does not assign...
std::vector< bool > _byteEnable
Byte-enable mask for writes.
bool isMasked() const
Returns true if the memory request is masked, which means there is at least one byteEnable element wh...
bool extraDataValid() const
Accessor function to check if sc result is valid.
bool isUncacheable() const
Accessor functions for flags.
Request()
Minimal constructor.
bool hasInstSeqNum() const
Accessor for the sequence number of instruction that creates the request.
bool _systemReq
For fullsystem GPU simulation, this determines if a requests destination is system (host) memory or d...
void clearCacheCoherenceFlags(CacheCoherenceFlags extraFlags)
bool isLocalAccess()
Is this request for a local memory mapped resource/register?
int getAccessDepth() const
PrivateFlags privateFlags
Private flags for field validity checking.
InstSeqNum getReqInstSeqNum() const
void incAccessDepth() const
Increment/Get the depth at which this request is responded to.
void requestorId(RequestorID rid)
gem5::Flags< CacheCoherenceFlagsType > CacheCoherenceFlags
HtmFailureFaultCause getHtmAbortCause() const
Flags _flags
Flag structure for the request.
bool isCacheMaintenance() const
bool isReadModifyWrite() const
void setPaddr(Addr paddr)
Set just the physical address.
ArchFlagsType getArchFlags() const
Accessor function for architecture-specific flags.
Counter _instCount
The instruction count at the time this request is created.
static const FlagsType STORE_NO_DATA
unsigned _size
The size of the request.
void setVirt(Addr vaddr, unsigned size, Flags flags, RequestorID id, Addr pc, AtomicOpFunctorPtr amo_op=nullptr)
Set up a virtual (e.g., CPU) request in a previously allocated Request object.
uint64_t _extraData
Extra data for the request, such as the return value of store conditional or the compare value for a ...
void setContext(ContextID context_id)
Set up Context numbers.
Addr _pc
program counter of initiating access; for tracing/debugging
bool isAtomicReturn() const
Addr getPC() const
Accessor function for pc.
gem5::Flags< FlagsType > Flags
uint32_t substreamId() const
uint16_t PrivateFlagsType
void setStreamId(uint32_t sid)
@ VALID_PADDR
Whether or not paddr is valid (has been written yet).
@ VALID_SIZE
Whether or not the size is valid.
@ VALID_INST_COUNT
Whether or not the instruction count is valid.
@ VALID_INST_SEQ_NUM
Whether or not the instruction sequence number is valid.
@ VALID_CONTEXT_ID
Whether or not the context ID is valid.
@ VALID_STREAM_ID
Whether or not the stream ID and substream ID is valid.
@ VALID_HTM_ABORT_CAUSE
Whether or not the abort cause is valid.
@ VALID_PC
Whether or not the pc is valid.
@ STICKY_PRIVATE_FLAGS
These flags are not cleared when a Request object is reused (assigned a new address).
@ VALID_EXTRA_DATA
Whether or not the sc result is valid.
@ VALID_VADDR
Whether or not the vaddr is valid.
void setReqInstSeqNum(const InstSeqNum seq_num)
bool hasInstCount() const
Accessor for instruction count.
Tick translateDelta
Time for the TLB/table walker to successfully translate this request.
InstSeqNum _reqInstSeqNum
Sequence number of the instruction that creates the request.
Tick accessDelta
Access latency to complete this memory transaction not including translation time.
void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2)
Generate two requests as if this request had been split into two pieces.
bool isGL2CacheFlush() const
ContextID contextId() const
Accessor function for context ID.
void setSubstreamId(uint32_t ssid)
void setSystemReq(bool sysReq)
Static instruction class for unknown (illegal) instructions.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
void set(Type mask)
Set all flag's bits matching the given mask.
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
void clear()
Clear all flag's bits.
double Counter
All counters are of 64-bit values.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< Request > RequestPtr
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
int ContextID
Globally unique thread context ID.
const ContextID InvalidContextID