The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::CycleHistogramStandalone Class Referencefinal

CycleHistogramStandalone class for uint64_t values. More...

#include <CycleHistogram.hpp>

Inheritance diagram for sparta::CycleHistogramStandalone:
Collaboration diagram for sparta::CycleHistogramStandalone:

Public Member Functions

 CycleHistogramStandalone ()=delete
 Not default constructable.
 
 CycleHistogramStandalone (const CycleHistogramStandalone &)=delete
 Not copy-constructable.
 
 CycleHistogramStandalone (CycleHistogramStandalone &&)=delete
 Not move-constructable.
 
void operator= (const CycleHistogramStandalone &)=delete
 Not assignable.
 
 CycleHistogramStandalone (StatisticSet *sset, const Clock *clk, const std::string &name, const std::string &description, const uint64_t lower_val, const uint64_t upper_val, const uint64_t num_vals_per_bin, const uint64_t idle_value=0, const InstrumentationNode::visibility_t stat_vis_general=InstrumentationNode::AUTO_VISIBILITY, const InstrumentationNode::visibility_t stat_vis_detailed=InstrumentationNode::AUTO_VISIBILITY, const InstrumentationNode::visibility_t stat_vis_max=InstrumentationNode::AUTO_VISIBILITY, const InstrumentationNode::visibility_t stat_vis_avg=InstrumentationNode::AUTO_VISIBILITY)
 CycleHistogramStandalone constructor.
 
std::string getDisplayStringCumulative () const
 Render the cumulative values of this histogram for use in standalone model.
 
- Public Member Functions inherited from sparta::CycleHistogramBase
 CycleHistogramBase ()=delete
 Not default constructable.
 
 CycleHistogramBase (const CycleHistogramBase &)=delete
 Not copy-constructable.
 
 CycleHistogramBase (CycleHistogramBase &&)=delete
 Not move-constructable.
 
void operator= (const CycleHistogramBase &)=delete
 Not assignable.
 
uint64_t getHistogramUpperValue () const
 
uint64_t getHistogramLowerValue () const
 
uint64_t getNumBins () const
 
uint64_t getNumValuesPerBin () const
 
void addValue (uint64_t val)
 Add a value to histogram for one cycle, defaulting back to idle value.
 
double getStandardDeviation () const
 Calculate Standard Deviation of counts in bins. This API also takes into account the count in underflow and overflow bins.
 
double getMeanBinCount () const
 Calculate the mean bin count of all the bins. This API also takes into account the count in underflow and overflow bins.
 
const sparta::CycleCountergetAggCycles () const
 Return aggregate clock cycles of this histogram.
 
const std::vector< sparta::CycleCounter > & getRegularBin () const
 Return vector of regular bin counts.
 
const sparta::CycleCountergetUnderflowBin () const
 Return count of underflow bin.
 
const sparta::CycleCountergetOverflowBin () const
 Return count of overflow bin.
 
double getUnderflowProbability () const
 Return underflow probability.
 
double getOverflowProbability () const
 Return overflow probability.
 
const std::vector< double > & recomputeRegularBinProbabilities () const
 Return vector of probabilities regular bins.
 
void setValue (uint64_t val)
 Set a value to histogram until a new value is set.
 

Additional Inherited Members

- Protected Member Functions inherited from sparta::CycleHistogramBase
 CycleHistogramBase (const uint64_t lower_val, const uint64_t upper_val, const uint64_t num_vals_per_bin, const uint64_t idle_value=0)
 CycleHistogramBase constructor.
 
std::string getDisplayStringCumulative_ (const std::string &name) const
 Render the cumulative values of this histogram for use in standalone model.
 
void startCounting_ (uint64_t val, uint64_t delay=0)
 Start counting, taking into account the specified delay.
 
void stopCounting_ (uint64_t val, uint64_t delay=0)
 Stop counting and increment internal count, taking into account the specified delay.
 
void updateMaxValues_ (uint64_t val)
 
void initializeStats_ (StatisticSet *sset, const Clock *clk, const std::string &name, const std::string &description, const InstrumentationNode::visibility_t stat_vis_general=InstrumentationNode::AUTO_VISIBILITY, const InstrumentationNode::visibility_t stat_vis_detailed=InstrumentationNode::AUTO_VISIBILITY, InstrumentationNode::visibility_t stat_vis_max=InstrumentationNode::AUTO_VISIBILITY, InstrumentationNode::visibility_t stat_vis_avg=InstrumentationNode::AUTO_VISIBILITY, const std::vector< std::string > &histogram_state_names={})
 
