gem5  v21.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  CircularQueue< T >
 Circular queue. More...
 
class  Trie< Key, Value >
 A trie is a tree-based data structure used for data retrieval. More...
 

Typedefs

typedef NodeTrie< Key, Value >::Handle
 

Functions

 CircularQueue< T >::iterator::iterator (CircularQueue *cq, size_t idx)
 
 CircularQueue< T >::iterator::iterator (const iterator &it)
 Trait reference type iterator satisfies OutputIterator, therefore reference must be T&. More...
 
iteratorCircularQueue< T >::iterator::operator= (const iterator &it)
 
bool CircularQueue< T >::iterator::dereferenceable () const
 Test dereferenceability. More...
 
bool CircularQueue< T >::iterator::operator== (const iterator &that) const
 InputIterator. More...
 
bool CircularQueue< T >::iterator::operator!= (const iterator &that)
 Inequality operator. More...
 
reference CircularQueue< T >::iterator::operator* ()
 Dereference operator. More...
 
const_reference CircularQueue< T >::iterator::operator* () const
 
pointer CircularQueue< T >::iterator::operator-> ()
 Dereference operator. More...
 
const_pointer CircularQueue< T >::iterator::operator-> () const
 
iteratorCircularQueue< T >::iterator::operator++ ()
 Pre-increment operator. More...
 
iterator CircularQueue< T >::iterator::operator++ (int)
 Post-increment operator. More...
 
iteratorCircularQueue< T >::iterator::operator-- ()
 ForwardIterator The multipass guarantee is provided by the reliance on _idx. More...
 
iterator CircularQueue< T >::iterator::operator-- (int)
 Post-decrement operator. More...
 
iteratorCircularQueue< T >::iterator::operator+= (const difference_type &t)
 RandomAccessIterator requirements. More...
 
iteratorCircularQueue< T >::iterator::operator-= (const difference_type &t)
 
iterator CircularQueue< T >::iterator::operator+ (const difference_type &t)
 Addition operator. More...
 
iterator CircularQueue< T >::iterator::operator- (const difference_type &t)
 Substraction operator. More...
 
difference_type CircularQueue< T >::iterator::operator- (const iterator &that)
 Difference operator. More...
 
template<typename Idx >
std::enable_if_t< std::is_integral< Idx >::value, referenceCircularQueue< T >::iterator::operator[] (const Idx &index)
 Index operator. More...
 
bool CircularQueue< T >::iterator::operator< (const iterator &that) const
 Comparisons. More...
 
bool CircularQueue< T >::iterator::operator> (const iterator &that) const
 
bool CircularQueue< T >::iterator::operator>= (const iterator &that) const
 
bool CircularQueue< T >::iterator::operator<= (const iterator &that) const
 
template<typename Idx >
std::enable_if_t< std::is_integral< Idx >::value, referenceCircularQueue< T >::operator[] (const Idx &index)
 
 CircularQueue< T >::CircularQueue (size_t size=0)
 
void CircularQueue< T >::flush ()
 Remove all the elements in the queue. More...
 
reference CircularQueue< T >::front ()
 
reference CircularQueue< T >::back ()
 
size_t CircularQueue< T >::head () const
 
size_t CircularQueue< T >::tail () const
 
size_t CircularQueue< T >::capacity () const
 
size_t CircularQueue< T >::size () const
 
void CircularQueue< T >::pop_front (size_t num_elem=1)
 Circularly increase the head pointer. More...
 
void CircularQueue< T >::pop_back ()
 Circularly decrease the tail pointer. More...
 
void CircularQueue< T >::push_back (typename std::vector< T >::value_type val)
 Pushes an element at the end of the queue. More...
 
void CircularQueue< T >::advance_tail ()
 Increases the tail by one. More...
 
void CircularQueue< T >::advance_tail (size_t len)
 Increases the tail by a specified number of steps. More...
 
bool CircularQueue< T >::empty () const
 Is the queue empty? More...
 
bool 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 CircularQueue< T >::begin ()
 Iterators. More...
 
