gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
WholeTranslationState Class Reference

This class captures the state of an address translation. More...

#include <translation.hh>

Public Member Functions

 WholeTranslationState (RequestPtr _req, uint8_t *_data, uint64_t *_res, BaseTLB::Mode _mode)
 Single translation state. More...
 
 WholeTranslationState (RequestPtr _req, RequestPtr _sreqLow, RequestPtr _sreqHigh, uint8_t *_data, uint64_t *_res, BaseTLB::Mode _mode)
 Split translation state. More...
 
bool finish (const Fault &fault, int index)
 Finish part of a translation. More...
 
Fault getFault () const
 Determine whether this translation produced a fault. More...
 
void setNoFault ()
 Remove all faults from the translation. More...
 
bool isStrictlyOrdered () const
 Check if this request is strictly ordered device access. More...
 
bool isPrefetch () const
 Check if this request is a prefetch. More...
 
Addr getPaddr () const
 Get the physical address of this request. More...
 
unsigned getFlags ()
 Get the flags associated with this request. More...
 
void deleteReqs ()
 Delete all requests that make up this translation. More...
 

Public Attributes

bool delay
 
bool isSplit
 
RequestPtr mainReq
 
RequestPtr sreqLow
 
RequestPtr sreqHigh
 
uint8_t * data
 
uint64_t * res
 
BaseTLB::Mode mode
 

Protected Attributes

int outstanding
 
Fault faults [2]
 

Detailed Description

This class captures the state of an address translation.

A translation can be split in two if the ISA supports it and the memory access crosses a page boundary. In this case, this class is shared by two data translations (below). Otherwise it is used by a single data translation class. When each part of the translation is finished, the finish function is called which will indicate whether the whole translation is completed or not. There are also functions for accessing parts of the translation state which deal with the possible split correctly.

Definition at line 61 of file translation.hh.

Constructor & Destructor Documentation

WholeTranslationState::WholeTranslationState ( RequestPtr  _req,
uint8_t *  _data,
uint64_t *  _res,
BaseTLB::Mode  _mode 
)
inline

Single translation state.

We set the number of outstanding translations to one and indicate that it is not split.

Definition at line 81 of file translation.hh.

References faults, mode, NoFault, BaseTLB::Read, and BaseTLB::Write.

WholeTranslationState::WholeTranslationState ( RequestPtr  _req,
RequestPtr  _sreqLow,
RequestPtr  _sreqHigh,
uint8_t *  _data,
uint64_t *  _res,
BaseTLB::Mode  _mode 
)
inline

Split translation state.

We copy all state into this class, set the number of outstanding translations to two and then mark this as a split translation.

Definition at line 95 of file translation.hh.

References faults, mode, NoFault, BaseTLB::Read, and BaseTLB::Write.

Member Function Documentation

void WholeTranslationState::deleteReqs ( )
inline

Delete all requests that make up this translation.

Definition at line 197 of file translation.hh.

References isSplit, mainReq, sreqHigh, and sreqLow.

Referenced by TimingSimpleCPU::finishTranslation(), and BaseDynInst< Impl >::finishTranslation().

bool WholeTranslationState::finish ( const Fault fault,
int  index 
)
inline

Finish part of a translation.

If there is only one request then this translation is completed. If the request has been split in two then the outstanding count determines whether the translation is complete. In this case, flags from the split request are copied to the main request to make it easier to access them later on.

Definition at line 114 of file translation.hh.

References faults, Request::getFlags(), Request::getPaddr(), MipsISA::index, isSplit, mainReq, NoFault, outstanding, Request::setFlags(), Request::setPaddr(), sreqHigh, and sreqLow.

Referenced by DataTranslation< ExecContextPtr >::finish().

Fault WholeTranslationState::getFault ( ) const
inline

Determine whether this translation produced a fault.

Both parts of the translation must be checked if this is a split translation.

Definition at line 136 of file translation.hh.

References faults, isSplit, and NoFault.

Referenced by DataTranslation< ExecContextPtr >::finish(), TimingSimpleCPU::finishTranslation(), and BaseDynInst< Impl >::finishTranslation().

unsigned WholeTranslationState::getFlags ( )
inline

Get the flags associated with this request.

We only need to access the main request because the flags will have been copied here on a split translation.

Definition at line 190 of file translation.hh.

References Request::getFlags(), and mainReq.

Referenced by BaseDynInst< Impl >::finishTranslation().

Addr WholeTranslationState::getPaddr ( ) const
inline

Get the physical address of this request.

Definition at line 179 of file translation.hh.

References Request::getPaddr(), and mainReq.

Referenced by BaseDynInst< Impl >::finishTranslation().

bool WholeTranslationState::isPrefetch ( ) const
inline

Check if this request is a prefetch.

We only need to check the main request because the flags will have been copied here on a split translation.

Definition at line 172 of file translation.hh.

References Request::isPrefetch(), and mainReq.

Referenced by TimingSimpleCPU::finishTranslation().

bool WholeTranslationState::isStrictlyOrdered ( ) const
inline

Check if this request is strictly ordered device access.

We only need to check the main request because the flags will have been copied here on a split translation.

Definition at line 161 of file translation.hh.

References Request::isStrictlyOrdered(), and mainReq.

Referenced by BaseDynInst< Impl >::finishTranslation().

void WholeTranslationState::setNoFault ( )
inline

Remove all faults from the translation.

Definition at line 150 of file translation.hh.

References faults, and NoFault.

Referenced by TimingSimpleCPU::finishTranslation().

Member Data Documentation

uint8_t* WholeTranslationState::data

Definition at line 73 of file translation.hh.

Referenced by TimingSimpleCPU::finishTranslation().

bool WholeTranslationState::delay

Definition at line 68 of file translation.hh.

Referenced by DataTranslation< ExecContextPtr >::markDelayed().

Fault WholeTranslationState::faults[2]
protected

Definition at line 65 of file translation.hh.

Referenced by finish(), getFault(), setNoFault(), and WholeTranslationState().

bool WholeTranslationState::isSplit
RequestPtr WholeTranslationState::mainReq
BaseTLB::Mode WholeTranslationState::mode
int WholeTranslationState::outstanding
protected

Definition at line 64 of file translation.hh.

Referenced by finish().

uint64_t* WholeTranslationState::res
RequestPtr WholeTranslationState::sreqHigh
RequestPtr WholeTranslationState::sreqLow

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

Generated on Fri Jun 9 2017 13:04:23 for gem5 by doxygen 1.8.6