gem5 v24.0.0.0
|
Memory operation metadata. More...
#include <lsq.hh>
Public Member Functions | |
virtual bool | recvTimingResp (PacketPtr pkt)=0 |
virtual void | sendPacketToCache ()=0 |
virtual void | buildPackets ()=0 |
virtual Cycles | handleLocalAccess (gem5::ThreadContext *thread, PacketPtr pkt)=0 |
Memory mapped IPR accesses. | |
virtual bool | isCacheBlockHit (Addr blockAddr, Addr cacheBlockMask)=0 |
Test if the request accesses a particular cache line. | |
void | packetSent () |
Update the status to reflect that a packet was sent. | |
void | packetNotSent () |
Update the status to reflect that a packet was not sent. | |
void | sendFragmentToTranslation (int i) |
bool | isComplete () |
bool | isInTranslation () |
bool | isTranslationComplete () |
bool | isTranslationBlocked () |
bool | isSent () |
bool | isPartialFault () |
bool | isMemAccessRequired () |
void | setStateToFault () |
void | freeLSQEntry () |
The LSQ entry is cleared. | |
void | discard () |
The request is discarded (e.g. | |
void | packetReplied () |
void | writebackScheduled () |
void | writebackDone () |
void | squashTranslation () |
void | complete () |
virtual std::string | name () const |
void | setContext (const ContextID &context_id) |
Convenience getters/setters. | |
const DynInstPtr & | instruction () |
bool | hasStaleTranslation () const |
virtual void | markAsStaleTranslation ()=0 |
void | setVirt (Addr vaddr, unsigned size, Request::Flags flags_, RequestorID requestor_id, Addr pc) |
Set up virtual request. | |
ContextID | contextId () const |
void | taskId (const uint32_t &v) |
uint32_t | taskId () const |
RequestPtr | req (int idx=0) |
const RequestPtr | req (int idx=0) const |
Addr | getVaddr (int idx=0) const |
virtual void | initiateTranslation ()=0 |
PacketPtr | packet (int idx=0) |
virtual PacketPtr | mainPacket () |
virtual RequestPtr | mainReq () |
bool | isAnyOutstandingRequest () |
Test if there is any in-flight translation or mem access request. | |
bool | isReleased () |
Test if the LSQRequest has been released, i.e. | |
bool | isSplit () const |
bool | needWBToRegister () const |
Public Member Functions inherited from gem5::BaseMMU::Translation | |
virtual | ~Translation () |
virtual void | finish (const Fault &fault, const RequestPtr &req, ThreadContext *tc, BaseMMU::Mode mode)=0 |
Public Member Functions inherited from gem5::Packet::SenderState | |
SenderState () | |
virtual | ~SenderState () |
Public Attributes | |
LSQUnit & | _port |
const DynInstPtr | _inst |
uint32_t | _taskId |
PacketDataPtr | _data |
std::vector< PacketPtr > | _packets |
std::vector< RequestPtr > | _reqs |
std::vector< Fault > | _fault |
uint64_t * | _res |
const Addr | _addr |
const uint32_t | _size |
const Request::Flags | _flags |
std::vector< bool > | _byteEnable |
uint32_t | _numOutstandingPackets |
AtomicOpFunctorPtr | _amo_op |
bool | _hasStaleTranslation |
Public Attributes inherited from gem5::Packet::SenderState | |
SenderState * | predecessor |
Protected Types | |
enum | Flag : FlagsStorage { IsLoad = 0x00000001 , WriteBackToRegister = 0x00000002 , Delayed = 0x00000004 , IsSplit = 0x00000008 , TranslationStarted = 0x00000010 , TranslationFinished = 0x00000020 , Sent = 0x00000040 , Retry = 0x00000080 , Complete = 0x00000100 , TranslationSquashed = 0x00000200 , Discarded = 0x00000400 , LSQEntryFreed = 0x00000800 , WritebackScheduled = 0x00001000 , WritebackDone = 0x00002000 , IsAtomic = 0x00004000 } |
enum class | State { NotIssued , Translation , Request , Fault , PartialFault } |
typedef uint32_t | FlagsStorage |
typedef Flags< FlagsStorage > | FlagsType |
Protected Member Functions | |
void | setState (const State &newState) |
void | markDelayed () override |
Signal that the translation has been delayed due to a hw page table walk. | |
bool | isDelayed () |
LSQUnit * | lsqUnit () |
LSQRequest (LSQUnit *port, const DynInstPtr &inst, bool isLoad) | |
LSQRequest (LSQUnit *port, const DynInstPtr &inst, bool isLoad, const Addr &addr, const uint32_t &size, const Request::Flags &flags_, PacketDataPtr data=nullptr, uint64_t *res=nullptr, AtomicOpFunctorPtr amo_op=nullptr, bool stale_translation=false) | |
bool | isLoad () const |
bool | isAtomic () const |
void | install () |
Install the request in the LQ/SQ. | |
bool | squashed () const override |
This function is used by the page table walker to determine if it should translate the a pending request or if the underlying request has been squashed. | |
void | release (Flag reason) |
Release the LSQRequest. | |
void | addReq (Addr addr, unsigned size, const std::vector< bool > &byte_enable) |
Helper function used to add a (sub)request, given its address addr , size size and byte-enable mask byteEnable . | |
virtual | ~LSQRequest () |
Destructor. | |
Protected Attributes | |
FlagsType | flags |
State | _state |
uint32_t | numTranslatedFragments |
uint32_t | numInTranslationFragments |
Memory operation metadata.
This class holds the information about a memory operation. It lives from initiateAcc to resource deallocation at commit or squash. LSQRequest objects are owned by the LQ/SQ Entry in the LSQUnit that holds the operation. In addition, the LSQRequest is a TranslationState, therefore, upon squash, there must be a defined ownership transferal in case the LSQ resources are deallocated before the TLB is done using the TranslationState. If that happens, the LSQRequest will be self-owned, and responsible to detect that its services are no longer required and self-destruct.
Lifetime of a LSQRequest: +-----------------—+ |LSQ creates and owns| +-----------------—+ | +-----------------—+ | Initate translation| +-----------------—+ | ___^___ ___/ ___ ______/ Squashed? \ | ___ ___/ | ___ ___/ | v | | | +-----------------—+ | | Translation done | | +-----------------—+ | | | +-----------------—+ | | Send packet |<---—+ | +-----------------—+ | | | | | ___^___ | | ___/ ___ | | ____/ Squashed? \ | | | ___ ___/ | | | ___ ___/ | | | v | | | | | | | ___^___ | | | ___/ ___ | | | / Done? __________| | | ___ ___/ | | ___ ___/
v | |
---|---|
+-----------------—+ |
| | | Manage stuff | | | | Free resources | | | +-----------------—+ | | | | +-----------------—+ | | | self owned | | +->| on recvTimingResp | | | free resources | | +-----------------—+ | | +-------------------—+ | | self owned (Trans) | +-->| on TranslationFinish | | free resources | +-------------------—+
|
protected |
|
protected |
|
protected |
Enumerator | |
---|---|
IsLoad | |
WriteBackToRegister | True if this request needs to writeBack to register. Will be set in case of load or a store/atomic that writes registers (SC) |
Delayed | |
IsSplit | |
TranslationStarted | True if any translation has been sent to TLB. |
TranslationFinished | True if there are un-replied outbound translations. |
Sent | |
Retry | |
Complete | |
TranslationSquashed | Ownership tracking flags. Translation squashed. |
Discarded | Request discarded. |
LSQEntryFreed | LSQ resources freed. |
WritebackScheduled | Store written back. |
WritebackDone | |
IsAtomic | True if this is an atomic request. |
|
strongprotected |
|
protected |
Definition at line 1052 of file lsq.cc.
References _inst, flags, install(), IsAtomic, IsLoad, isLoad(), gem5::Flags< T >::set(), and WriteBackToRegister.
|
protected |
Definition at line 1067 of file lsq.cc.
References _inst, flags, install(), IsAtomic, IsLoad, isLoad(), gem5::Flags< T >::set(), and WriteBackToRegister.
|
protectedvirtual |
Destructor.
The LSQRequest owns the request. If the packet has already been sent, the sender state will be deleted upon receiving the reply.
Definition at line 1135 of file lsq.cc.
References gem5::MipsISA::r.
|
protected |
Helper function used to add a (sub)request, given its address addr
, size size
and byte-enable mask byteEnable
.
The request is only added if there is at least one active element in the mask.
Definition at line 1105 of file lsq.cc.
References gem5::X86ISA::addr, gem5::isAnyActiveElement(), and gem5::Request::NO_ACCESS.
|
pure virtual |
Implemented in gem5::o3::LSQ::SingleDataRequest, and gem5::o3::LSQ::SplitDataRequest.
Referenced by gem5::o3::LSQUnit::read(), and gem5::o3::LSQUnit::writebackStores().
|
inline |
Definition at line 561 of file lsq.hh.
References Complete, flags, and gem5::Flags< T >::set().
Referenced by gem5::o3::LSQUnit::writebackStores().
ContextID gem5::o3::LSQ::LSQRequest::contextId | ( | ) | const |
Definition at line 1145 of file lsq.cc.
Referenced by gem5::o3::LSQ::completeDataAccess(), gem5::o3::LSQ::read(), and gem5::o3::LSQ::recvTimingResp().
|
inline |
The request is discarded (e.g.
partial store-load forwarding)
Definition at line 518 of file lsq.hh.
References Discarded, and release().
Referenced by gem5::o3::LSQUnit::read().
|
inline |
The LSQ entry is cleared.
Definition at line 509 of file lsq.hh.
References LSQEntryFreed, and release().
Referenced by gem5::o3::LSQUnit::LSQEntry::clear(), and gem5::o3::LSQUnit::LSQEntry::~LSQEntry().
|
inline |
Definition at line 365 of file lsq.hh.
References req().
Referenced by gem5::o3::LSQ::pushRequest().
|
pure virtual |
Memory mapped IPR accesses.
Implemented in gem5::o3::LSQ::SingleDataRequest, and gem5::o3::LSQ::SplitDataRequest.
|
inline |
Definition at line 336 of file lsq.hh.
References _hasStaleTranslation.
|
pure virtual |
Implemented in gem5::o3::LSQ::SingleDataRequest, gem5::o3::LSQ::SplitDataRequest, and gem5::o3::LSQ::UnsquashableDirectRequest.
Referenced by gem5::o3::LSQ::pushRequest().
|
protected |
Install the request in the LQ/SQ.
Definition at line 1091 of file lsq.cc.
Referenced by LSQRequest(), and LSQRequest().
|
inline |
Definition at line 334 of file lsq.hh.
References _inst.
Referenced by gem5::o3::LSQUnit::completeDataAccess(), and gem5::o3::LSQUnit::trySendPacket().
|
inline |
Test if there is any in-flight translation or mem access request.
Definition at line 388 of file lsq.hh.
References _numOutstandingPackets, flags, gem5::Flags< T >::isSet(), numInTranslationFragments, WritebackDone, and WritebackScheduled.
Referenced by gem5::o3::LSQUnit::read(), and release().
|
inlineprotected |
Definition at line 278 of file lsq.hh.
References flags, IsAtomic, and gem5::Flags< T >::isSet().
|
pure virtual |
Test if the request accesses a particular cache line.
Implemented in gem5::o3::LSQ::SingleDataRequest, and gem5::o3::LSQ::SplitDataRequest.
Referenced by gem5::o3::LSQUnit::checkSnoop().
|
inline |
Definition at line 454 of file lsq.hh.
References Complete, flags, and gem5::Flags< T >::isSet().
|
inlineprotected |
Definition at line 243 of file lsq.hh.
References Delayed, flags, and gem5::Flags< T >::isSet().
|
inline |
Definition at line 460 of file lsq.hh.
References _state, and Translation.
Referenced by isTranslationComplete().
|
inlineprotected |
Definition at line 272 of file lsq.hh.
References flags, IsLoad, and gem5::Flags< T >::isSet().
Referenced by isMemAccessRequired(), LSQRequest(), and LSQRequest().
|
inline |
Definition at line 493 of file lsq.hh.
References _state, isLoad(), isPartialFault(), and Request.
Referenced by gem5::o3::LSQ::pushRequest().
|
inline |
Definition at line 487 of file lsq.hh.
References _state, and PartialFault.
Referenced by isMemAccessRequired().
|
inline |
Test if the LSQRequest has been released, i.e.
self-owned. An LSQRequest manages itself when the resources on the LSQ are freed but the translation is still going on and the LSQEntry was freed.
Definition at line 402 of file lsq.hh.
References Discarded, flags, gem5::Flags< T >::isSet(), and LSQEntryFreed.
Referenced by packetReplied(), gem5::o3::LSQUnit::recvTimingResp(), squashTranslation(), and writebackDone().
|
inline |
Definition at line 481 of file lsq.hh.
References flags, gem5::Flags< T >::isSet(), and Sent.
Referenced by gem5::o3::LSQUnit::read(), and gem5::o3::LSQUnit::writebackStores().
|
inline |
Definition at line 409 of file lsq.hh.
References flags, gem5::Flags< T >::isSet(), and IsSplit.
Referenced by gem5::o3::LSQUnit::read().
|
inline |
Definition at line 473 of file lsq.hh.
References _state, flags, gem5::Flags< T >::isSet(), Translation, TranslationFinished, and TranslationStarted.
|
inline |
Definition at line 466 of file lsq.hh.
References flags, isInTranslation(), gem5::Flags< T >::isSet(), and TranslationStarted.
Referenced by gem5::o3::LSQ::pushRequest().
|
inlineprotected |
|
inlinevirtual |
Reimplemented in gem5::o3::LSQ::SplitDataRequest.
Definition at line 371 of file lsq.hh.
References _packets, and packet().
Referenced by gem5::o3::LSQUnit::completeDataAccess().
|
inlinevirtual |
Reimplemented in gem5::o3::LSQ::SplitDataRequest.
Definition at line 378 of file lsq.hh.
Referenced by gem5::o3::LSQUnit::read(), gem5::o3::LSQUnit::write(), and gem5::o3::LSQUnit::writebackStores().
|
pure virtual |
|
inlineoverrideprotectedvirtual |
Signal that the translation has been delayed due to a hw page table walk.
Implements gem5::BaseMMU::Translation.
Definition at line 242 of file lsq.hh.
References Delayed, flags, and gem5::Flags< T >::set().
|
inlinevirtual |
Reimplemented in gem5::o3::LSQ::SingleDataRequest, gem5::o3::LSQ::SplitDataRequest, and gem5::o3::LSQ::UnsquashableDirectRequest.
|
inline |
Definition at line 415 of file lsq.hh.
References flags, gem5::Flags< T >::isSet(), and WriteBackToRegister.
Referenced by gem5::o3::LSQUnit::completeDataAccess().
|
inline |
Definition at line 368 of file lsq.hh.
References _packets.
Referenced by mainPacket(), and gem5::o3::LSQUnit::writebackStores().
|
inline |
Update the status to reflect that a packet was not sent.
When a packet fails to be sent, we mark the request as needing a retry. Note that Retry flag is sticky.
Definition at line 446 of file lsq.hh.
References gem5::Flags< T >::clear(), flags, Retry, Sent, and gem5::Flags< T >::set().
Referenced by gem5::o3::LSQUnit::trySendPacket().
|
inline |
Definition at line 524 of file lsq.hh.
References _numOutstandingPackets, and isReleased().
Referenced by gem5::o3::LSQ::recvTimingResp().
|
inline |
Update the status to reflect that a packet was sent.
Definition at line 437 of file lsq.hh.
References flags, Sent, and gem5::Flags< T >::set().
Referenced by gem5::o3::LSQUnit::trySendPacket(), and gem5::o3::LSQUnit::writebackStores().
|
pure virtual |
Implemented in gem5::o3::LSQ::SingleDataRequest, and gem5::o3::LSQ::SplitDataRequest.
Referenced by gem5::o3::LSQUnit::recvTimingResp().
|
inlineprotected |
Release the LSQRequest.
Notify the sender state that the request it points to is not valid anymore. Understand if the request is orphan (self-managed) and if so, mark it as freed, else destroy it, as this means the end of its life cycle. An LSQRequest is orphan when its resources are released but there is any in-flight translation request to the TLB or access request to the memory.
Definition at line 299 of file lsq.hh.
References Discarded, flags, isAnyOutstandingRequest(), LSQEntryFreed, and gem5::Flags< T >::set().
Referenced by discard(), and freeLSQEntry().
|
inline |
Definition at line 362 of file lsq.hh.
References _reqs.
Referenced by gem5::o3::LSQ::SplitDataRequest::finish(), getVaddr(), mainReq(), gem5::o3::LSQ::pushRequest(), gem5::o3::LSQ::read(), setContext(), setVirt(), gem5::o3::LSQ::write(), and gem5::o3::LSQUnit::write().
|
inline |
void gem5::o3::LSQ::LSQRequest::sendFragmentToTranslation | ( | int | i | ) |
Definition at line 1151 of file lsq.cc.
References gem5::ArmISA::i, gem5::BaseMMU::Read, and gem5::BaseMMU::Write.
|
pure virtual |
Implemented in gem5::o3::LSQ::SingleDataRequest, and gem5::o3::LSQ::SplitDataRequest.
Referenced by gem5::o3::LSQUnit::read(), and gem5::o3::LSQUnit::writebackStores().
|
inline |
|
inlineprotected |
Definition at line 236 of file lsq.hh.
References _state.
Referenced by gem5::o3::LSQ::SingleDataRequest::finish(), and setStateToFault().
|
inline |
Definition at line 500 of file lsq.hh.
References Fault, and setState().
Referenced by gem5::o3::LSQUnit::checkSnoop().
|
inline |
Set up virtual request.
For a previously allocated Request objects.
Definition at line 344 of file lsq.hh.
References gem5::MipsISA::pc, req(), and gem5::MipsISA::vaddr.
|
overrideprotectedvirtual |
This function is used by the page table walker to determine if it should translate the a pending request or if the underlying request has been squashed.
@ return Is the instruction that requested this translation squashed?
Reimplemented from gem5::BaseMMU::Translation.
|
inline |
Definition at line 550 of file lsq.hh.
References flags, isReleased(), numInTranslationFragments, gem5::Flags< T >::set(), and TranslationSquashed.
Referenced by gem5::o3::LSQ::SingleDataRequest::finish().
|
inline |
|
inline |
Definition at line 353 of file lsq.hh.
References _reqs, _taskId, gem5::MipsISA::r, and gem5::ArmISA::v.
Referenced by gem5::o3::LSQ::pushRequest().
|
inline |
Definition at line 540 of file lsq.hh.
References _numOutstandingPackets, flags, isReleased(), gem5::Flags< T >::set(), and WritebackDone.
Referenced by gem5::o3::LSQUnit::completeDataAccess().
|
inline |
Definition at line 533 of file lsq.hh.
References flags, gem5::Flags< T >::isSet(), gem5::Flags< T >::set(), and WritebackScheduled.
AtomicOpFunctorPtr gem5::o3::LSQ::LSQRequest::_amo_op |
std::vector<bool> gem5::o3::LSQ::LSQRequest::_byteEnable |
Definition at line 257 of file lsq.hh.
Referenced by gem5::o3::LSQ::pushRequest().
PacketDataPtr gem5::o3::LSQ::LSQRequest::_data |
std::vector<Fault> gem5::o3::LSQ::LSQRequest::_fault |
Definition at line 252 of file lsq.hh.
Referenced by gem5::o3::LSQ::SingleDataRequest::finish().
const Request::Flags gem5::o3::LSQ::LSQRequest::_flags |
bool gem5::o3::LSQ::LSQRequest::_hasStaleTranslation |
Definition at line 260 of file lsq.hh.
Referenced by hasStaleTranslation().
const DynInstPtr gem5::o3::LSQ::LSQRequest::_inst |
Definition at line 247 of file lsq.hh.
Referenced by gem5::o3::LSQ::SingleDataRequest::finish(), instruction(), LSQRequest(), and LSQRequest().
uint32_t gem5::o3::LSQ::LSQRequest::_numOutstandingPackets |
Definition at line 258 of file lsq.hh.
Referenced by isAnyOutstandingRequest(), packetReplied(), gem5::o3::LSQUnit::read(), and writebackDone().
std::vector<PacketPtr> gem5::o3::LSQ::LSQRequest::_packets |
Definition at line 250 of file lsq.hh.
Referenced by mainPacket(), and packet().
LSQUnit& gem5::o3::LSQ::LSQRequest::_port |
std::vector<RequestPtr> gem5::o3::LSQ::LSQRequest::_reqs |
uint64_t* gem5::o3::LSQ::LSQRequest::_res |
Definition at line 253 of file lsq.hh.
Referenced by gem5::o3::LSQ::SingleDataRequest::finish().
const uint32_t gem5::o3::LSQ::LSQRequest::_size |
Definition at line 255 of file lsq.hh.
Referenced by gem5::o3::LSQUnit::write(), and gem5::o3::LSQUnit::writebackStores().
|
protected |
Definition at line 235 of file lsq.hh.
Referenced by isInTranslation(), isMemAccessRequired(), isPartialFault(), isTranslationBlocked(), and setState().
uint32_t gem5::o3::LSQ::LSQRequest::_taskId |
|
protected |
Definition at line 225 of file lsq.hh.
Referenced by complete(), gem5::o3::LSQ::SingleDataRequest::finish(), isAnyOutstandingRequest(), isAtomic(), isComplete(), isDelayed(), isLoad(), isReleased(), isSent(), isSplit(), isTranslationBlocked(), isTranslationComplete(), LSQRequest(), LSQRequest(), markDelayed(), needWBToRegister(), packetNotSent(), packetSent(), release(), gem5::o3::LSQ::SplitDataRequest::SplitDataRequest(), squashTranslation(), writebackDone(), and writebackScheduled().
|
protected |
Definition at line 239 of file lsq.hh.
Referenced by gem5::o3::LSQ::SingleDataRequest::finish(), isAnyOutstandingRequest(), and squashTranslation().
|
protected |
Definition at line 238 of file lsq.hh.
Referenced by gem5::o3::LSQ::SingleDataRequest::finish().