iterator CircularQueue< T >::begin () const
 
iterator CircularQueue< T >::end ()
 
iterator CircularQueue< T >::end () const
 
static bool findCarry (int width, uint64_t dest, uint64_t src1, uint64_t src2)
 Calculate the carry flag from an addition. More...
 
static bool findOverflow (int width, uint64_t dest, uint64_t src1, uint64_t src2)
 Calculate the overflow flag from an addition. More...
 
static bool findParity (int width, uint64_t dest)
 Calculate the parity of a value. More...
 
static bool findNegative (int width, uint64_t dest)
 Calculate the negative flag. More...
 
static bool findZero (int width, uint64_t dest)
 Calculate the zero flag. More...
 
template<uint32_t Poly>
uint32_t 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...
 
uint64_t power (uint32_t n, uint32_t e)
 
template<class T >
std::enable_if_t< std::is_integral< T >::value, int > floorLog2 (T x)
 
template<class T >
int ceilLog2 (const T &n)
 
template<class T >
bool isPowerOf2 (const T &n)
 
template<class T , class U >
divCeil (const T &a, const U &b)
 
template<class T , class U >
roundUp (const T &val, const U &align)
 This function is used to align addresses in memory. More...
 
template<class T , class U >
roundDown (const T &val, const U &align)
 This function is used to align addresses in memory. More...
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value, T > 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 > Random::random (T min, T max)
 
 m5::stl_helpers::ContainerPrint< T >::ContainerPrint (std::ostream &out)
 
void m5::stl_helpers::ContainerPrint< T >::operator() (const T &elem)
 
template<template< typename T, typename A > class C, typename T , typename A >
std::ostream & m5::stl_helpers::operator<< (std::ostream &out, const C< T, A > &vec)
 Write out all elements in an stl container as a space separated list enclosed in square brackets. More...
 
 Trie< Key, Value >::Trie ()
 
Handle Trie< Key, Value >::insert (Key key, unsigned width, Value *val)
 Method which inserts a key/value pair into the trie. More...
 
Value * Trie< Key, Value >::lookup (Key key)
 Method which looks up the Value corresponding to a particular key. More...
 
Value * Trie< Key, Value >::remove (Handle handle)
 Method to delete a value from the trie. More...
 
Value * Trie< Key, Value >::remove (Key key)
 Method to lookup a value from the trie and then delete it. More...
 
void Trie< Key, Value >::clear ()
 A method which removes all key/value pairs from the trie. More...
 

Variables

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

Friends

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

Definition at line 105 of file circular_queue.hh.

◆ const_reference

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

Definition at line 103 of file circular_queue.hh.

◆ difference_type

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

Definition at line 101 of file circular_queue.hh.

◆ Handle

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

Definition at line 122 of file trie.hh.

◆ iterator_category

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

Definition at line 106 of file circular_queue.hh.

◆ pointer

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

Definition at line 104 of file circular_queue.hh.

◆ reference

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

Definition at line 102 of file circular_queue.hh.

◆ value_type

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

Iterator Traits.

Definition at line 100 of file circular_queue.hh.

Function Documentation

◆ advance_tail() [1/2]

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

Increases the tail by one.

This may overwrite the head if the queue is full.

Definition at line 512 of file circular_queue.hh.

Referenced by LSQUnit< Impl >::insertLoad(), and CircularQueue< Prefetcher::STeMS::RegionMissOrderBufferEntry >::push_back().

◆ advance_tail() [2/2]

template<typename T >
void 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 529 of file circular_queue.hh.

◆ back()

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

◆ begin() [1/2]

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

Iterators.

Definition at line 562 of file circular_queue.hh.

Referenced by LSQUnit< Impl >::checkSnoop(), LSQUnit< Impl >::squash(), and TEST().

◆ begin() [2/2]

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

Definition at line 569 of file circular_queue.hh.

◆ capacity()

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

◆ ceilLog2()

template<class T >
int ceilLog2 ( const T &  n)
inline

◆ CircularQueue()

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

Definition at line 409 of file circular_queue.hh.

