gem5  v21.1.0.2
Classes | Typedefs | Functions | Variables | Friends
The utility functions and constants API.

These are a collection of utility functions and constants defined in src/base. More...

Classes

class  gem5::CircularQueue< T >
 Circular queue. More...
 
class  gem5::Trie< Key, Value >
 A trie is a tree-based data structure used for data retrieval. More...
 

Typedefs

typedef Nodegem5::Trie< Key, Value >::Handle
 

Functions

 gem5::CircularQueue< T >::iterator::iterator (CircularQueue *cq, size_t idx)
 
 gem5::CircularQueue< T >::iterator::iterator (const iterator &it)
 Trait reference type iterator satisfies OutputIterator, therefore reference must be T&. More...
 
iteratorgem5::CircularQueue< T >::iterator::operator= (const iterator &it)
 
bool gem5::CircularQueue< T >::iterator::dereferenceable () const
 Test dereferenceability. More...
 
bool gem5::CircularQueue< T >::iterator::operator== (const iterator &that) const
 InputIterator. More...
 
bool gem5::CircularQueue< T >::iterator::operator!= (const iterator &that)
 Inequality operator. More...
 
reference gem5::CircularQueue< T >::iterator::operator* ()
 Dereference operator. More...
 
const_reference gem5::CircularQueue< T >::iterator::operator* () const
 
pointer gem5::CircularQueue< T >::iterator::operator-> ()
 Dereference operator. More...
 
const_pointer gem5::CircularQueue< T >::iterator::operator-> () const
 
iteratorgem5::CircularQueue< T >::iterator::operator++ ()
 Pre-increment operator. More...
 
iterator gem5::CircularQueue< T >::iterator::operator++ (int)
 Post-increment operator. More...
 
iteratorgem5::CircularQueue< T >::iterator::operator-- ()
 ForwardIterator The multipass guarantee is provided by the reliance on _idx. More...
 
iterator gem5::CircularQueue< T >::iterator::operator-- (int)
 Post-decrement operator. More...
 
iteratorgem5::CircularQueue< T >::iterator::operator+= (const difference_type &t)
 RandomAccessIterator requirements. More...
 
iteratorgem5::CircularQueue< T >::iterator::operator-= (const difference_type &t)
 
iterator gem5::CircularQueue< T >::iterator::operator+ (const difference_type &t)
 Addition operator. More...
 
iterator gem5::CircularQueue< T >::iterator::operator- (const difference_type &t)
 Substraction operator. More...
 
difference_type gem5::CircularQueue< T >::iterator::operator- (const iterator &that)
 Difference operator. More...
 
template<typename Idx >
std::enable_if_t< std::is_integral< Idx >::value, referencegem5::CircularQueue< T >::iterator::operator[] (const Idx &index)
 Index operator. More...
 
bool gem5::CircularQueue< T >::iterator::operator< (const iterator &that) const
 Comparisons. More...
 
bool gem5::CircularQueue< T >::iterator::operator> (const iterator &that) const
 
bool gem5::CircularQueue< T >::iterator::operator>= (const iterator &that) const
 
bool gem5::CircularQueue< T >::iterator::operator<= (const iterator &that) const
 
template<typename Idx >
std::enable_if_t< std::is_integral< Idx >::value, referencegem5::CircularQueue< T >::operator[] (const Idx &index)
 
 gem5::CircularQueue< T >::CircularQueue (size_t size=0)
 
void gem5::CircularQueue< T >::flush ()
 Remove all the elements in the queue. More...
 
reference gem5::CircularQueue< T >::front ()
 
reference gem5::CircularQueue< T >::back ()
 
size_t gem5::CircularQueue< T >::head () const
 
size_t gem5::CircularQueue< T >::tail () const
 
size_t gem5::CircularQueue< T >::capacity () const
 
size_t gem5::CircularQueue< T >::size () const
 
void gem5::CircularQueue< T >::pop_front (size_t num_elem=1)
 Circularly increase the head pointer. More...
 
void gem5::CircularQueue< T >::pop_back ()
 Circularly decrease the tail pointer. More...
 
void gem5::CircularQueue< T >::push_back (typename std::vector< T >::value_type val)
 Pushes an element at the end of the queue. More...
 
void gem5::CircularQueue< T >::advance_tail ()
 Increases the tail by one. More...
 
void gem5::CircularQueue< T >::advance_tail (size_t len)
 Increases the tail by a specified number of steps. More...
 
bool gem5::CircularQueue< T >::empty () const
 Is the queue empty? More...
 
bool gem5::CircularQueue< T >::full () const
 Is the queue full? A queue is full if the head is the 0^{th} element and the tail is the (size-1)^{th} element, or if the head is the n^{th} element and the tail the (n-1)^{th} element. More...
 
iterator gem5::CircularQueue< T >::begin ()
 Iterators. More...
 
iterator gem5::CircularQueue< T >::begin () const
 
iterator gem5::CircularQueue< T >::end ()
 
iterator gem5::CircularQueue< T >::end () const
 
static bool gem5::findCarry (int width, uint64_t dest, uint64_t src1, uint64_t src2)
 Calculate the carry flag from an addition. More...
 
static bool gem5::findOverflow (int width, uint64_t dest, uint64_t src1, uint64_t src2)
 Calculate the overflow flag from an addition. More...
 