- Protected Attributes inherited from sparta::CycleHistogramBase
const uint64_t lower_val_
 Lowest value captured in normal bins.
 
const uint64_t upper_val_
 Highest value vaptured in normal bins.
 
const uint64_t num_vals_per_bin_
 Number of values captured by each bin.
 
const uint64_t idle_value_
 Value to capture when nothing is captured.
 
std::unique_ptr< sparta::CycleCountertotal_
 Total values.
 
sparta::CycleCounterunderflow_bin_
 Bin for all underflow.
 
sparta::CycleCounteroverflow_bin_
 Bin for all overflow.
 
std::vector< sparta::CycleCounterbin_
 Regular bins.
 
std::unique_ptr< sparta::StatisticDefunderflow_probability_
 Probability of underflow.
 
std::unique_ptr< sparta::StatisticDefoverflow_probability_
 Probability of overflow.
 
std::vector< std::unique_ptr< sparta::StatisticDef > > probabilities_
 Probabilities of each normal bin.
 
std::unique_ptr< sparta::StatisticDefweighted_non_zero_average_
 
std::unique_ptr< sparta::Countermax_value_
 The maximum value in the histogram.
 
std::unique_ptr< sparta::StatisticDefweighted_average_
 The weighted average.
 
std::unique_ptr< sparta::StatisticDeffullness_
 Sum of the max bin and the overflow bin.
 
std::unique_ptr< sparta::StatisticDeffullness_probability_
 Probability of the histogram being in a full state.
 
uint64_t num_bins_
 Number of bins.
 
uint64_t idx_shift_amount_
 Number of bits which cannot distinguish between bins for a given input value.
 
uint64_t last_value_ = 0
 Last value updated.
 
std::vector< double > bin_prob_vector_
 

Detailed Description

CycleHistogramStandalone class for uint64_t values.

A histogram is usually thought of has having a lower limit, upper limit, and number of bins. This histogram class requires lower and upper limits, but instead of number of bins, it requires the user to specify number of values per bin. The number of bins is then calculated as below: number_of_bins = (upper_limit - lower_limit) / values_per_bin + 1

This is possible because this histogram only deals with positive integer values.

Definition at line 590 of file CycleHistogram.hpp.

Constructor & Destructor Documentation

◆ CycleHistogramStandalone()

sparta::CycleHistogramStandalone::CycleHistogramStandalone ( StatisticSet sset,
const Clock clk,
const std::string &  name,
const std::string &  description,
const uint64_t  lower_val,
const uint64_t  upper_val,
const uint64_t  num_vals_per_bin,
const uint64_t  idle_value = 0,
const InstrumentationNode::visibility_t  stat_vis_general = InstrumentationNode::AUTO_VISIBILITY,
const InstrumentationNode::visibility_t  stat_vis_detailed = InstrumentationNode::AUTO_VISIBILITY,
const InstrumentationNode::visibility_t  stat_vis_max = InstrumentationNode::AUTO_VISIBILITY,
const InstrumentationNode::visibility_t  stat_vis_avg = InstrumentationNode::AUTO_VISIBILITY 
)
inline

CycleHistogramStandalone constructor.

Parameters
ssetStatistic set to add this histogram's stats into
clkClock* for CycleCounter
histogram_nameName of this histograms.
descriptionDescription of this histogran.
lower_valthe lower value of the histogram. Values lower than lower_val go into the underflow bin.
upper_valthe upper value of the histogram. Values higher than upper_val go into the overflow bin.
num_vals_per_binNumber of values per bin. Must be power of two for fast devision.
idle_valuethe value to capture when none nothing was updated (default = 0)
stat_vis_generalSets the visibility of the stat counters for the 0th and last index of the utilization counts, so the empty and full counts.
stat_vis_detailedSets the visibility of the stat counts inbetween 0 and the last index. i.e. more detailed than the general stats.
Warning
By default the stat_vis_* options are set to VIS_SPARTA_DEFAULT, for this structure AUTO_VISIBILITY resolves to CONTAINER_DEFAULT_VISIBILITY which at the time of writing this comment is set to VIS_HIDDEN. If you rely on the stats from this container you should explicity set the visibility.

Definition at line 645 of file CycleHistogram.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ getDisplayStringCumulative()

std::string sparta::CycleHistogramStandalone::getDisplayStringCumulative ( ) const
inline

Render the cumulative values of this histogram for use in standalone model.

Definition at line 672 of file CycleHistogram.hpp.

Here is the call graph for this function:

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