gem5 v24.0.0.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. | |
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. | |
TranslationGenConstIterator () | |
Construct a blank iterator, used by end(). | |
TranslationGenConstIterator (const TranslationGen *parent, Addr start) | |
Construct a valid new iterator and set it's starting conditions. | |
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 143 of file translation_gen.hh.
using gem5::TranslationGenConstIterator::iterator_category = std::forward_iterator_tag |
Definition at line 183 of file translation_gen.hh.
using gem5::TranslationGenConstIterator::pointer = const value_type * |
Definition at line 182 of file translation_gen.hh.
using gem5::TranslationGenConstIterator::reference = const value_type & |
Definition at line 181 of file translation_gen.hh.
Definition at line 180 of file translation_gen.hh.
|
inlineprivate |
Construct a blank iterator, used by end().
Definition at line 171 of file translation_gen.hh.
|
inlineprivate |
Construct a valid new iterator and set it's starting conditions.
Definition at line 173 of file translation_gen.hh.
References update().
|
inline |
Definition at line 185 of file translation_gen.hh.
|
inline |
Definition at line 249 of file translation_gen.hh.
|
inline |
Definition at line 197 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 215 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 235 of file translation_gen.hh.
|
inline |
Definition at line 198 of file translation_gen.hh.
References current.
|
inline |
Definition at line 190 of file translation_gen.hh.
|
inline |
Definition at line 243 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 154 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++(), and TranslationGenConstIterator().
|
friend |
Definition at line 150 of file translation_gen.hh.
|
private |
Definition at line 146 of file translation_gen.hh.
Referenced by operator*(), operator++(), operator->(), operator=(), operator==(), and update().
|
private |
Definition at line 148 of file translation_gen.hh.
Referenced by operator++(), and update().
|
private |
Definition at line 147 of file translation_gen.hh.
Referenced by operator++(), operator=(), operator==(), and update().