gem5
v19.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 void | handleIprWrite (ThreadContext *thread, PacketPtr pkt)=0 |
Memory mapped IPR accesses. More... | |
virtual Cycles | handleIprRead (ThreadContext *thread, PacketPtr pkt)=0 |
virtual bool | isCacheBlockHit (Addr blockAddr, Addr cacheBlockMask)=0 |
Test if the request accesses a particular cache line. More... | |
void | packetSent () |
Update the status to reflect that a packet was sent. More... | |
void | packetNotSent () |
Update the status to reflect that a packet was not sent. More... | |
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. More... | |
void | discard () |
The request is discarded (e.g. More... | |
void | packetReplied () |
void | writebackScheduled () |
void | writebackDone () |
void | squashTranslation () |
void | complete () |
void | setContext (const ContextID &context_id) |
Convenience getters/setters. More... | |
const DynInstPtr & | instruction () |
void | setVirt (int asid, Addr vaddr, unsigned size, Request::Flags flags_, MasterID mid, Addr pc) |
Set up virtual request. More... | |
void | taskId (const uint32_t &v) |
uint32_t | taskId () const |
RequestPtr | request (int idx=0) |
const RequestPtr | request (int idx=0) const |
Addr | getVaddr (int idx=0) const |
virtual void | initiateTranslation ()=0 |
PacketPtr | packet (int idx=0) |
virtual PacketPtr | mainPacket () |
virtual RequestPtr | mainRequest () |
void | senderState (LSQSenderState *st) |
const LSQSenderState * | senderState () const |
void | discardSenderState () |
Mark senderState as discarded. More... | |
bool | isAnyOutstandingRequest () |
Test if there is any in-flight translation or mem access request. More... | |
bool | isSplit () const |
![]() | |
virtual | ~Translation () |
virtual void | finish (const Fault &fault, const RequestPtr &req, ThreadContext *tc, Mode mode)=0 |
Public Attributes | |
LSQUnit & | _port |
const DynInstPtr | _inst |
uint32_t | _taskId |
PacketDataPtr | _data |
std::vector< PacketPtr > | _packets |
std::vector< RequestPtr > | _requests |
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 |
Protected Types | |
enum | Flag : FlagsStorage { IsLoad = 0x00000001, WbStore = 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 | State { State::NotIssued, State::Translation, State::Request, State::Fault, State::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. More... | |
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 | isLoad () const |
bool | isAtomic () const |
void | install () |
Install the request in the LQ/SQ. More... | |
virtual 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. More... | |
bool | isReleased () |
Test if the LSQRequest has been released, i.e. More... | |
void | release (Flag reason) |
Release the LSQRequest. More... | |
void | addRequest (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 . More... | |
virtual | ~LSQRequest () |
Destructor. More... | |
Protected Attributes | |
FlagsType | flags |
State | _state |
LSQSenderState * | _senderState |
uint32_t | numTranslatedFragments |
uint32_t | numInTranslationFragments |
uint32_t | _entryIdx |
LQ/SQ entry idx. More... | |
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. It is also used by the LSQSenderState. 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 | | | +-----------------—+ | | | | +-----------------—+ | | | senderState owns | | +->| onRecvTimingResp | | | free resources | | +-----------------—+ | | +-------------------—+ | | self owned (Trans) | +–>| on TranslationFinish | | free resources | +-------------------—+
|
protected |
|
protected |
|
protected |
Enumerator | |
---|---|
IsLoad | |
WbStore | True if this is 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 |
|
inlineprotected |
Definition at line 305 of file lsq.hh.
References Flags< T >::set().
|
inlineprotected |
Definition at line 317 of file lsq.hh.
References Flags< T >::set().
|
inlineprotectedvirtual |
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 428 of file lsq.hh.
References MipsISA::r.
|
inlineprotected |
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 the mask is empty or if there is at least an active element in it.
Definition at line 408 of file lsq.hh.
References addr, isAnyActiveElement(), and LSQ< Impl >::LSQSenderState::request().
|
pure virtual |
Implemented in LSQ< Impl >::SplitDataRequest, and LSQ< Impl >::SingleDataRequest.
|
inline |
Definition at line 688 of file lsq.hh.
References Flags< T >::set().
|
inline |
|
inline |
Mark senderState as discarded.
This will cause to discard response packets from the cache.
Definition at line 523 of file lsq.hh.
References LSQ< Impl >::LSQSenderState::deleteRequest().
|
inline |
Definition at line 483 of file lsq.hh.
References LSQ< Impl >::LSQRequest::getVaddr(), and LSQ< Impl >::LSQSenderState::request().
Referenced by LSQ< Impl >::LSQRequest::getVaddr(), and LSQ< Impl >::pushRequest().
|
pure virtual |
Implemented in LSQ< Impl >::SplitDataRequest, and LSQ< Impl >::SingleDataRequest.
|
pure virtual |
Memory mapped IPR accesses.
Implemented in LSQ< Impl >::SplitDataRequest, and LSQ< Impl >::SingleDataRequest.
|
pure virtual |
Implemented in LSQ< Impl >::SplitDataRequest, and LSQ< Impl >::SingleDataRequest.
Referenced by LSQ< Impl >::pushRequest().
|
inlineprotected |
Install the request in the LQ/SQ.
Definition at line 351 of file lsq.hh.
References LSQ< Impl >::LSQSenderState::isLoad, LSQUnit< Impl >::loadQueue, and LSQUnit< Impl >::storeQueue.
|
inline |
|
inline |
Test if there is any in-flight translation or mem access request.
Definition at line 533 of file lsq.hh.
References Flags< T >::isSet().
|
inlineprotected |
Definition at line 345 of file lsq.hh.
References Flags< T >::isSet().
|
pure virtual |
Test if the request accesses a particular cache line.
Implemented in LSQ< Impl >::SplitDataRequest, and LSQ< Impl >::SingleDataRequest.
|
inline |
Definition at line 581 of file lsq.hh.
References Flags< T >::isSet().
|
inlineprotected |
Definition at line 286 of file lsq.hh.
References Flags< T >::isSet().
|
inline |
|
inlineprotected |
Definition at line 339 of file lsq.hh.
References Flags< T >::isSet().
|
inline |
Definition at line 620 of file lsq.hh.
References LSQ< Impl >::LSQSenderState::isLoad.
Referenced by LSQ< Impl >::pushRequest().
|
inline |
|
inlineprotected |
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 373 of file lsq.hh.
References Flags< T >::isSet().
|
inline |
Definition at line 608 of file lsq.hh.
References Flags< T >::isSet().
|
inline |
Definition at line 542 of file lsq.hh.
References AlphaISA::handleIprRead(), AlphaISA::handleIprWrite(), Flags< T >::isSet(), LSQ< Impl >::recvTimingResp(), and LSQ< Impl >::thread.
|
inline |
Definition at line 600 of file lsq.hh.
References Flags< T >::isSet().
|
inline |
Definition at line 593 of file lsq.hh.
References Flags< T >::isSet().
Referenced by LSQ< Impl >::pushRequest().
Reimplemented in LSQ< Impl >::SplitDataRequest.
|
inlinevirtual |
Reimplemented in LSQ< Impl >::SplitDataRequest.
Definition at line 496 of file lsq.hh.
References LSQ< Impl >::LSQSenderState::request().
|
inlineoverrideprotectedvirtual |
Signal that the translation has been delayed due to a hw page table walk.
Implements BaseTLB::Translation.
Definition at line 285 of file lsq.hh.
References Flags< T >::set().
|
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 573 of file lsq.hh.
References Flags< T >::clear(), ArmISA::i, and Flags< T >::set().
|
inline |
|
inline |
Update the status to reflect that a packet was sent.
Definition at line 564 of file lsq.hh.
References Flags< T >::set().
|
pure virtual |
Implemented in LSQ< Impl >::SplitDataRequest, and LSQ< Impl >::SingleDataRequest.
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 388 of file lsq.hh.
References LSQ< Impl >::LSQSenderState::deleteRequest(), and Flags< T >::set().
|
inline |
Definition at line 475 of file lsq.hh.
Referenced by LSQ< Impl >::pushRequest(), LSQ< Impl >::read(), and LSQ< Impl >::write().
|
inline |
|
inline |
Definition at line 503 of file lsq.hh.
References ArmISA::st.
|
inline |
void LSQ< Impl >::LSQRequest::sendFragmentToTranslation | ( | int | i | ) |
Definition at line 975 of file lsq_impl.hh.
References BaseTLB::Read, and BaseTLB::Write.
|
pure virtual |
Implemented in LSQ< Impl >::SplitDataRequest, and LSQ< Impl >::SingleDataRequest.
|
inline |
Convenience getters/setters.
Set up Context numbers.
Definition at line 445 of file lsq.hh.
References LSQ< Impl >::LSQSenderState::request(), and LSQ< Impl >::LSQRequest::setContext().
Referenced by LSQ< Impl >::LSQRequest::setContext().
|
inline |
|
inline |
Set up virtual request.
For a previously allocated Request objects.
Definition at line 460 of file lsq.hh.
References LSQ< Impl >::LSQSenderState::request(), and LSQ< Impl >::LSQRequest::setVirt().
Referenced by LSQ< Impl >::LSQRequest::setVirt().
|
inlineoverrideprotectedvirtual |
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 BaseTLB::Translation.
|
inline |
Definition at line 677 of file lsq.hh.
References Flags< T >::set().
|
inline |
Definition at line 467 of file lsq.hh.
References MipsISA::r, and ArmISA::v.
Referenced by LSQ< Impl >::pushRequest().
|
inline |
|
inline |
Definition at line 667 of file lsq.hh.
References Flags< T >::set().
Referenced by LSQ< Impl >::LSQSenderState::writebackDone().
|
inline |
Definition at line 660 of file lsq.hh.
References Flags< T >::isSet(), and Flags< T >::set().
AtomicOpFunctorPtr LSQ< Impl >::LSQRequest::_amo_op |
std::vector<bool> LSQ< Impl >::LSQRequest::_byteEnable |
Definition at line 300 of file lsq.hh.
Referenced by LSQ< Impl >::pushRequest().
PacketDataPtr LSQ< Impl >::LSQRequest::_data |
|
protected |
std::vector<Fault> LSQ< Impl >::LSQRequest::_fault |
const Request::Flags LSQ< Impl >::LSQRequest::_flags |
const DynInstPtr LSQ< Impl >::LSQRequest::_inst |
Definition at line 290 of file lsq.hh.
Referenced by LSQ< Impl >::SingleDataRequest::finish().
uint32_t LSQ< Impl >::LSQRequest::_numOutstandingPackets |
std::vector<PacketPtr> LSQ< Impl >::LSQRequest::_packets |
std::vector<RequestPtr> LSQ< Impl >::LSQRequest::_requests |
Definition at line 294 of file lsq.hh.
Referenced by LSQ< Impl >::SingleDataRequest::isCacheBlockHit().
|
protected |
const uint32_t LSQ< Impl >::LSQRequest::_size |
uint32_t LSQ< Impl >::LSQRequest::_taskId |
|
protected |
|
protected |