gem5  v22.1.0.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
gem5::WholeTranslationState Class Reference

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

#include <translation.hh>

Public Member Functions

 WholeTranslationState (const RequestPtr &_req, uint8_t *_data, uint64_t *_res, BaseMMU::Mode _mode)
 Single translation state. More...
 
 WholeTranslationState (const RequestPtr &_req, const RequestPtr &_sreqLow, const RequestPtr &_sreqHigh, uint8_t *_data, uint64_t *_res, BaseMMU::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
 
BaseMMU::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 62 of file translation.hh.

Constructor & Destructor Documentation

◆ WholeTranslationState() [1/2]

gem5::WholeTranslationState::WholeTranslationState ( const RequestPtr _req,
uint8_t *  _data,
uint64_t *  _res,
BaseMMU::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 82 of file translation.hh.

References faults, mode, gem5::NoFault, gem5::BaseMMU::Read, and gem5::BaseMMU::Write.

◆ WholeTranslationState() [2/2]

gem5::WholeTranslationState::WholeTranslationState ( const RequestPtr _req,
const RequestPtr _sreqLow,
const RequestPtr _sreqHigh,
uint8_t *  _data,
uint64_t *  _res,
BaseMMU::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 96 of file translation.hh.

References faults, mode, gem5::NoFault, gem5::BaseMMU::Read, and gem5::BaseMMU::Write.

Member Function Documentation

◆ deleteReqs()

void gem5::WholeTranslationState::deleteReqs ( )
inline

Delete all requests that make up this translation.

Definition at line 198 of file translation.hh.

References isSplit, mainReq, sreqHigh, and sreqLow.

◆ finish()

bool gem5::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 115 of file translation.hh.

References faults, gem5::MipsISA::index, isSplit, mainReq, gem5::NoFault, outstanding, sreqHigh, and sreqLow.

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

◆ getFault()

Fault gem5::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 137 of file translation.hh.

References faults, isSplit, and gem5::NoFault.

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

◆ getFlags()

unsigned gem5::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 191 of file translation.hh.

References mainReq.

◆ getPaddr()

Addr gem5::WholeTranslationState::getPaddr ( ) const
inline

Get the physical address of this request.

Definition at line 180 of file translation.hh.

References mainReq.

◆ isPrefetch()

bool gem5::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 173 of file translation.hh.

References mainReq.

◆ isStrictlyOrdered()

bool gem5::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 162 of file translation.hh.

References mainReq.

◆ setNoFault()

void gem5::WholeTranslationState::setNoFault ( )
inline

Remove all faults from the translation.

Definition at line 151 of file translation.hh.

References faults, and gem5::NoFault.

Member Data Documentation

◆ data

uint8_t* gem5::WholeTranslationState::data

Definition at line 74 of file translation.hh.

◆ delay

bool gem5::WholeTranslationState::delay

Definition at line 69 of file translation.hh.

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

◆ faults

Fault gem5::WholeTranslationState::faults[2]
protected

Definition at line 66 of file translation.hh.

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

◆ isSplit

bool gem5::WholeTranslationState::isSplit

Definition at line 70 of file translation.hh.

Referenced by deleteReqs(), finish(), and getFault().

◆ mainReq

RequestPtr gem5::WholeTranslationState::mainReq

Definition at line 71 of file translation.hh.

Referenced by deleteReqs(), finish(), getFlags(), getPaddr(), isPrefetch(), and isStrictlyOrdered().

◆ mode

BaseMMU::Mode gem5::WholeTranslationState::mode

◆ outstanding

int gem5::WholeTranslationState::outstanding
protected

Definition at line 65 of file translation.hh.

Referenced by finish().

◆ res

uint64_t* gem5::WholeTranslationState::res

Definition at line 75 of file translation.hh.

◆ sreqHigh

RequestPtr gem5::WholeTranslationState::sreqHigh

Definition at line 73 of file translation.hh.

Referenced by deleteReqs(), and finish().

◆ sreqLow

RequestPtr gem5::WholeTranslationState::sreqLow

Definition at line 72 of file translation.hh.

Referenced by deleteReqs(), and finish().


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

Generated on Wed Dec 21 2022 10:23:15 for gem5 by doxygen 1.9.1