static bool gem5::findParity (int width, uint64_t dest)
 Calculate the parity of a value. More...
 
static bool gem5::findNegative (int width, uint64_t dest)
 Calculate the negative flag. More...
 
static bool gem5::findZero (int width, uint64_t dest)
 Calculate the zero flag. More...
 
template<uint32_t Poly>
uint32_t gem5::crc32 (const uint8_t *data, uint32_t crc, std::size_t size)
 Evaluate the CRC32 of the first size bytes of a data buffer, using a specific polynomium and an initial value. More...
 
template<class T >
static constexpr std::enable_if_t< std::is_integral< T >::value, int > gem5::floorLog2 (T x)
 
template<class T >
static constexpr int gem5::ceilLog2 (const T &n)
 
template<class T >
static constexpr bool gem5::isPowerOf2 (const T &n)
 
template<class T , class U >
static constexpr T gem5::divCeil (const T &a, const U &b)
 
template<typename T >
static constexpr std::enable_if_t< sizeof(T)==sizeof(uint64_t)> gem5::mulUnsigned (std::make_unsigned_t< T > &high, std::make_unsigned_t< T > &low, std::make_unsigned_t< T > val_a, std::make_unsigned_t< T > val_b)
 
template<typename T >
static constexpr std::enable_if_t< sizeof(T)==sizeof(uint64_t)> gem5::mulSigned (std::make_signed_t< T > &high, std::make_signed_t< T > &low, std::make_signed_t< T > val_a, std::make_signed_t< T > val_b)
 
template<class T , class U >
static constexpr T gem5::roundUp (const T &val, const U &align)
 This function is used to align addresses in memory. More...
 
template<class T , class U >
static constexpr T gem5::roundDown (const T &val, const U &align)
 This function is used to align addresses in memory. More...
 
static constexpr int gem5::log2i (int value)
 Calculate the log2 of a power of 2 integer. More...
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value, T > gem5::Random::random ()
 Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating point. More...
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value, T > gem5::Random::random (T min, T max)
 
template<typename T >
std::enable_if_t< IsHelpedContainer< T >::value, std::ostream & > gem5::stl_helpers::operator<< (std::ostream &out, const T &t)
 Write out all elements in an stl container as a space separated list enclosed in square brackets. More...
 
 gem5::Trie< Key, Value >::Trie ()
 
Handle gem5::Trie< Key, Value >::insert (Key key, unsigned width, Value *val)
 Method which inserts a key/value pair into the trie. More...
 
Valuegem5::Trie< Key, Value >::lookup (Key key)
 Method which looks up the Value corresponding to a particular key. More...
 
Valuegem5::Trie< Key, Value >::remove (Handle handle)
 Method to delete a value from the trie. More...
 
Valuegem5::Trie< Key, Value >::remove (Key key)
 Method to lookup a value from the trie and then delete it. More...
 
void gem5::Trie< Key, Value >::clear ()
 A method which removes all key/value pairs from the trie. More...
 

Variables

const char * gem5::compileDate = __DATE__ " " __TIME__
 
std::mt19937_64 gem5::Random::gen
 
Random gem5::random_mt
 
static const unsigned gem5::Trie< Key, Value >::MaxBits = sizeof(Key) * 8
 
const char * gem5::gem5Version = "21.1.0.2"
 

Friends

iterator gem5::CircularQueue< T >::iterator::operator+ (const difference_type &t, iterator &it)
 
iterator gem5::CircularQueue< T >::iterator::operator- (const difference_type &t, iterator &it)
 
using gem5::CircularQueue< T >::iterator::value_type = T
 Iterator Traits. More...
 
using gem5::CircularQueue< T >::iterator::difference_type = std::ptrdiff_t
 
using gem5::CircularQueue< T >::iterator::reference = value_type &
 
using gem5::CircularQueue< T >::iterator::const_reference = const value_type &
 
using gem5::CircularQueue< T >::iterator::pointer = value_type *
 
using gem5::CircularQueue< T >::iterator::const_pointer = const value_type *
 
using gem5::CircularQueue< T >::iterator::iterator_category = std::random_access_iterator_tag
 
 gem5::Random::Random ()
 
 gem5::Random::Random (uint32_t s)
 

Detailed Description

These are a collection of utility functions and constants defined in src/base.

Typedef Documentation

◆ const_pointer

template<typename T >
using gem5::CircularQueue< T >::iterator::const_pointer = const value_type*

Definition at line 108 of file circular_queue.hh.

◆ const_reference

template<typename T >
using gem5::CircularQueue< T >::iterator::const_reference = const value_type&

Definition at line 106 of file circular_queue.hh.

◆ difference_type

template<typename T >
using gem5::CircularQueue< T >::iterator::difference_type = std::ptrdiff_t

Definition at line 104 of file circular_queue.hh.

◆ Handle

template<class Key , class Value >
typedef Node* gem5::Trie< Key, Value >::Handle

Definition at line 125 of file trie.hh.

◆ iterator_category

template<typename T >
using gem5::CircularQueue< T >::iterator::iterator_category = std::random_access_iterator_tag

Definition at line 109 of file circular_queue.hh.

◆ pointer

template<typename T >
using gem5::CircularQueue< T >::iterator::pointer = value_type*

