gem5 v24.0.0.0
Loading...
Searching...
No Matches
The utility functions and constants API.

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&.
 
iteratorgem5::CircularQueue< T >::iterator::operator= (const iterator &it)
 
bool gem5::CircularQueue< T >::iterator::dereferenceable () const
 Test dereferenceability.
 
bool gem5::CircularQueue< T >::iterator::operator== (const iterator &that) const
 InputIterator.
 
bool gem5::CircularQueue< T >::iterator::operator!= (const iterator &that)
 Inequality operator.
 
reference gem5::CircularQueue< T >::iterator::operator* ()
 Dereference operator.
 
const_reference gem5::CircularQueue< T >::iterator::operator* () const
 
pointer gem5::CircularQueue< T >::iterator::operator-> ()
 Dereference operator.
 
const_pointer gem5::CircularQueue< T >::iterator::operator-> () const
 
iteratorgem5::CircularQueue< T >::iterator::operator++ ()
 Pre-increment operator.
 
iterator gem5::CircularQueue< T >::iterator::operator++ (int)
 Post-increment operator.
 
iteratorgem5::CircularQueue< T >::iterator::operator-- ()
 ForwardIterator The multipass guarantee is provided by the reliance on _idx.
 
iterator gem5::CircularQueue< T >::iterator::operator-- (int)
 Post-decrement operator.
 
iteratorgem5::CircularQueue< T >::iterator::operator+= (const difference_type &t)
 RandomAccessIterator requirements.
 
iteratorgem5::CircularQueue< T >::iterator::operator-= (const difference_type &t)
 
iterator gem5::CircularQueue< T >::iterator::operator+ (const difference_type &t)
 Addition operator.
 
iterator gem5::CircularQueue< T >::iterator::operator- (const difference_type &t)
 Substraction operator.
 
difference_type gem5::CircularQueue< T >::iterator::operator- (const iterator &that)
 Difference operator.
 
template<typename Idx >
std::enable_if_t< std::is_integral_v< Idx >, referencegem5::CircularQueue< T >::iterator::operator[] (const Idx &index)
 Index operator.
 
bool gem5::CircularQueue< T >::iterator::operator< (const iterator &that) const
 Comparisons.
 
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_v< Idx >, 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.
 
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.
 
void gem5::CircularQueue< T >::pop_back ()
 Circularly decrease the tail pointer.
 
void gem5::CircularQueue< T >::push_back (typename std::vector< T >::value_type val)
 Pushes an element at the end of the queue.
 
void gem5::CircularQueue< T >::advance_tail ()
 Increases the tail by one.
 
void gem5::CircularQueue< T >::advance_tail (size_t len)
 Increases the tail by a specified number of steps.
 
bool gem5::CircularQueue< T >::empty () const
 Is the queue empty?
 
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.
 
iterator gem5::CircularQueue< T >::begin ()
 Iterators.
 
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.
 
static bool gem5::findOverflow (int width, uint64_t dest, uint64_t src1, uint64_t src2)
 Calculate the overflow flag from an addition.
 
static bool gem5::findParity (int width, uint64_t dest)
 Calculate the parity of a value.
 
static bool gem5::findNegative (int width, uint64_t dest)
 Calculate the negative flag.
 
static bool gem5::findZero (int width, uint64_t dest)
 Calculate the zero flag.
 
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.
 
