45 #ifndef __CPU_TRANSLATION_HH__ 46 #define __CPU_TRANSLATION_HH__ 83 : outstanding(1), delay(false), isSplit(false), mainReq(_req),
84 sreqLow(NULL), sreqHigh(NULL), data(_data), res(_res), mode(_mode)
86 faults[0] = faults[1] =
NoFault;
98 : outstanding(2), delay(false), isSplit(true), mainReq(_req),
99 sreqLow(_sreqLow), sreqHigh(_sreqHigh), data(_data), res(_res),
102 faults[0] = faults[1] =
NoFault;
117 faults[
index] = fault;
119 if (isSplit && outstanding == 0) {
123 mainReq->setPaddr(sreqLow->getPaddr());
125 mainReq->setFlags(sreqLow->getFlags());
126 mainReq->setFlags(sreqHigh->getFlags());
128 return outstanding == 0;
152 faults[0] = faults[1] =
NoFault;
163 return mainReq->isStrictlyOrdered();
174 return mainReq->isPrefetch();
181 return mainReq->getPaddr();
192 return mainReq->getFlags();
217 template <
class ExecContextPtr>
227 : xc(_xc), state(_state), index(0)
233 : xc(_xc), state(_state), index(_index)
256 assert(mode == state->
mode);
257 if (state->
finish(fault, index)) {
260 req->setTranslateLatency();
262 xc->finishTranslation(state);
270 return xc->isSquashed();
274 #endif // __CPU_TRANSLATION_HH__ DataTranslation(ExecContextPtr _xc, WholeTranslationState *_state, int _index)
This class represents part of a data address translation.
bool squashed() const
This function is used by the page table walker to determine if it should translate the a pending requ...
unsigned getFlags()
Get the flags associated with this request.
Addr getPaddr() const
Get the physical address of this request.
decltype(nullptr) constexpr NoFault
WholeTranslationState(const RequestPtr &_req, uint8_t *_data, uint64_t *_res, BaseTLB::Mode _mode)
Single translation state.
std::shared_ptr< Request > RequestPtr
void deleteReqs()
Delete all requests that make up this translation.
void markDelayed()
Signal the translation state that the translation has been delayed due to a hw page table walk...
This class captures the state of an address translation.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
bool isPrefetch() const
Check if this request is a prefetch.
bool finish(const Fault &fault, int index)
Finish part of a translation.
DataTranslation(ExecContextPtr _xc, WholeTranslationState *_state)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Fault getFault() const
Determine whether this translation produced a fault.
WholeTranslationState(const RequestPtr &_req, const RequestPtr &_sreqLow, const RequestPtr &_sreqHigh, uint8_t *_data, uint64_t *_res, BaseTLB::Mode _mode)
Split translation state.
void setNoFault()
Remove all faults from the translation.
WholeTranslationState * state
std::shared_ptr< FaultBase > Fault
void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, BaseTLB::Mode mode)
Finish this part of the translation and indicate that the whole translation is complete if the state ...
bool isStrictlyOrdered() const
Check if this request is strictly ordered device access.