Definition at line 107 of file circular_queue.hh.

◆ reference

template<typename T >
using gem5::CircularQueue< T >::iterator::reference = value_type&

Definition at line 105 of file circular_queue.hh.

◆ value_type

template<typename T >
using gem5::CircularQueue< T >::iterator::value_type = T

Iterator Traits.

Definition at line 103 of file circular_queue.hh.

Function Documentation

◆ advance_tail() [1/2]

template<typename T >
void gem5::CircularQueue< T >::advance_tail ( )
inline

Increases the tail by one.

This may overwrite the head if the queue is full.

Definition at line 515 of file circular_queue.hh.

Referenced by gem5::o3::LSQUnit::insertLoad(), gem5::o3::LSQUnit::insertStore(), and gem5::CircularQueue< Tick >::push_back().

◆ advance_tail() [2/2]

template<typename T >
void gem5::CircularQueue< T >::advance_tail ( size_t  len)
inline

Increases the tail by a specified number of steps.

This may overwrite one or more entries starting at the head if the queue is full.

Parameters
lenNumber of steps

Definition at line 532 of file circular_queue.hh.

◆ back()

template<typename T >
reference gem5::CircularQueue< T >::back ( )
inline

◆ begin() [1/2]

template<typename T >
iterator gem5::CircularQueue< T >::begin ( )
inline

◆ begin() [2/2]

template<typename T >
iterator gem5::CircularQueue< T >::begin ( ) const
inline

Definition at line 572 of file circular_queue.hh.

◆ capacity()

template<typename T >
size_t gem5::CircularQueue< T >::capacity ( ) const
inline

◆ ceilLog2()

template<class T >
static constexpr int gem5::ceilLog2 ( const T &  n)
staticconstexpr

◆ CircularQueue()

template<typename T >
gem5::CircularQueue< T >::CircularQueue ( size_t  size = 0)
inlineexplicit

Definition at line 412 of file circular_queue.hh.

◆ clear()

template<class Key , class Value >
void gem5::Trie< Key, Value >::clear ( )
inline

A method which removes all key/value pairs from the trie.

This is more efficient than trying to remove elements individually.

Definition at line 379 of file trie.hh.

◆ crc32()

template<uint32_t Poly>
uint32_t gem5::crc32 ( const uint8_t *  data,
uint32_t  crc,
std::size_t  size 
)

Evaluate the CRC32 of the first size bytes of a data buffer, using a specific polynomium and an initial value.

The crc is accomplished by reversing the input, the initial value and the output (remainder).

Parameters
dataInput data buffer pointer
crcInitial value of the checksum
sizeNumber of bytes
Returns
32-bit remainder of the checksum

Definition at line 62 of file crc.hh.

References data, gem5::ArmISA::i, gem5::ArmISA::j, and gem5::reverseBits().

◆ dereferenceable()

template<typename T >
bool gem5::CircularQueue< T >::iterator::dereferenceable ( ) const
inline

Test dereferenceability.

An iterator is dereferenceable if it is pointing to a non-null circular queue, and the index is within the current range of the queue.

Definition at line 143 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_cq, gem5::CircularQueue< T >::iterator::_idx, and gem5::CircularQueue< T >::isValidIdx().

◆ divCeil()

template<class T , class U >
static constexpr T gem5::divCeil ( const T &  a,
const U &  b 
)
staticconstexpr

Definition at line 110 of file intmath.hh.

References gem5::ArmISA::a, and gem5::ArmISA::b.

Referenced by gem5::memory::DRAMInterface::activateBank(), gem5::Process::allocateMem(), gem5::BaseXBar::calcPacketTiming(), gem5::ruby::garnet::flit::deserialize(), gem5::memory::DRAMInterface::doBurstAccess(), gem5::memory::qos::MemCtrl::escalateQueues(), gem5::ruby::garnet::NetworkInterface::flitisizeMessage(), gem5::memory::DRAMInterface::Rank::flushCmdList(), gem5::DRAMPower::getDataRate(), gem5::DRAMPower::getTimingParams(), gem5::Gicv3Distributor::Gicv3Distributor(), gem5::Plic::init(), gem5::Wavefront::initRegState(), gem5::GPUComputeDriver::ioctl(), gem5::TrafficGen::parseConfig(), gem5::memory::DRAMInterface::Rank::powerDownSleep(), gem5::memory::DRAMInterface::prechargeBank(), gem5::memory::qos::MemSinkCtrl::processNextReqEvent(), gem5::memory::DRAMInterface::Rank::processRefreshEvent(), gem5::memory::DRAMSim2::readComplete(), gem5::SerialLink::SerialLinkResponsePort::recvTimingReq(), gem5::memory::qos::MemSinkCtrl::recvTimingReq(), gem5::memory::MemCtrl::recvTimingReq(), gem5::SerialLink::SerialLinkRequestPort::recvTimingResp(), gem5::Clocked::resetClock(), gem5::memory::DRAMInterface::Rank::resetStats(), gem5::ruby::Consumer::scheduleEventAbsolute(), gem5::memory::DRAMInterface::Rank::scheduleWakeUpEvent(), gem5::ruby::garnet::flit::serialize(), gem5::memory::DRAMInterface::startup(), TEST(), gem5::AtomicSimpleCPU::tick(), gem5::Clocked::ticksToCycles(), gem5::SerialLink::SerialLinkResponsePort::trySendTiming(), gem5::SerialLink::SerialLinkRequestPort::trySendTiming(), gem5::Clocked::update(), gem5::memory::DRAMInterface::Rank::updatePowerStats(), and gem5::memory::DRAMSim2::writeComplete().

