gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::statistics::SparseHistStor Class Reference

Templatized storage and interface for a sparse histogram stat. More...

#include <storage.hh>

Classes

struct  Params
 The parameters for a sparse histogram stat. More...
 

Public Member Functions

 SparseHistStor (const StorageParams *const storage_params)
 
void sample (Counter val, int number)
 Add a value to the distribution for the given number of times.
 
size_type size () const
 Return the number of buckets in this distribution.
 
bool zero () const
 Returns true if any calls to sample have been made.
 
void prepare (const StorageParams *const storage_params, SparseHistData &data)
 
void reset (const StorageParams *const storage_params)
 Reset stat value to default.
 

Private Attributes

Counter samples
 Counter for number of samples.
 
MCounter cmap
 Counter for each bucket.
 

Detailed Description

Templatized storage and interface for a sparse histogram stat.

There is no actual limit on the number of buckets, and each of them has a size of 1, meaning that samples are individually recorded, and there is no need to keep track of the samples that occur in between two distant sampled values.

Definition at line 713 of file storage.hh.

Constructor & Destructor Documentation

◆ SparseHistStor()

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

Definition at line 728 of file storage.hh.

References gem5::statistics::reset().

Member Function Documentation

◆ prepare()

void gem5::statistics::SparseHistStor::prepare ( const StorageParams *const storage_params,
SparseHistData & data )
inline

Definition at line 762 of file storage.hh.

References cmap, data, and samples.

Referenced by TEST().

◆ reset()

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

Reset stat value to default.

Definition at line 777 of file storage.hh.

References cmap, and samples.

Referenced by TEST(), and TEST().

◆ sample()

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

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

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

Definition at line 739 of file storage.hh.

References cmap, samples, and gem5::X86ISA::val.

Referenced by TEST(), and TEST().

◆ size()

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

Return the number of buckets in this distribution.

Returns
the number of buckets.

Definition at line 749 of file storage.hh.

References cmap.

Referenced by TEST().

◆ zero()

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

Returns true if any calls to sample have been made.

Returns
True if any values have been sampled.

Definition at line 756 of file storage.hh.

References samples.

Referenced by TEST().

Member Data Documentation

◆ cmap

MCounter gem5::statistics::SparseHistStor::cmap
private

Counter for each bucket.

Definition at line 719 of file storage.hh.

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

◆ samples

Counter gem5::statistics::SparseHistStor::samples
private

Counter for number of samples.

Definition at line 717 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 Jun 18 2024 16:24:24 for gem5 by doxygen 1.11.0