The Sparta Modeling Framework
|
CycleHistogramBase class for uint64_t values. More...
#include <CycleHistogram.hpp>
Public Member Functions | |
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 |
CycleHistogramBase use methods | |
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. | |
Protected Member Functions | |
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 | |
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_ |
CycleHistogramBase 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 40 of file CycleHistogram.hpp.
|
inlineprotected |
CycleHistogramBase constructor.
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) |
Definition at line 224 of file CycleHistogram.hpp.
|
inline |
Add a value to histogram for one cycle, defaulting back to idle value.
val | New value to add |
Definition at line 77 of file CycleHistogram.hpp.
|
inline |
Return aggregate clock cycles of this histogram.
Definition at line 138 of file CycleHistogram.hpp.
|
inlineprotected |
Render the cumulative values of this histogram for use in standalone model.
Definition at line 249 of file CycleHistogram.hpp.
|
inline |
Definition at line 207 of file CycleHistogram.hpp.
|
inline |
Definition at line 206 of file CycleHistogram.hpp.
|
inline |
Calculate the mean bin count of all the bins. This API also takes into account the count in underflow and overflow bins.
Definition at line 120 of file CycleHistogram.hpp.
|
inline |
Definition at line 208 of file CycleHistogram.hpp.
|
inline |
Definition at line 209 of file CycleHistogram.hpp.
|
inline |
Return count of overflow bin.
Definition at line 159 of file CycleHistogram.hpp.
|
inline |
Return overflow probability.
Definition at line 173 of file CycleHistogram.hpp.
|
inline |
Return vector of regular bin counts.
Definition at line 145 of file CycleHistogram.hpp.
|
inline |
Calculate Standard Deviation of counts in bins. This API also takes into account the count in underflow and overflow bins.
Definition at line 92 of file CycleHistogram.hpp.
|
inline |
Return count of underflow bin.
Definition at line 152 of file CycleHistogram.hpp.
|
inline |
Return underflow probability.
Definition at line 166 of file CycleHistogram.hpp.
|
inlineprotected |
Definition at line 328 of file CycleHistogram.hpp.
|
inline |
Return vector of probabilities regular bins.
Definition at line 180 of file CycleHistogram.hpp.
|
inline |
Set a value to histogram until a new value is set.
val | New value to set |
Definition at line 193 of file CycleHistogram.hpp.
|
inlineprotected |
Start counting, taking into account the specified delay.
delay | Begin incrementing counter after this number of cycles has elapsed on the clock associated with this Counter (see sparta::CounterBase::getClock) |
Definition at line 279 of file CycleHistogram.hpp.
|
inlineprotected |
Stop counting and increment internal count, taking into account the specified delay.
val | Value to capture. Class will determine which bin to increment |
delay | Begin incrementing counter after this number of cycles has elapsed on the clock associated with this Counter (see sparta::CounterBase::getClock) |
Definition at line 303 of file CycleHistogram.hpp.
|
inlineprotected |
Keep track of the maximum value seen
val | The value currently being added to the histogram |
Definition at line 321 of file CycleHistogram.hpp.
|
protected |
Regular bins.
Definition at line 561 of file CycleHistogram.hpp.
|
mutableprotected |
Definition at line 574 of file CycleHistogram.hpp.
|
protected |
Sum of the max bin and the overflow bin.
Definition at line 568 of file CycleHistogram.hpp.
|
protected |
Probability of the histogram being in a full state.
Definition at line 569 of file CycleHistogram.hpp.
|
protected |
Value to capture when nothing is captured.
Definition at line 556 of file CycleHistogram.hpp.
|
protected |
Number of bits which cannot distinguish between bins for a given input value.
Definition at line 572 of file CycleHistogram.hpp.
|
protected |
Last value updated.
Definition at line 573 of file CycleHistogram.hpp.
|
protected |
Lowest value captured in normal bins.
Definition at line 553 of file CycleHistogram.hpp.
|
protected |
The maximum value in the histogram.
Definition at line 566 of file CycleHistogram.hpp.
|
protected |
Number of bins.
Definition at line 571 of file CycleHistogram.hpp.
|
protected |
Number of values captured by each bin.
Definition at line 555 of file CycleHistogram.hpp.
|
protected |
Bin for all overflow.
Definition at line 560 of file CycleHistogram.hpp.
|
protected |
Probability of overflow.
Definition at line 563 of file CycleHistogram.hpp.
|
protected |
Probabilities of each normal bin.
Definition at line 564 of file CycleHistogram.hpp.
|
protected |
Total values.
Definition at line 558 of file CycleHistogram.hpp.
|
protected |
Bin for all underflow.
Definition at line 559 of file CycleHistogram.hpp.
|
protected |
Probability of underflow.
Definition at line 562 of file CycleHistogram.hpp.
|
protected |
Highest value vaptured in normal bins.
Definition at line 554 of file CycleHistogram.hpp.
|
protected |
The weighted average.
Definition at line 567 of file CycleHistogram.hpp.
|
protected |
Definition at line 565 of file CycleHistogram.hpp.