◆ empty()

template<typename T >
bool gem5::CircularQueue< T >::empty ( ) const
inline

◆ end() [1/2]

template<typename T >
iterator gem5::CircularQueue< T >::end ( )
inline

◆ end() [2/2]

template<typename T >
iterator gem5::CircularQueue< T >::end ( ) const
inline

Definition at line 586 of file circular_queue.hh.

◆ findCarry()

static bool gem5::findCarry ( int  width,
uint64_t  dest,
uint64_t  src1,
uint64_t  src2 
)
inlinestatic

Calculate the carry flag from an addition.

This should work even when a carry value is also added in.

Parameters: dest: The result value of the addition. src1: One of the addends that was added. src2: The other addend that was added in.

Rationale: This code analyzes the most sig. bits of the source addends and result, and deduces the carry out flag from them without needing the carry in bit.

Observe that we have four cases after an addition regarding the carry in and carry out bits:

If we have no carry in but a carry out: src1 and src2 must both be 1, with the result bit being 0. Hence, ~0 + 1 + 1 => 11, which has a high second bit. We return true.

If we have a carry in and a carry out: src1 and src2 can either be 1 and 0, or vice versa. In this case, the addition with the carry in gives a result bit of 0 but a carry out. Hence, ~0 + 1 + 0 => 10, or ~0 + 0 + 1 => 10. We return true.

Or, src1 and src2 can both be one. Along with the carry, this gives a result of 1 and a carry out of 1. Hence, ~1 + 1 + 1 => 10. We return true.

If we have no carry in and no carry out: src1 and src2 can either be 1 and 0, 0 and 1, or 0 and 0. In the first two cases the result bit is 1, which when negated does not contribute to the sum algorithm at all. In the last case the result bit is zero, but neither src1 nor src2 contribute to the sum either. Hence, ~1 + 1 + 0 => 1, ~1 + 0 + 1 => 1, ~0 + 0 + 0 => 1. So we return false for all of these cases.

If we have a carry in, but no carry out: src1 and src2 can neither be 1. So the overall result bit is 1. Hence: ~1 + 0 + 0 => 0. We return false.

Definition at line 84 of file condcodes.hh.

References gem5::ArmISA::shift, and gem5::ArmISA::width.

Referenced by gem5::X86ISA::RegOpBase::genFlags(), and TEST().

◆ findNegative()

static bool gem5::findNegative ( int  width,
uint64_t  dest 
)
inlinestatic

Calculate the negative flag.

Definition at line 141 of file condcodes.hh.

References gem5::bits(), and gem5::ArmISA::width.

Referenced by gem5::X86ISA::RegOpBase::genFlags(), and TEST().

◆ findOverflow()

static bool gem5::findOverflow ( int  width,
uint64_t  dest,
uint64_t  src1,
uint64_t  src2 
)
inlinestatic

Calculate the overflow flag from an addition.

Definition at line 98 of file condcodes.hh.

References gem5::ArmISA::shift, and gem5::ArmISA::width.

Referenced by gem5::X86ISA::RegOpBase::genFlags(), and TEST().

◆ findParity()

static bool gem5::findParity ( int  width,
uint64_t  dest 
)
inlinestatic

Calculate the parity of a value.

1 is for odd parity and 0 is for even.

Parameters: dest: a value to be tested.

Rationale: findParity simply performs bitwise XOR operations on each "pair" of bits in the dest parameter; the procedure being that a pair of ones will be XOR'ed out of the intermediate value.

This process is repeated until one last pair of bits are XOR'ed together. If the intermediate is still one, then there is exactly one high bit which does not have a corresponding high bit. Therefore, the value must have odd parity, and we return 1 accordingly. Otherwise we return 0.

Definition at line 123 of file condcodes.hh.

References gem5::mask(), and gem5::ArmISA::width.

Referenced by gem5::X86ISA::RegOpBase::genFlags(), and TEST().

◆ findZero()

static bool gem5::findZero ( int  width,
uint64_t  dest 
)
inlinestatic

Calculate the zero flag.

Definition at line 152 of file condcodes.hh.

References gem5::mask(), and gem5::ArmISA::width.

Referenced by gem5::X86ISA::RegOpBase::genFlags(), and TEST().

◆ floorLog2()

template<class T >
static constexpr std::enable_if_t<std::is_integral<T>::value, int> gem5::floorLog2 ( x)
staticconstexpr

◆ flush()

template<typename T >
void gem5::CircularQueue< T >::flush ( )
inline

Remove all the elements in the queue.

Note: This does not actually remove elements from the backing store.

Definition at line 423 of file circular_queue.hh.

Referenced by gem5::prefetch::DeltaCorrelatingPredictionTables::DCPTEntry::invalidate().

◆ front()

template<typename T >
reference gem5::CircularQueue< T >::front ( )
inline

◆ full()

template<typename T >
bool gem5::CircularQueue< T >::full ( ) const
inline