template<class T >
static constexpr std::enable_if_t< std::is_integral_v< T >, 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(uint32_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(uint32_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.
 
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.
 
static constexpr int gem5::log2i (int value)
 Calculate the log2 of a power of 2 integer.
 
template<typename T >
std::enable_if_t< std::is_integral_v< T >, T > gem5::Random::random ()
 Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating point.
 
template<typename T >
std::enable_if_t< std::is_integral_v< T >, T > gem5::Random::random (T min, T max)
 
 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.
 
Valuegem5::Trie< Key, Value >::lookup (Key key)
 Method which looks up the Value corresponding to a particular key.
 
Valuegem5::Trie< Key, Value >::remove (Handle handle)
 Method to delete a value from the trie.
 
Valuegem5::Trie< Key, Value >::remove (Key key)
 Method to lookup a value from the trie and then delete it.
 
void gem5::Trie< Key, Value >::clear ()
 A method which removes all key/value pairs from the trie.
 

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 = "24.0.0.0"
 

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.
 
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 116 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.

References gem5::CircularQueue< T >::_head, gem5::CircularQueue< T >::_size, and gem5::CircularQueue< T >::full().

Referenced by gem5::o3::LSQUnit::insertLoad(), gem5::o3::LSQUnit::insertStore(), and gem5::CircularQueue< T >::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.

References gem5::CircularQueue< T >::_capacity, gem5::CircularQueue< T >::_head, gem5::CircularQueue< T >::_size, and gem5::ArmISA::len.

◆ back()

◆ begin() [1/2]

◆ begin() [2/2]

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

Definition at line 572 of file circular_queue.hh.

References gem5::CircularQueue< T >::_head.

◆ capacity()

◆ ceilLog2()

◆ 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 368 of file trie.hh.

References gem5::Trie< Key, Value >::Node::clear(), and gem5::Trie< Key, Value >::head.

◆ 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, 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::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::memory::HBMCtrl::recvTimingReq(), gem5::memory::HeteroMemCtrl::recvTimingReq(), gem5::memory::MemCtrl::recvTimingReq(), gem5::memory::qos::MemSinkCtrl::recvTimingReq(), gem5::SerialLink::SerialLinkResponsePort::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::SerialLinkRequestPort::trySendTiming(), gem5::SerialLink::SerialLinkResponsePort::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]

◆ end() [2/2]

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

Definition at line 586 of file circular_queue.hh.

References gem5::CircularQueue< T >::tail().

◆ 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(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), 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(), TEST(), 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(), TEST(), TEST(), 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::ArmISA::mask, and gem5::ArmISA::width.

Referenced by gem5::X86ISA::RegOpBase::genFlags(), TEST(), TEST(), TEST(), 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::ArmISA::mask, and gem5::ArmISA::width.

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

◆ floorLog2()

◆ 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.

References gem5::CircularQueue< T >::_head, and gem5::CircularQueue< T >::_size.

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

◆ front()

◆ 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.

References gem5::CircularQueue< T >::_capacity, and gem5::CircularQueue< T >::_size.

Referenced by gem5::CircularQueue< T >::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()

◆ 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 204 of file trie.hh.

References gem5::Trie< Key, Value >::extendMask(), gem5::Trie< Key, Value >::goesAfter(), gem5::Trie< Key, Value >::head, gem5::ArmISA::i, gem5::Trie< Key, Value >::Node::kids, gem5::Trie< Key, Value >::Node::mask, gem5::Trie< Key, Value >::MaxBits, panic, gem5::Trie< Key, Value >::Node::parent, gem5::X86ISA::val, gem5::Trie< Key, Value >::Node::value, and gem5::ArmISA::width.

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

◆ isPowerOf2()

◆ 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(), and 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 291 of file trie.hh.

References gem5::Trie< Key, Value >::lookupHandle(), and gem5::Trie< Key, Value >::Node::value.

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

◆ mulSigned()

template<typename T >
static constexpr std::enable_if_t< sizeof(T)<=sizeof(uint32_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 133 of file intmath.hh.

Referenced by gem5::mulSigned(), TEST(), TEST(), and TEST().

◆ mulUnsigned()

template<typename T >
static constexpr std::enable_if_t< sizeof(T)<=sizeof(uint32_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 120 of file intmath.hh.

Referenced by gem5::mulSignedManual(), gem5::mulUnsigned(), TEST(), TEST(), and TEST().

◆ 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 362 of file circular_queue.hh.

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

◆ 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_v< Idx >, 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_v< Idx >, reference > gem5::CircularQueue< T >::operator[] ( const Idx & index)
inline

◆ 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.

References gem5::CircularQueue< T >::_size, and gem5::CircularQueue< T >::empty().

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.

References gem5::CircularQueue< T >::_head, gem5::CircularQueue< T >::_size, and gem5::CircularQueue< T >::size().

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

◆ push_back()

◆ Random() [1/2]

gem5::Random::Random ( )

Definition at line 51 of file random.cc.

References gem5::statistics::init.

◆ Random() [2/2]

gem5::Random::Random ( uint32_t s)

Definition at line 57 of file random.cc.

References gem5::statistics::init, and gem5::ArmISA::s.

◆ random() [1/2]

template<typename T >
std::enable_if_t< std::is_integral_v< T >, 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::AddressManager::AddressManager(), 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::GUPSGen::createNextReq(), gem5::SpatterAccess::createPacket(), gem5::Linux::devRandom(), gem5::GarnetSyntheticTraffic::generatePkt(), gem5::DramGen::genStartAddr(), gem5::HybridGen::genStartAddr(), gem5::NvmGen::genStartAddr(), gem5::AddressManager::getAtomicLoc(), gem5::memory::CfiMemory::getLatency(), gem5::memory::SimpleMemory::getLatency(), gem5::AddressManager::AtomicStruct::getLoadLoc(), gem5::DramGen::getNextPacket(), gem5::HybridGen::getNextPacket(), gem5::LinearGen::getNextPacket(), gem5::NvmGen::getNextPacket(), gem5::RandomGen::getNextPacket(), gem5::StridedGen::getNextPacket(), gem5::CheckTable::getRandomCheck(), gem5::getrandomFunc(), gem5::AddressManager::AtomicStruct::getStoreLoc(), gem5::replacement_policy::Random::getVictim(), gem5::branch_prediction::MPP_TAGE::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), gem5::Episode::initActions(), gem5::Check::initiate(), gem5::SeriesRequestGenerator::initiate(), gem5::Check::initiateAction(), gem5::Check::initiateCheck(), gem5::Check::initiateFlush(), gem5::Check::initiatePrefetch(), gem5::SimpleCache::insert(), gem5::TesterThread::issueNewEpisode(), gem5::branch_prediction::LoopPredictor::loopUpdate(), gem5::HybridGen::nextPacketTick(), gem5::LinearGen::nextPacketTick(), gem5::RandomGen::nextPacketTick(), gem5::StridedGen::nextPacketTick(), gem5::TrafficGen::nextState(), gem5::branch_prediction::MPP_LoopPredictor::optionalAgeInc(), gem5::branch_prediction::TAGE_SC_L_LoopPredictor::optionalAgeInc(), gem5::ARMArchTLB::pickEntryIdxToReplace(), gem5::ConfigCache::pickEntryIdxToReplace(), gem5::IPACache::pickEntryIdxToReplace(), gem5::SMMUTLB::pickEntryIdxToReplace(), gem5::WalkCache::pickEntryIdxToReplace(), gem5::Check::pickInitiatingNode(), gem5::Check::pickValue(), gem5::ruby::random_time(), gem5::RandomStreamGen::randomPick(), gem5::ArmISA::ISA::readMiscReg(), gem5::replacement_policy::BIP::reset(), gem5::replacement_policy::BRRIP::reset(), gem5::ruby::WeightBased::route(), gem5::EtherSwitch::Interface::switchingDelay(), gem5::GarnetSyntheticTraffic::tick(), gem5::MemTest::tick(), gem5::o3::Fetch::tick(), gem5::branch_prediction::MultiperspectivePerceptron::train(), gem5::DistEtherLink::TxLink::transmit(), gem5::EtherLink::Link::transmit(), gem5::VirtIORng::RngQueue::trySend(), gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::MultiperspectivePerceptron::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), gem5::branch_prediction::TAGE::update(), and gem5::branch_prediction::TAGE_SC_L::update().

◆ random() [2/2]

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

Definition at line 113 of file random.hh.

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

◆ remove() [1/2]

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

◆ 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 353 of file trie.hh.

References gem5::Trie< Key, Value >::lookupHandle(), and gem5::Trie< Key, Value >::remove().

◆ 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 gem5::isPowerOf2(), gem5::ArmISA::mask, and gem5::X86ISA::val.

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

◆ roundUp()

template<class T , class U >
static constexpr T gem5::roundUp ( 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 smallest number divisible by
Parameters
alignwhich is greater than or equal to
val.

Definition at line 260 of file intmath.hh.

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

Referenced by gem5::ArmProcess::argsInit(), gem5::MipsProcess::argsInit(), gem5::PowerProcess::argsInit(), gem5::RiscvProcess::argsInit(), gem5::SparcProcess::argsInit(), gem5::X86ISA::X86Process::argsInit(), gem5::ArmProcess32::ArmProcess32(), gem5::ArmProcess64::ArmProcess64(), gem5::ChunkGenerator::ChunkGenerator(), gem5::memory::PhysicalMemory::createBackingStore(), gem5::guest_abi::Argument< Aapcs32, Composite, typename std::enable_if_t< IsAapcs32CompositeV< Composite > > >::get(), gem5::X86ISA::I386Process::I386Process(), gem5::X86ISA::FsWorkload::initState(), gem5::guest_abi::Aapcs32ArgumentBase::loadFromStack(), gem5::guest_abi::Aapcs64ArgumentBase::loadFromStack(), gem5::MipsProcess::MipsProcess(), gem5::Shader::mmap(), gem5::mmapFunc(), gem5::mremapFunc(), gem5::munmapFunc(), gem5::o3::DynInst::operator new(), gem5::PowerProcess::PowerProcess(), gem5::RiscvProcess32::RiscvProcess32(), gem5::RiscvProcess64::RiscvProcess64(), gem5::ChunkGenerator::setNext(), gem5::Sparc32Process::Sparc32Process(), gem5::Sparc64Process::Sparc64Process(), TEST(), gem5::AMDGPUVM::AGPTranslationGen::translate(), gem5::AMDGPUVM::GARTTranslationGen::translate(), gem5::AMDGPUVM::MMHUBTranslationGen::translate(), gem5::AMDGPUVM::UserTranslationGen::translate(), gem5::BaseMMU::MMUTranslationGen::translate(), gem5::EmulationPageTable::PageTableTranslationGen::translate(), gem5::Process::updateBias(), gem5::MemState::updateBrkRegion(), and gem5::X86ISA::X86_64Process::X86_64Process().

◆ size()

◆ tail()

◆ Trie()

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

Definition at line 121 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 = "24.0.0.0"

Definition at line 35 of file version.cc.

Referenced by gem5::pybind_init_core().

◆ 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::AddressManager::AddressManager(), 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::GUPSGen::createNextReq(), gem5::SpatterAccess::createPacket(), gem5::GarnetSyntheticTraffic::generatePkt(), gem5::DramGen::genStartAddr(), gem5::HybridGen::genStartAddr(), gem5::NvmGen::genStartAddr(), gem5::AddressManager::getAtomicLoc(), gem5::memory::CfiMemory::getLatency(), gem5::memory::SimpleMemory::getLatency(), gem5::AddressManager::AtomicStruct::getLoadLoc(), gem5::DramGen::getNextPacket(), gem5::HybridGen::getNextPacket(), gem5::LinearGen::getNextPacket(), gem5::NvmGen::getNextPacket(), gem5::RandomGen::getNextPacket(), gem5::StridedGen::getNextPacket(), gem5::CheckTable::getRandomCheck(), gem5::getrandomFunc(), gem5::AddressManager::AtomicStruct::getStoreLoc(), gem5::replacement_policy::Random::getVictim(), gem5::branch_prediction::MPP_TAGE::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), gem5::DistIface::init(), gem5::Episode::initActions(), gem5::Check::initiate(), gem5::SeriesRequestGenerator::initiate(), gem5::Check::initiateAction(), gem5::Check::initiateCheck(), gem5::Check::initiateFlush(), gem5::Check::initiatePrefetch(), gem5::SimpleCache::insert(), gem5::TesterThread::issueNewEpisode(), gem5::branch_prediction::LoopPredictor::loopUpdate(), gem5::HybridGen::nextPacketTick(), gem5::LinearGen::nextPacketTick(), gem5::RandomGen::nextPacketTick(), gem5::StridedGen::nextPacketTick(), gem5::TrafficGen::nextState(), gem5::branch_prediction::MPP_LoopPredictor::optionalAgeInc(), gem5::branch_prediction::TAGE_SC_L_LoopPredictor::optionalAgeInc(), gem5::Check::pickInitiatingNode(), gem5::Check::pickValue(), gem5::ProtocolTester::ProtocolTester(), gem5::pybind_init_core(), gem5::ruby::random_time(), gem5::RandomStreamGen::randomPick(), gem5::MinorCPU::randomPriority(), gem5::ArmISA::ISA::readMiscReg(), gem5::replacement_policy::BIP::reset(), gem5::replacement_policy::BRRIP::reset(), gem5::ruby::WeightBased::route(), gem5::EtherSwitch::Interface::switchingDelay(), gem5::GarnetSyntheticTraffic::tick(), gem5::MemTest::tick(), gem5::o3::Fetch::tick(), gem5::branch_prediction::MultiperspectivePerceptron::train(), gem5::DistEtherLink::TxLink::transmit(), gem5::EtherLink::Link::transmit(), gem5::VirtIORng::RngQueue::trySend(), gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::MultiperspectivePerceptron::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), gem5::branch_prediction::TAGE::update(), and gem5::branch_prediction::TAGE_SC_L::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 Jun 18 2024 16:24:09 for gem5 by doxygen 1.11.0