◆ clear()

template<class Key , class Value >
void 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 376 of file trie.hh.

◆ ContainerPrint()

template<class T >
m5::stl_helpers::ContainerPrint< T >::ContainerPrint ( std::ostream &  out)
inline

Definition at line 49 of file stl_helpers.hh.

◆ crc32()

template<uint32_t Poly>
uint32_t 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 59 of file crc.hh.

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

◆ dereferenceable()

template<typename T >
bool 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 140 of file circular_queue.hh.

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

Referenced by LSQUnit< Impl >::willWB(), and LSQUnit< Impl >::writebackStores().

◆ divCeil()

template<class T , class U >
T divCeil ( const T &  a,
const U &  b 
)
inline

◆ empty()

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

◆ end() [1/2]

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

◆ end() [2/2]

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

Definition at line 583 of file circular_queue.hh.

◆ findCarry()

static bool 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 81 of file condcodes.hh.

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

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

◆ findNegative()

static bool findNegative ( int  width,
uint64_t  dest 
)
inlinestatic

Calculate the negative flag.

Definition at line 138 of file condcodes.hh.

References bits(), and ArmISA::width.

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

◆ findOverflow()

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

Calculate the overflow flag from an addition.

Definition at line 95 of file condcodes.hh.

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

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

◆ findParity()

static bool 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 120 of file condcodes.hh.

References ArmISA::mask, and ArmISA::width.

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

◆ findZero()

static bool findZero ( int  width,
uint64_t  dest 
)
inlinestatic

Calculate the zero flag.

Definition at line 149 of file condcodes.hh.

References ArmISA::mask, and ArmISA::width.

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

◆ floorLog2()

template<class T >
std::enable_if_t<std::is_integral<T>::value, int> floorLog2 ( x)
inline

◆ flush()

template<typename T >
void 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 420 of file circular_queue.hh.

Referenced by Prefetcher::DeltaCorrelatingPredictionTables::DCPTEntry::invalidate().

◆ front()

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

◆ full()

template<typename T >
bool 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 555 of file circular_queue.hh.

Referenced by CircularQueue< Prefetcher::STeMS::RegionMissOrderBufferEntry >::advance_tail(), LSQUnit< Impl >::insertLoad(), Prefetcher::DeltaCorrelatingPredictionTables::DCPTEntry::invalidate(), LSQUnit< Impl >::lqFull(), Prefetcher::SBOOE::notifyFill(), and TEST().

◆ head()

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

◆ insert()

template<class Key , class Value >
Handle 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 210 of file trie.hh.

Referenced by RiscvISA::TLB::insert(), X86ISA::TLB::insert(), RiscvISA::TLB::unserialize(), and X86ISA::TLB::unserialize().

◆ isPowerOf2()

template<class T >
bool isPowerOf2 ( const T &  n)
inline

◆ iterator() [1/2]

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

Definition at line 91 of file circular_queue.hh.

◆ iterator() [2/2]

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

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

Definition at line 118 of file circular_queue.hh.

◆ lookup()

template<class Key , class Value >
Value* 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 298 of file trie.hh.

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

◆ operator!=()

template<typename T >
bool 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 167 of file circular_queue.hh.

◆ operator()()

template<class T >
void m5::stl_helpers::ContainerPrint< T >::operator() ( const T &  elem)
inline

◆ operator*() [1/2]

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

Dereference operator.

Definition at line 175 of file circular_queue.hh.

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

◆ operator*() [2/2]

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

◆ operator+()

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

Addition operator.

Definition at line 291 of file circular_queue.hh.

References ArmISA::t.

◆ operator++() [1/2]

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

Pre-increment operator.

Definition at line 210 of file circular_queue.hh.

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

◆ operator++() [2/2]

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

Post-increment operator.

Definition at line 222 of file circular_queue.hh.

References ArmISA::t.

◆ operator+=()

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

RandomAccessIterator requirements.

Definition at line 268 of file circular_queue.hh.

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

◆ operator-() [1/2]

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

Substraction operator.