Is the queue full? A queue is full if the head is the 0^{th} element and the tail is the (size-1)^{th} element, or if the head is the n^{th} element and the tail the (n-1)^{th} element.

Definition at line 558 of file circular_queue.hh.

Referenced by gem5::CircularQueue< Tick >::advance_tail(), gem5::o3::LSQUnit::insertLoad(), gem5::o3::LSQUnit::insertStore(), gem5::prefetch::DeltaCorrelatingPredictionTables::DCPTEntry::invalidate(), gem5::o3::LSQUnit::lqFull(), gem5::prefetch::SBOOE::notifyFill(), gem5::o3::LSQUnit::sqFull(), and TEST().

◆ head()

template<typename T >
size_t gem5::CircularQueue< T >::head ( ) const
inline

◆ insert()

template<class Key , class Value >
Handle gem5::Trie< Key, Value >::insert ( Key  key,
unsigned  width,
Value val 
)
inline

Method which inserts a key/value pair into the trie.

Parameters
keyThe key which can later be used to look up this value.
widthHow many bits of the key (from msb) should be used.
valA pointer to the value to store in the trie.
Returns
A Handle corresponding to this value.

Definition at line 213 of file trie.hh.

Referenced by gem5::X86ISA::TLB::unserialize().

◆ isPowerOf2()

template<class T >
static constexpr bool gem5::isPowerOf2 ( const T &  n)
staticconstexpr

◆ iterator() [1/2]

template<typename T >
gem5::CircularQueue< T >::iterator::iterator ( CircularQueue cq,
size_t  idx 
)
inline

Definition at line 94 of file circular_queue.hh.

◆ iterator() [2/2]

template<typename T >
gem5::CircularQueue< T >::iterator::iterator ( const iterator it)
inline

Trait reference type iterator satisfies OutputIterator, therefore reference must be T&.

Definition at line 121 of file circular_queue.hh.

◆ log2i()

static constexpr int gem5::log2i ( int  value)
staticconstexpr

Calculate the log2 of a power of 2 integer.

Parameters
Aninput value
Returns
The base 2 log of value

Definition at line 295 of file intmath.hh.

References gem5::ctz32(), and gem5::isPowerOf2().

Referenced by TEST().

◆ lookup()

template<class Key , class Value >
Value* gem5::Trie< Key, Value >::lookup ( Key  key)
inline

Method which looks up the Value corresponding to a particular key.

Parameters
keyThe key to look up.
Returns
The first Value matching this key, or NULL if none was found.

Definition at line 301 of file trie.hh.

Referenced by gem5::X86ISA::TLB::demapPage(), and gem5::X86ISA::TLB::lookup().

◆ mulSigned()

template<typename T >
static constexpr std::enable_if_t<sizeof(T) == sizeof(uint64_t)> gem5::mulSigned ( std::make_signed_t< T > &  high,
std::make_signed_t< T > &  low,
std::make_signed_t< T >  val_a,
std::make_signed_t< T >  val_b 
)
staticconstexpr

Definition at line 218 of file intmath.hh.

References gem5::high, and gem5::X86ISA::val.

◆ mulUnsigned()

template<typename T >
static constexpr std::enable_if_t<sizeof(T) == sizeof(uint64_t)> gem5::mulUnsigned ( std::make_unsigned_t< T > &  high,
std::make_unsigned_t< T > &  low,
std::make_unsigned_t< T >  val_a,
std::make_unsigned_t< T >  val_b 
)
staticconstexpr

Definition at line 184 of file intmath.hh.

References gem5::high, and gem5::X86ISA::val.

◆ operator!=()

template<typename T >
bool gem5::CircularQueue< T >::iterator::operator!= ( const iterator that)
inline

Inequality operator.

Conversely, two iterators are different if they both point to different circular queues or they point to different elements.

Definition at line 170 of file circular_queue.hh.

◆ operator*() [1/2]

template<typename T >
reference gem5::CircularQueue< T >::iterator::operator* ( )
inline

Dereference operator.

Definition at line 178 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_cq, and gem5::CircularQueue< T >::iterator::_idx.

◆ operator*() [2/2]

template<typename T >
const_reference gem5::CircularQueue< T >::iterator::operator* ( ) const
inline

◆ operator+()

template<typename T >
iterator gem5::CircularQueue< T >::iterator::operator+ ( const difference_type t)
inline

Addition operator.

Definition at line 294 of file circular_queue.hh.

References gem5::ArmISA::t.

◆ operator++() [1/2]

template<typename T >
iterator& gem5::CircularQueue< T >::iterator::operator++ ( )
inline

Pre-increment operator.

Definition at line 213 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_idx.

◆ operator++() [2/2]

template<typename T >
iterator gem5::CircularQueue< T >::iterator::operator++ ( int  )
inline

Post-increment operator.

Definition at line 225 of file circular_queue.hh.

References gem5::ArmISA::t.

◆ operator+=()

template<typename T >
iterator& gem5::CircularQueue< T >::iterator::operator+= ( const difference_type t)
inline

RandomAccessIterator requirements.

Definition at line 271 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_idx, and gem5::ArmISA::t.

◆ operator-() [1/2]

template<typename T >
iterator gem5::CircularQueue< T >::iterator::operator- ( const difference_type t)
inline

Substraction operator.

Definition at line 316 of file circular_queue.hh.

References gem5::ArmISA::t.

