gem5
[DEVELOP-FOR-23.0]
|
An iterator for pulling "Range" instances out of a TranslationGen. More...
#include <translation_gen.hh>
Public Types | |
using | value_type = TranslationGen::Range |
using | reference = const value_type & |
using | pointer = const value_type * |
using | iterator_category = std::forward_iterator_tag |
Public Member Functions | |
TranslationGenConstIterator (const TranslationGenConstIterator &other) | |
TranslationGenConstIterator & | operator= (const TranslationGenConstIterator &other) |
reference | operator* () |
pointer | operator-> () |
TranslationGenConstIterator & | operator++ () |
The increment operator, which is the main work horse of this class. More... | |
TranslationGenConstIterator | operator++ (int) |
bool | operator== (const TranslationGenConstIterator &other) const |
bool | operator!= (const TranslationGenConstIterator &other) const |
Private Member Functions | |
void | update () |
Use the vaddr of the "current" Range to update its other fields. More... | |
TranslationGenConstIterator () | |
Construct a blank iterator, used by end(). More... | |
TranslationGenConstIterator (const TranslationGen *parent, Addr start) | |
Construct a valid new iterator and set it's starting conditions. More... | |
Private Attributes | |
TranslationGen::Range | current = {0} |
const TranslationGen * | gen = nullptr |
bool | end = true |
Friends | |
class | TranslationGen |
An iterator for pulling "Range" instances out of a TranslationGen.
Because only one "Range" instance is valid at a time (and is even reused), only the current value of the iterator is valid. When it's incremented, all prior versions of the iterator become invalid.
The iterator only supports being incremented and getting the next Range from the generator, and so is marked as a "forward" iterator.
Definition at line 140 of file translation_gen.hh.
using gem5::TranslationGenConstIterator::iterator_category = std::forward_iterator_tag |
Definition at line 180 of file translation_gen.hh.
using gem5::TranslationGenConstIterator::pointer = const value_type * |
Definition at line 179 of file translation_gen.hh.
using gem5::TranslationGenConstIterator::reference = const value_type & |
Definition at line 178 of file translation_gen.hh.
Definition at line 177 of file translation_gen.hh.
|
inlineprivate |
Construct a blank iterator, used by end().
Definition at line 168 of file translation_gen.hh.
|
inlineprivate |
Construct a valid new iterator and set it's starting conditions.
Definition at line 170 of file translation_gen.hh.
|
inline |
Definition at line 182 of file translation_gen.hh.
|
inline |
Definition at line 246 of file translation_gen.hh.
|
inline |
Definition at line 194 of file translation_gen.hh.
References current.
|
inline |
The increment operator, which is the main work horse of this class.
If there was no fault, then the vaddr of the previous translation is incremented by that translation's size.
If there was a fault, then the fault is cleared and vaddr is left alone so the translation can be reattempted.
The size is then set to however much is left to translate. If that is zero, then this iterator will transform into an end iterator. If not, then the "translate" method of the generator is called to translate (or retranslate) the current Range.
Definition at line 212 of file translation_gen.hh.
References current, end, gem5::TranslationGen::Range::fault, gen, gem5::NoFault, panic_if, gem5::TranslationGen::Range::size, update(), and gem5::TranslationGen::Range::vaddr.
|
inline |
Definition at line 232 of file translation_gen.hh.
|
inline |
Definition at line 195 of file translation_gen.hh.
References current.
|
inline |
Definition at line 187 of file translation_gen.hh.
|
inline |
Definition at line 240 of file translation_gen.hh.
References current, gen, and gem5::TranslationGen::Range::vaddr.
|
inlineprivate |
Use the vaddr of the "current" Range to update its other fields.
Definition at line 151 of file translation_gen.hh.
References current, end, gen, gem5::TranslationGen::Range::paddr, gem5::TranslationGen::Range::size, gem5::TranslationGen::size(), gem5::TranslationGen::start(), gem5::TranslationGen::translate(), and gem5::TranslationGen::Range::vaddr.
Referenced by operator++().
|
friend |
Definition at line 147 of file translation_gen.hh.
|
private |
Definition at line 143 of file translation_gen.hh.
Referenced by operator*(), operator++(), operator->(), operator=(), operator==(), and update().
|
private |
Definition at line 145 of file translation_gen.hh.
Referenced by operator++(), and update().
|
private |
Definition at line 144 of file translation_gen.hh.
Referenced by operator++(), operator=(), operator==(), and update().