Definition at line 313 of file circular_queue.hh.

References ArmISA::t.

◆ operator-() [2/2]

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

Difference operator.

that + ret == this

Definition at line 336 of file circular_queue.hh.

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

◆ operator--() [1/2]

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

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

BidirectionalIterator requirements. Pre-decrement operator.

Definition at line 241 of file circular_queue.hh.

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

◆ operator--() [2/2]

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

Post-decrement operator.

Definition at line 255 of file circular_queue.hh.

References ArmISA::t.

◆ operator-=()

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

◆ operator->() [1/2]

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

Dereference operator.

Rely on operator* to check for dereferenceability.

Definition at line 197 of file circular_queue.hh.

◆ operator->() [2/2]

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

Definition at line 202 of file circular_queue.hh.

◆ operator<()

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

Comparisons.

Definition at line 360 of file circular_queue.hh.

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

◆ operator<<()

template<template< typename T, typename A > class C, typename T , typename A >
std::ostream& m5::stl_helpers::operator<< ( std::ostream &  out,
const C< T, A > &  vec 
)

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

Definition at line 77 of file stl_helpers.hh.

◆ operator<=()

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

Definition at line 378 of file circular_queue.hh.

◆ operator=()

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

◆ operator==()

template<typename T >
bool 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 155 of file circular_queue.hh.

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

◆ operator>()

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

Definition at line 368 of file circular_queue.hh.

◆ operator>=()

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

Definition at line 373 of file circular_queue.hh.

◆ operator[]() [1/2]

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

Index operator.

The use of * tests for dereferenceability.

Definition at line 349 of file circular_queue.hh.

References MipsISA::index.

◆ operator[]() [2/2]

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

Definition at line 392 of file circular_queue.hh.

◆ pop_back()

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

Circularly decrease the tail pointer.

Definition at line 487 of file circular_queue.hh.

Referenced by LSQUnit< Impl >::squash().

◆ pop_front()

template<typename T >
void 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 474 of file circular_queue.hh.

Referenced by LSQUnit< Impl >::commitLoad(), and TEST().

◆ power()

uint64_t power ( uint32_t  n,
uint32_t  e 
)
inline

◆ push_back()

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

◆ Random() [1/2]

Random::Random ( )

Definition at line 48 of file random.cc.

References Random::init().

◆ random() [1/2]

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

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

Definition at line 86 of file random.hh.

References Stats::dist, and Random::gen.

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

◆ random() [2/2]

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

Definition at line 109 of file random.hh.

References Stats::dist, and Random::gen.

◆ Random() [2/2]

Random::Random ( uint32_t  s)

Definition at line 54 of file random.cc.

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

◆ remove() [1/2]

template<class Key , class Value >
Value* 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 315 of file trie.hh.

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

◆ remove() [2/2]

template<class Key , class Value >
Value* 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 361 of file trie.hh.

◆ roundDown()

template<class T , class U >
T roundDown ( const T &  val,
const U &  align 
)
inline

◆ roundUp()

template<class T , class U >
T roundUp ( const T &  val,
const U &  align 
)
inline

◆ size()

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

◆ tail()

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

◆ Trie()

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

Definition at line 127 of file trie.hh.

Variable Documentation

◆ compileDate

const char* compileDate = __DATE__ " " __TIME__

Definition at line 32 of file date.cc.

Referenced by pybind_init_core().

◆ gem5Version

const char* gem5Version = "21.0.0.0"

Definition at line 32 of file version.cc.

Referenced by pybind_init_core().

◆ MaxBits

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

Definition at line 133 of file trie.hh.

Referenced by Trie< Addr, TlbEntry >::extendMask(), and Trie< Addr, TlbEntry >::insert().

◆ random_mt

Random random_mt

Definition at line 96 of file random.cc.

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

Friends

◆ operator+

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

Definition at line 301 of file circular_queue.hh.

◆ operator-

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

Definition at line 323 of file circular_queue.hh.


Generated on Tue Mar 23 2021 19:41:32 for gem5 by doxygen 1.8.17