◆ operator-() [2/2]

template<typename T >
difference_type gem5::CircularQueue< T >::iterator::operator- ( const iterator that)
inline

Difference operator.

that + ret == this

Definition at line 339 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_idx.

◆ operator--() [1/2]

template<typename T >
iterator& gem5::CircularQueue< T >::iterator::operator-- ( )
inline

ForwardIterator The multipass guarantee is provided by the reliance on _idx.

BidirectionalIterator requirements. Pre-decrement operator.

Definition at line 244 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_cq, gem5::CircularQueue< T >::iterator::_idx, and gem5::CircularQueue< T >::head().

◆ operator--() [2/2]

template<typename T >
iterator gem5::CircularQueue< T >::iterator::operator-- ( int  )
inline

Post-decrement operator.

Definition at line 258 of file circular_queue.hh.

References gem5::ArmISA::t.

◆ operator-=()

template<typename T >
iterator& gem5::CircularQueue< T >::iterator::operator-= ( const difference_type t)
inline

◆ operator->() [1/2]

template<typename T >
pointer gem5::CircularQueue< T >::iterator::operator-> ( )
inline

Dereference operator.

Rely on operator* to check for dereferenceability.

Definition at line 200 of file circular_queue.hh.

◆ operator->() [2/2]

template<typename T >
const_pointer gem5::CircularQueue< T >::iterator::operator-> ( ) const
inline

Definition at line 205 of file circular_queue.hh.

◆ operator<()

template<typename T >
bool gem5::CircularQueue< T >::iterator::operator< ( const iterator that) const
inline

Comparisons.

Definition at line 363 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_idx.

◆ operator<<()

template<typename T >
std::enable_if_t<IsHelpedContainer<T>::value, std::ostream &> gem5::stl_helpers::operator<< ( std::ostream &  out,
const T &  t 
)

Write out all elements in an stl container as a space separated list enclosed in square brackets.

Definition at line 61 of file stl_helpers.hh.

References gem5::ArmISA::t.

◆ operator<=()

template<typename T >
bool gem5::CircularQueue< T >::iterator::operator<= ( const iterator that) const
inline

Definition at line 381 of file circular_queue.hh.

◆ operator=()

template<typename T >
iterator& gem5::CircularQueue< T >::iterator::operator= ( const iterator it)
inline

◆ operator==()

template<typename T >
bool gem5::CircularQueue< T >::iterator::operator== ( const iterator that) const
inline

InputIterator.

Equality operator. Two iterators must point to the same, possibly null, circular queue and the same element on it to be equal.

Definition at line 158 of file circular_queue.hh.

References gem5::CircularQueue< T >::iterator::_cq, and gem5::CircularQueue< T >::iterator::_idx.

◆ operator>()

template<typename T >
bool gem5::CircularQueue< T >::iterator::operator> ( const iterator that) const
inline

Definition at line 371 of file circular_queue.hh.

◆ operator>=()

template<typename T >
bool gem5::CircularQueue< T >::iterator::operator>= ( const iterator that) const
inline

Definition at line 376 of file circular_queue.hh.

◆ operator[]() [1/2]

template<typename T >
template<typename Idx >
std::enable_if_t<std::is_integral<Idx>::value, reference> gem5::CircularQueue< T >::iterator::operator[] ( const Idx &  index)
inline

Index operator.

The use of * tests for dereferenceability.

Definition at line 352 of file circular_queue.hh.

References gem5::MipsISA::index.

◆ operator[]() [2/2]

template<typename T >
template<typename Idx >
std::enable_if_t<std::is_integral<Idx>::value, reference> gem5::CircularQueue< T >::operator[] ( const Idx &  index)
inline

Definition at line 395 of file circular_queue.hh.

◆ pop_back()

template<typename T >
void gem5::CircularQueue< T >::pop_back ( )
inline

Circularly decrease the tail pointer.

Definition at line 490 of file circular_queue.hh.

Referenced by gem5::o3::LSQUnit::squash().

◆ pop_front()

template<typename T >
void gem5::CircularQueue< T >::pop_front ( size_t  num_elem = 1)
inline

Circularly increase the head pointer.

By increasing the head pointer we are removing elements from the begin of the circular queue.

@params num_elem number of elements to remove

Definition at line 477 of file circular_queue.hh.

Referenced by gem5::o3::LSQUnit::commitLoad(), gem5::o3::LSQUnit::completeStore(), and TEST().

◆ push_back()

template<typename T >
void gem5::CircularQueue< T >::push_back ( typename std::vector< T >::value_type  val)
inline

◆ Random() [1/2]

gem5::Random::Random ( )

Definition at line 51 of file random.cc.

References gem5::Random::init().

◆ random() [1/2]

template<typename T >
std::enable_if_t<std::is_integral<T>::value, T> gem5::Random::random ( )
inline

Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating point.

Definition at line 90 of file random.hh.

References gem5::statistics::dist, and gem5::Random::gen.

