gem5  v22.0.0.2
Public Member Functions | Public Attributes | Private Attributes | List of all members
TestTranslationGen Class Reference
Inheritance diagram for TestTranslationGen:
gem5::TranslationGen

Public Member Functions

 TestTranslationGen (Addr new_start, Addr new_size, std::initializer_list< Range > ranges={})
 
void translate (Range &range) const override
 Subclasses implement this function to complete TranslationGen. More...
 
- Public Member Functions inherited from gem5::TranslationGen
 TranslationGen (Addr new_start, Addr new_size)
 The starting virtual address and the size of the entire region being translated. More...
 
virtual ~TranslationGen ()
 
Addr start () const
 
Addr size () const
 
const_iterator begin () const
 
const_iterator end () const
 

Public Attributes

const std::vector< Rangeresults
 
RangeList args
 

Private Attributes

std::vector< Range >::const_iterator resultPos
 

Additional Inherited Members

- Public Types inherited from gem5::TranslationGen
using const_iterator = TranslationGenConstIterator
 
- Protected Attributes inherited from gem5::TranslationGen
Addr _start
 
Addr _size
 

Detailed Description

Definition at line 94 of file translation_gen.test.cc.

Constructor & Destructor Documentation

◆ TestTranslationGen()

TestTranslationGen::TestTranslationGen ( Addr  new_start,
Addr  new_size,
std::initializer_list< Range ranges = {} 
)
inline

Definition at line 107 of file translation_gen.test.cc.

Member Function Documentation

◆ translate()

void TestTranslationGen::translate ( Range range) const
inlineoverridevirtual

Subclasses implement this function to complete TranslationGen.

It should accept a Range reference which will have its "vaddr" field set to the virtual address to translate, and the "size" field set to the remaining size of the entire region being translated.

If there is a fault performing the translation of "vaddr", then this function should set the "fault" field of range and return.

If the translation was successful, this method should set "paddr" to the corresponding physical address, and set "size" to the number of bytes corresponding to the translation. Or more precisely, size should be set to the maximum "N" where vaddr + n maps to paddr + n for all 0 <= n <= N.

Implements gem5::TranslationGen.

Definition at line 114 of file translation_gen.test.cc.

References gem5::TranslationGen::Range::fault, gem5::TranslationGen::Range::paddr, and gem5::TranslationGen::Range::size.

Member Data Documentation

◆ args

RangeList TestTranslationGen::args
mutable

Definition at line 100 of file translation_gen.test.cc.

◆ resultPos

std::vector<Range>::const_iterator TestTranslationGen::resultPos
mutableprivate

Definition at line 104 of file translation_gen.test.cc.

◆ results

const std::vector<Range> TestTranslationGen::results

Definition at line 98 of file translation_gen.test.cc.


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

Generated on Thu Jul 28 2022 13:32:55 for gem5 by doxygen 1.8.17