gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Stats::SparseHistBase< Derived, Stor > Class Template Reference

Implementation of a sparse histogram stat. More...

#include <statistics.hh>

Inheritance diagram for Stats::SparseHistBase< Derived, Stor >:
Stats::DataWrap< Derived, SparseHistInfoProxy > Stats::InfoAccess

Public Types

typedef SparseHistInfoProxy< Derived > Info
 
typedef Stor Storage
 
typedef Stor::Params Params
 
- Public Types inherited from Stats::DataWrap< Derived, SparseHistInfoProxy >
typedef SparseHistInfoProxy< Derived > Info
 

Public Member Functions

 SparseHistBase (Group *parent, const char *name, const char *desc)
 
template<typename U >
void sample (const U &v, int n=1)
 Add a value to the distribtion n times. More...
 
size_type size () const
 Return the number of entries in this stat. More...
 
bool zero () const
 Return true if no samples have been added. More...
 
void prepare ()
 
void reset ()
 Reset stat value to default. More...
 
- Public Member Functions inherited from Stats::DataWrap< Derived, SparseHistInfoProxy >
const Infoinfo () const
 
 DataWrap ()=delete
 
 DataWrap (const DataWrap &)=delete
 
 DataWrap (Group *parent, const char *name, const char *desc)
 
DataWrapoperator= (const DataWrap &)=delete
 
Derived & name (const std::string &name)
 Set the name and marks this stat to print at the end of simulation. More...
 
const std::string & name () const
 
Derived & setSeparator (const std::string &_sep)
 Set the character(s) used between the name and vector number on vectors, dist, etc. More...
 
const std::string & setSeparator () const
 
Derived & desc (const std::string &_desc)
 Set the description and marks this stat to print at the end of simulation. More...
 
Derived & precision (int _precision)
 Set the precision and marks this stat to print at the end of simulation. More...
 
Derived & flags (Flags _flags)
 Set the flags and marks this stat to print at the end of simulation. More...
 
Derived & prereq (const Stat &prereq)
 Set the prerequisite stat and marks this stat to print at the end of simulation. More...
 
- Public Member Functions inherited from Stats::InfoAccess
 InfoAccess ()
 
void reset ()
 Reset the stat to the default state. More...
 
bool zero () const
 
bool check () const
 Check that this stat has been set up properly and is ready for use. More...
 

Protected Member Functions

Storagedata ()
 Retrieve the storage. More...
 
const Storagedata () const
 Retrieve a const pointer to the storage. More...
 
void doInit ()
 
- Protected Member Functions inherited from Stats::DataWrap< Derived, SparseHistInfoProxy >
Derived & self ()
 
Infoinfo ()
 
- Protected Member Functions inherited from Stats::InfoAccess
void setInfo (Group *parent, Info *info)
 Set up an info class for this statistic. More...
 
void setParams (const StorageParams *params)
 Save Storage class parameters if any. More...
 
void setInit ()
 Save Storage class parameters if any. More...
 
Infoinfo ()
 Grab the information class for this statistic. More...
 
const Infoinfo () const
 Grab the information class for this statistic. More...
 

Protected Attributes

char storage [sizeof(Storage)]
 The storage for this stat. More...
 

Detailed Description

template<class Derived, class Stor>
class Stats::SparseHistBase< Derived, Stor >

Implementation of a sparse histogram stat.

The storage class is determined by the Storage template.

Definition at line 2822 of file statistics.hh.

Member Typedef Documentation

◆ Info

template<class Derived, class Stor>
typedef SparseHistInfoProxy<Derived> Stats::SparseHistBase< Derived, Stor >::Info

Definition at line 2825 of file statistics.hh.

◆ Params

template<class Derived, class Stor>
typedef Stor::Params Stats::SparseHistBase< Derived, Stor >::Params

Definition at line 2827 of file statistics.hh.

◆ Storage

template<class Derived, class Stor>
typedef Stor Stats::SparseHistBase< Derived, Stor >::Storage

Definition at line 2826 of file statistics.hh.

Constructor & Destructor Documentation

◆ SparseHistBase()

template<class Derived, class Stor>
Stats::SparseHistBase< Derived, Stor >::SparseHistBase ( Group parent,
const char *  name,
const char *  desc 
)
inline

Definition at line 2862 of file statistics.hh.

Member Function Documentation

◆ data() [1/2]

template<class Derived, class Stor>
Storage* Stats::SparseHistBase< Derived, Stor >::data ( )
inlineprotected

Retrieve the storage.

Returns
The storage object for this stat.

Definition at line 2839 of file statistics.hh.

◆ data() [2/2]

template<class Derived, class Stor>
const Storage* Stats::SparseHistBase< Derived, Stor >::data ( ) const
inlineprotected

Retrieve a const pointer to the storage.

Returns
A const pointer to the storage object for this stat.

Definition at line 2849 of file statistics.hh.

◆ doInit()

template<class Derived, class Stor>
void Stats::SparseHistBase< Derived, Stor >::doInit ( )
inlineprotected

Definition at line 2855 of file statistics.hh.

◆ prepare()

template<class Derived, class Stor>
void Stats::SparseHistBase< Derived, Stor >::prepare ( )
inline

Definition at line 2888 of file statistics.hh.

◆ reset()

template<class Derived, class Stor>
void Stats::SparseHistBase< Derived, Stor >::reset ( )
inline

Reset stat value to default.

Definition at line 2898 of file statistics.hh.

◆ sample()

template<class Derived, class Stor>
template<typename U >
void Stats::SparseHistBase< Derived, Stor >::sample ( const U &  v,
int  n = 1 
)
inline

Add a value to the distribtion n times.

Calls sample on the storage class.

Parameters
vThe value to add.
nThe number of times to add it, defaults to 1.

Definition at line 2874 of file statistics.hh.

Referenced by StackDistProbe::handleRequest(), and CommMonitor::MonitorStats::updateReqStats().

◆ size()

template<class Derived, class Stor>
size_type Stats::SparseHistBase< Derived, Stor >::size ( ) const
inline

Return the number of entries in this stat.

Returns
The number of entries.

Definition at line 2880 of file statistics.hh.

◆ zero()

template<class Derived, class Stor>
bool Stats::SparseHistBase< Derived, Stor >::zero ( ) const
inline

Return true if no samples have been added.

Returns
True if there haven't been any samples.

Definition at line 2885 of file statistics.hh.

Member Data Documentation

◆ storage

template<class Derived, class Stor>
char Stats::SparseHistBase< Derived, Stor >::storage[sizeof(Storage)]
protected

The storage for this stat.

Definition at line 2831 of file statistics.hh.


The documentation for this class was generated from the following file:

Generated on Mon Jun 8 2020 15:46:04 for gem5 by doxygen 1.8.13