Referenced by gem5::branch_prediction::MPP_TAGE::adjustAlloc(), gem5::branch_prediction::TAGE_SC_L_TAGE::adjustAlloc(), gem5::RiscvProcess::argsInit(), gem5::branch_prediction::TAGE_SC_L_TAGE::calcDep(), gem5::Check::Check(), gem5::Linux::devRandom(), gem5::GarnetSyntheticTraffic::generatePkt(), gem5::NvmGen::genStartAddr(), gem5::DramGen::genStartAddr(), gem5::HybridGen::genStartAddr(), gem5::memory::SimpleMemory::getLatency(), gem5::memory::CfiMemory::getLatency(), gem5::RandomGen::getNextPacket(), gem5::LinearGen::getNextPacket(), gem5::NvmGen::getNextPacket(), gem5::DramGen::getNextPacket(), gem5::StridedGen::getNextPacket(), gem5::HybridGen::getNextPacket(), gem5::CheckTable::getRandomCheck(), gem5::replacement_policy::Random::getVictim(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), gem5::branch_prediction::MPP_TAGE::handleAllocAndUReset(), gem5::SeriesRequestGenerator::initiate(), gem5::Check::initiate(), gem5::Check::initiateAction(), gem5::Check::initiateCheck(), gem5::Check::initiateFlush(), gem5::Check::initiatePrefetch(), gem5::SimpleCache::insert(), gem5::branch_prediction::LoopPredictor::loopUpdate(), gem5::RandomGen::nextPacketTick(), gem5::LinearGen::nextPacketTick(), gem5::StridedGen::nextPacketTick(), gem5::HybridGen::nextPacketTick(), gem5::TrafficGen::nextState(), gem5::ruby::PerfectSwitch::operateMessageBuffer(), gem5::branch_prediction::MPP_LoopPredictor::optionalAgeInc(), gem5::branch_prediction::TAGE_SC_L_LoopPredictor::optionalAgeInc(), gem5::SMMUTLB::pickEntryIdxToReplace(), gem5::ARMArchTLB::pickEntryIdxToReplace(), gem5::IPACache::pickEntryIdxToReplace(), gem5::ConfigCache::pickEntryIdxToReplace(), gem5::WalkCache::pickEntryIdxToReplace(), gem5::Check::pickInitiatingNode(), gem5::Check::pickValue(), gem5::ruby::random_time(), gem5::RandomStreamGen::randomPick(), gem5::replacement_policy::BIP::reset(), gem5::replacement_policy::BRRIP::reset(), gem5::EtherSwitch::Interface::switchingDelay(), gem5::GarnetSyntheticTraffic::tick(), gem5::MemTest::tick(), gem5::o3::Fetch::tick(), gem5::branch_prediction::MultiperspectivePerceptron::train(), gem5::EtherLink::Link::transmit(), gem5::DistEtherLink::TxLink::transmit(), gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::TAGE::update(), gem5::branch_prediction::TAGE_SC_L::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), and gem5::branch_prediction::MultiperspectivePerceptron::update().

◆ random() [2/2]

template<typename T >
std::enable_if_t<std::is_integral<T>::value, T> gem5::Random::random ( min,
max 
)
inline

Definition at line 113 of file random.hh.

References gem5::statistics::dist, and gem5::Random::gen.

◆ Random() [2/2]

gem5::Random::Random ( uint32_t  s)

Definition at line 57 of file random.cc.

References gem5::Random::init(), and gem5::ArmISA::s.

◆ remove() [1/2]

template<class Key , class Value >
Value* gem5::Trie< Key, Value >::remove ( Handle  handle)
inline

Method to delete a value from the trie.

Parameters
nodeA Handle to remove.
Returns
The Value pointer from the removed entry.

Definition at line 318 of file trie.hh.

Referenced by gem5::X86ISA::TLB::demapPage(), gem5::X86ISA::TLB::flushAll(), gem5::X86ISA::TLB::flushNonGlobal(), and gem5::Trie< Addr, TlbEntry >::remove().

◆ remove() [2/2]

template<class Key , class Value >
Value* gem5::Trie< Key, Value >::remove ( Key  key)
inline

Method to lookup a value from the trie and then delete it.

Parameters
keyThe key to look up and then remove.
Returns
The Value pointer from the removed entry, if any.

Definition at line 364 of file trie.hh.

◆ roundDown()

template<class T , class U >
static constexpr T gem5::roundDown ( const T &  val,
const U &  align 
)
staticconstexpr

This function is used to align addresses in memory.

Parameters
valis the address to be aligned.
alignis the alignment. Can only be a power of 2.
Returns
The aligned address. The biggest number divisible by
Parameters
alignwhich is less than or equal to
val.

Definition at line 279 of file intmath.hh.

References sc_dt::align(), gem5::isPowerOf2(), gem5::mask(), and gem5::X86ISA::val.

