The Sparta Modeling Framework
|
CycleHistogramStandalone class for uint64_t values. More...
#include <CycleHistogram.hpp>
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::CycleCounter & | getAggCycles () const |
Return aggregate clock cycles of this histogram. | |
const std::vector< sparta::CycleCounter > & | getRegularBin () const |
Return vector of regular bin counts. | |
const sparta::CycleCounter & | getUnderflowBin () const |
Return count of underflow bin. | |
const sparta::CycleCounter & | getOverflowBin () 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::CycleCounter > | total_ |
Total values. | |
sparta::CycleCounter * | underflow_bin_ |
Bin for all underflow. | |
sparta::CycleCounter * | overflow_bin_ |
Bin for all overflow. | |
std::vector< sparta::CycleCounter > | bin_ |
Regular bins. | |
std::unique_ptr< sparta::StatisticDef > | underflow_probability_ |
Probability of underflow. | |
std::unique_ptr< sparta::StatisticDef > | overflow_probability_ |
Probability of overflow. | |
std::vector< std::unique_ptr< sparta::StatisticDef > > | probabilities_ |
Probabilities of each normal bin. | |
std::unique_ptr< sparta::StatisticDef > | weighted_non_zero_average_ |
std::unique_ptr< sparta::Counter > | max_value_ |
The maximum value in the histogram. | |
std::unique_ptr< sparta::StatisticDef > | weighted_average_ |
The weighted average. | |
std::unique_ptr< sparta::StatisticDef > | fullness_ |
Sum of the max bin and the overflow bin. | |
std::unique_ptr< sparta::StatisticDef > | fullness_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_ |
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.
|
inline |
CycleHistogramStandalone constructor.
sset | Statistic set to add this histogram's stats into |
clk | Clock* for CycleCounter |
histogram_name | Name of this histograms. |
description | Description of this histogran. |
lower_val | the lower value of the histogram. Values lower than lower_val go into the underflow bin. |
upper_val | the upper value of the histogram. Values higher than upper_val go into the overflow bin. |
num_vals_per_bin | Number of values per bin. Must be power of two for fast devision. |
idle_value | the value to capture when none nothing was updated (default = 0) |
stat_vis_general | Sets the visibility of the stat counters for the 0th and last index of the utilization counts, so the empty and full counts. |
stat_vis_detailed | Sets the visibility of the stat counts inbetween 0 and the last index. i.e. more detailed than the general stats. |
Definition at line 645 of file CycleHistogram.hpp.
|
inline |
Render the cumulative values of this histogram for use in standalone model.
Definition at line 672 of file CycleHistogram.hpp.