gem5  v21.1.0.2
Classes | Public Member Functions | Private Attributes | List of all members
gem5::statistics::AvgSampleStor Class Reference

Templatized storage for distribution that calculates per tick mean and variance. More...

#include <storage.hh>

Classes

struct  Params
 

Public Member Functions

 AvgSampleStor (const StorageParams *const storage_params)
 Create and initialize this storage. More...
 
void sample (Counter val, int number)
 Add a value to the distribution for the given number of times. More...
 
size_type size () const
 Return the number of entries, in this case 1. More...
 
bool zero () const
 Return true if no samples have been added. More...
 
void prepare (const StorageParams *const storage_params, DistData &data)
 
void reset (const StorageParams *const storage_params)
 Reset stat value to default. More...
 

Private Attributes

Counter sum
 Current total. More...
 
Counter squares
 Current sum of squares. More...
 

Detailed Description

Templatized storage for distribution that calculates per tick mean and variance.

Definition at line 638 of file storage.hh.

Constructor & Destructor Documentation

◆ AvgSampleStor()

gem5::statistics::AvgSampleStor::AvgSampleStor ( const StorageParams *const  storage_params)
inline

Create and initialize this storage.

Definition at line 655 of file storage.hh.

Member Function Documentation

◆ prepare()

void gem5::statistics::AvgSampleStor::prepare ( const StorageParams *const  storage_params,
DistData data 
)
inline

Definition at line 685 of file storage.hh.

References gem5::curTick(), data, gem5::statistics::Deviation, squares, sum, and gem5::statistics::DistParams::type.

Referenced by TEST().

◆ reset()

void gem5::statistics::AvgSampleStor::reset ( const StorageParams *const  storage_params)
inline

Reset stat value to default.

Definition at line 700 of file storage.hh.

References squares, and sum.

Referenced by TEST().

◆ sample()

void gem5::statistics::AvgSampleStor::sample ( Counter  val,
int  number 
)
inline

Add a value to the distribution for the given number of times.

Update the running sum and sum of squares.

Parameters
valThe value to add.
numberThe number of times to add the value.

Definition at line 666 of file storage.hh.

References squares, sum, and gem5::X86ISA::val.

Referenced by TEST().

◆ size()

size_type gem5::statistics::AvgSampleStor::size ( ) const
inline

Return the number of entries, in this case 1.

Returns
1.

Definition at line 676 of file storage.hh.

Referenced by TEST().

◆ zero()

bool gem5::statistics::AvgSampleStor::zero ( ) const
inline

Return true if no samples have been added.

Returns
True if the sum is zero.

Definition at line 682 of file storage.hh.

References sum.

Referenced by TEST().

Member Data Documentation

◆ squares

Counter gem5::statistics::AvgSampleStor::squares
private

Current sum of squares.

Definition at line 644 of file storage.hh.

Referenced by prepare(), reset(), and sample().

◆ sum

Counter gem5::statistics::AvgSampleStor::sum
private

Current total.

Definition at line 642 of file storage.hh.

Referenced by prepare(), reset(), sample(), and zero().


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

Generated on Tue Sep 21 2021 12:32:25 for gem5 by doxygen 1.8.17