Referenced by gem5::AtomicSimpleCPU::amoMem(), gem5::MipsProcess::argsInit(), gem5::PowerProcess::argsInit(), gem5::RiscvProcess::argsInit(), gem5::SparcProcess::argsInit(), gem5::X86ISA::X86Process::argsInit(), gem5::ArmProcess::argsInit(), gem5::TLBCoalescer::canCoalesce(), gem5::FetchUnit::FetchBufDesc::checkWaveReleaseBuf(), gem5::Shader::doFunctionalAccess(), gem5::SETranslatingPortProxy::fixupAddr(), gem5::MemState::fixupFault(), gem5::X86ISA::GpuTLB::handleFuncTranslationReturn(), gem5::StackDistProbe::handleRequest(), gem5::TimingSimpleCPU::initiateMemAMO(), gem5::TimingSimpleCPU::initiateMemRead(), gem5::initMemReqHelper(), gem5::initMemReqScalarHelper(), gem5::X86ISA::GpuTLB::issueTLBLookup(), gem5::BaseCPU::mwaitAtomic(), gem5::prefetch::Base::pageAddress(), gem5::TLBCoalescer::processProbeTLBEvent(), gem5::TLBCoalescer::CpuSidePort::recvFunctional(), gem5::X86ISA::GpuTLB::CpuSidePort::recvFunctional(), gem5::X86ISA::GpuTLB::MemSidePort::recvTimingResp(), gem5::ComputeUnit::DTLBPort::recvTimingResp(), gem5::prefetch::Base::samePage(), TEST(), gem5::ComputeUnit::updatePageDivergenceDist(), gem5::TLBCoalescer::updatePhysAddresses(), and gem5::TimingSimpleCPU::writeMem().

◆ roundUp()

template<class T , class U >
static constexpr T gem5::roundUp ( const T &  val,
const U &  align 
)
staticconstexpr

◆ size()

template<typename T >
size_t gem5::CircularQueue< T >::size ( ) const
inline

◆ tail()

template<typename T >
size_t gem5::CircularQueue< T >::tail ( ) const
inline

◆ Trie()

template<class Key , class Value >
gem5::Trie< Key, Value >::Trie ( )
inline

Definition at line 130 of file trie.hh.

Variable Documentation

◆ compileDate

const char * gem5::compileDate = __DATE__ " " __TIME__

Definition at line 35 of file date.cc.

Referenced by gem5::pybind_init_core().

◆ gem5Version

const char * gem5::gem5Version = "21.1.0.2"

Definition at line 35 of file version.cc.

Referenced by gem5::pybind_init_core().

◆ gen

std::mt19937_64 gem5::Random::gen

◆ MaxBits

template<class Key , class Value >
const unsigned gem5::Trie< Key, Value >::MaxBits = sizeof(Key) * 8
static

◆ random_mt

Random gem5::random_mt

Definition at line 99 of file random.cc.

Referenced by gem5::branch_prediction::MPP_TAGE::adjustAlloc(), gem5::branch_prediction::TAGE_SC_L_TAGE::adjustAlloc(), gem5::RiscvProcess::argsInit(), gem5::branch_prediction::TAGE_SC_L_TAGE::calcDep(), gem5::Check::Check(), gem5::GarnetSyntheticTraffic::generatePkt(), gem5::DramGen::genStartAddr(), gem5::NvmGen::genStartAddr(), gem5::HybridGen::genStartAddr(), gem5::memory::SimpleMemory::getLatency(), gem5::memory::CfiMemory::getLatency(), gem5::RandomGen::getNextPacket(), gem5::LinearGen::getNextPacket(), gem5::NvmGen::getNextPacket(), gem5::DramGen::getNextPacket(), gem5::StridedGen::getNextPacket(), gem5::HybridGen::getNextPacket(), gem5::CheckTable::getRandomCheck(), gem5::replacement_policy::Random::getVictim(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), gem5::branch_prediction::MPP_TAGE::handleAllocAndUReset(), gem5::DistIface::init(), gem5::SeriesRequestGenerator::initiate(), gem5::Check::initiate(), gem5::Check::initiateAction(), gem5::Check::initiateCheck(), gem5::Check::initiateFlush(), gem5::Check::initiatePrefetch(), gem5::SimpleCache::insert(), gem5::branch_prediction::LoopPredictor::loopUpdate(), gem5::RandomGen::nextPacketTick(), gem5::LinearGen::nextPacketTick(), gem5::StridedGen::nextPacketTick(), gem5::HybridGen::nextPacketTick(), gem5::TrafficGen::nextState(), gem5::ruby::PerfectSwitch::operateMessageBuffer(), gem5::branch_prediction::MPP_LoopPredictor::optionalAgeInc(), gem5::branch_prediction::TAGE_SC_L_LoopPredictor::optionalAgeInc(), gem5::Check::pickInitiatingNode(), gem5::Check::pickValue(), gem5::pybind_init_core(), gem5::ruby::random_time(), gem5::RandomStreamGen::randomPick(), gem5::MinorCPU::randomPriority(), gem5::replacement_policy::BIP::reset(), gem5::replacement_policy::BRRIP::reset(), gem5::EtherSwitch::Interface::switchingDelay(), gem5::GarnetSyntheticTraffic::tick(), gem5::MemTest::tick(), gem5::o3::Fetch::tick(), gem5::branch_prediction::MultiperspectivePerceptron::train(), gem5::EtherLink::Link::transmit(), gem5::DistEtherLink::TxLink::transmit(), gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::TAGE::update(), gem5::branch_prediction::TAGE_SC_L::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), and gem5::branch_prediction::MultiperspectivePerceptron::update().

Friends

◆ operator+

template<typename T >
iterator operator+ ( const difference_type t,
iterator it 
)
friend

Definition at line 304 of file circular_queue.hh.

◆ operator-

template<typename T >
iterator operator- ( const difference_type t,
iterator it 
)
friend

Definition at line 326 of file circular_queue.hh.


Generated on Tue Sep 21 2021 12:27:01 for gem5 by doxygen 1.8.17