gem5  v21.1.0.2
storage.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Daniel R. Carvalho
3  * Copyright (c) 2003-2005 The Regents of The University of Michigan
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met: redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer;
10  * redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution;
13  * neither the name of the copyright holders nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef __BASE_STATS_STORAGE_HH__
31 #define __BASE_STATS_STORAGE_HH__
32 
33 #include <cassert>
34 #include <cmath>
35 
36 #include "base/cast.hh"
37 #include "base/compiler.hh"
38 #include "base/logging.hh"
39 #include "base/stats/types.hh"
40 #include "sim/cur_tick.hh"
41 
42 namespace gem5
43 {
44 
45 GEM5_DEPRECATED_NAMESPACE(Stats, statistics);
46 namespace statistics
47 {
48 
50 {
51  virtual ~StorageParams() = default;
52 };
53 
57 class StatStor
58 {
59  private:
62 
63  public:
64  struct Params : public StorageParams {};
65 
70  StatStor(const StorageParams* const storage_params)
71  : data(Counter())
72  { }
73 
78  void set(Counter val) { data = val; }
79 
84  void inc(Counter val) { data += val; }
85 
90  void dec(Counter val) { data -= val; }
91 
96  Counter value() const { return data; }
97 
102  Result result() const { return (Result)data; }
103 
107  void prepare(const StorageParams* const storage_params) { }
108 
112  void reset(const StorageParams* const storage_params) { data = Counter(); }
113 
117  bool zero() const { return data == Counter(); }
118 };
119 
127 class AvgStor
128 {
129  private:
135  mutable Result total;
137  mutable Tick last;
138 
139  public:
140  struct Params : public StorageParams {};
141 
145  AvgStor(const StorageParams* const storage_params)
146  : current(0), lastReset(0), total(0), last(0)
147  { }
148 
154  void
156  {
157  total += current * (curTick() - last);
158  last = curTick();
159  current = val;
160  }
161 
166  void inc(Counter val) { set(current + val); }
167 
172  void dec(Counter val) { set(current - val); }
173 
178  Counter value() const { return current; }
179 
184  Result
185  result() const
186  {
187  assert(last == curTick());
188  return (Result)(total + current) / (Result)(curTick() - lastReset + 1);
189  }
190 
194  bool zero() const { return total == 0.0; }
195 
199  void
200  prepare(const StorageParams* const storage_params)
201  {
202  total += current * (curTick() - last);
203  last = curTick();
204  }
205 
209  void
210  reset(const StorageParams* const storage_params)
211  {
212  total = 0.0;
213  last = curTick();
214  lastReset = curTick();
215  }
216 
217 };
218 
220 struct DistParams : public StorageParams
221 {
222  const DistType type;
224 };
225 
233 class DistStor
234 {
235  private:
242 
259 
260  public:
262  struct Params : public DistParams
263  {
272 
273  Params(Counter _min, Counter _max, Counter _bucket_size)
274  : DistParams(Dist), min(_min), max(_max), bucket_size(_bucket_size),
275  buckets(0)
276  {
277  fatal_if(bucket_size <= 0,
278  "Bucket size (%f) must be greater than zero", bucket_size);
279  warn_if(std::floor((max - min + 1.0) / bucket_size) !=
280  std::ceil((max - min + 1.0) / bucket_size),
281  "Bucket size (%f) does not divide range [%f:%f] into equal-" \
282  "sized buckets. Rounding up.", bucket_size, min + 1.0, max);
283 
284  buckets = std::ceil((max - min + 1.0) / bucket_size);
285  }
286  };
287 
288  DistStor(const StorageParams* const storage_params)
289  : cvec(safe_cast<const Params *>(storage_params)->buckets)
290  {
291  reset(storage_params);
292  }
293 
299  void sample(Counter val, int number);
300 
305  size_type size() const { return cvec.size(); }
306 
311  bool
312  zero() const
313  {
314  return samples == Counter();
315  }
316 
317  void
318  prepare(const StorageParams* const storage_params, DistData &data)
319  {
320  const Params *params = safe_cast<const Params *>(storage_params);
321 
322  assert(params->type == Dist);
323  data.type = params->type;
324  data.min = params->min;
325  data.max = params->max;
326  data.bucket_size = params->bucket_size;
327 
328  data.min_val = (min_val == CounterLimits::max()) ? 0 : min_val;
329  data.max_val = (max_val == CounterLimits::min()) ? 0 : max_val;
330  data.underflow = underflow;
331  data.overflow = overflow;
332 
333  data.cvec.resize(params->buckets);
334  for (off_type i = 0; i < params->buckets; ++i)
335  data.cvec[i] = cvec[i];
336 
337  data.sum = sum;
338  data.squares = squares;
339  data.samples = samples;
340  }
341 
345  void
346  reset(const StorageParams* const storage_params)
347  {
348  const Params *params = safe_cast<const Params *>(storage_params);
349  min_track = params->min;
350  max_track = params->max;
351  bucket_size = params->bucket_size;
352 
353  min_val = CounterLimits::max();
354  max_val = CounterLimits::min();
355  underflow = Counter();
356  overflow = Counter();
357 
358  size_type size = cvec.size();
359  for (off_type i = 0; i < size; ++i)
360  cvec[i] = Counter();
361 
362  sum = Counter();
363  squares = Counter();
364  samples = Counter();
365  }
366 };
367 
399 class HistStor
400 {
401  private:
408 
419 
429  void growUp();
430 
442  void growOut();
443 
456  void growDown();
457 
458  public:
460  struct Params : public DistParams
461  {
464 
465  Params(size_type _buckets)
466  : DistParams(Hist)
467  {
468  fatal_if(_buckets < 2,
469  "There must be at least two buckets in a histogram");
470  buckets = _buckets;
471  }
472  };
473 
474  HistStor(const StorageParams* const storage_params)
475  : cvec(safe_cast<const Params *>(storage_params)->buckets)
476  {
477  reset(storage_params);
478  }
479 
484  void add(HistStor *other);
485 
491  void sample(Counter val, int number);
492 
497  size_type size() const { return cvec.size(); }
498 
503  bool
504  zero() const
505  {
506  return samples == Counter();
507  }
508 
509  void
510  prepare(const StorageParams* const storage_params, DistData &data)
511  {
512  const Params *params = safe_cast<const Params *>(storage_params);
513 
514  assert(params->type == Hist);
515  data.type = params->type;
516  data.min = min_bucket;
517  data.max = max_bucket + bucket_size - 1;
518  data.bucket_size = bucket_size;
519 
520  data.min_val = min_bucket;
521  data.max_val = max_bucket;
522 
523  int buckets = params->buckets;
524  data.cvec.resize(buckets);
525  for (off_type i = 0; i < buckets; ++i)
526  data.cvec[i] = cvec[i];
527 
528  data.sum = sum;
529  data.logs = logs;
530  data.squares = squares;
531  data.samples = samples;
532  }
533 
537  void
538  reset(const StorageParams* const storage_params)
539  {
540  const Params *params = safe_cast<const Params *>(storage_params);
541  min_bucket = 0;
542  max_bucket = params->buckets - 1;
543  bucket_size = 1;
544 
545  size_type size = cvec.size();
546  for (off_type i = 0; i < size; ++i)
547  cvec[i] = Counter();
548 
549  sum = Counter();
550  squares = Counter();
551  samples = Counter();
552  logs = Counter();
553  }
554 };
555 
561 {
562  private:
569 
570  public:
571  struct Params : public DistParams
572  {
574  };
575 
579  SampleStor(const StorageParams* const storage_params)
581  { }
582 
590  void
591  sample(Counter val, int number)
592  {
593  sum += val * number;
594  squares += val * val * number;
595  samples += number;
596  }
597 
602  size_type size() const { return 1; }
603 
608  bool zero() const { return samples == Counter(); }
609 
610  void
611  prepare(const StorageParams* const storage_params, DistData &data)
612  {
613  const Params *params = safe_cast<const Params *>(storage_params);
614 
615  assert(params->type == Deviation);
616  data.type = params->type;
617  data.sum = sum;
618  data.squares = squares;
619  data.samples = samples;
620  }
621 
625  void
626  reset(const StorageParams* const storage_params)
627  {
628  sum = Counter();
629  squares = Counter();
630  samples = Counter();
631  }
632 };
633 
639 {
640  private:
645 
646  public:
647  struct Params : public DistParams
648  {
650  };
651 
655  AvgSampleStor(const StorageParams* const storage_params)
656  : sum(Counter()), squares(Counter())
657  {}
658 
665  void
666  sample(Counter val, int number)
667  {
668  sum += val * number;
669  squares += val * val * number;
670  }
671 
676  size_type size() const { return 1; }
677 
682  bool zero() const { return sum == Counter(); }
683 
684  void
685  prepare(const StorageParams* const storage_params, DistData &data)
686  {
687  const Params *params = safe_cast<const Params *>(storage_params);
688 
689  assert(params->type == Deviation);
690  data.type = params->type;
691  data.sum = sum;
692  data.squares = squares;
693  data.samples = curTick();
694  }
695 
699  void
700  reset(const StorageParams* const storage_params)
701  {
702  sum = Counter();
703  squares = Counter();
704  }
705 };
706 
715 {
716  private:
721 
722  public:
724  struct Params : public DistParams
725  {
727  };
728 
729  SparseHistStor(const StorageParams* const storage_params)
730  {
731  reset(storage_params);
732  }
733 
739  void
740  sample(Counter val, int number)
741  {
742  cmap[val] += number;
743  samples += number;
744  }
745 
750  size_type size() const { return cmap.size(); }
751 
756  bool
757  zero() const
758  {
759  return samples == Counter();
760  }
761 
762  void
763  prepare(const StorageParams* const storage_params, SparseHistData &data)
764  {
765  MCounter::iterator it;
766  data.cmap.clear();
767  for (it = cmap.begin(); it != cmap.end(); it++) {
768  data.cmap[(*it).first] = (*it).second;
769  }
770 
771  data.samples = samples;
772  }
773 
777  void
778  reset(const StorageParams* const storage_params)
779  {
780  cmap.clear();
781  samples = 0;
782  }
783 };
784 
785 } // namespace statistics
786 } // namespace gem5
787 
788 #endif // __BASE_STATS_STORAGE_HH__
gem5::statistics::SampleStor::Params
Definition: storage.hh:571
gem5::curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:46
gem5::statistics::DistStor
Templatized storage and interface for a distribution stat.
Definition: storage.hh:233
gem5::statistics::AvgStor::zero
bool zero() const
Definition: storage.hh:194
gem5::statistics::SparseHistStor
Templatized storage and interface for a sparse histogram stat.
Definition: storage.hh:714
gem5::statistics::DistStor::prepare
void prepare(const StorageParams *const storage_params, DistData &data)
Definition: storage.hh:318
gem5::statistics::HistStor::cvec
VCounter cvec
Counter for each bucket.
Definition: storage.hh:418
types.hh
gem5::statistics::SampleStor::sum
Counter sum
The current sum.
Definition: storage.hh:564
gem5::statistics::DistStor::Params::min
Counter min
The minimum value to track.
Definition: storage.hh:265
gem5::statistics::AvgSampleStor
Templatized storage for distribution that calculates per tick mean and variance.
Definition: storage.hh:638
gem5::statistics::AvgStor::dec
void dec(Counter val)
Deccrement the current count by the provided value, calls set.
Definition: storage.hh:172
gem5::statistics::AvgSampleStor::sum
Counter sum
Current total.
Definition: storage.hh:642
gem5::statistics::SampleStor::prepare
void prepare(const StorageParams *const storage_params, DistData &data)
Definition: storage.hh:611
gem5::statistics::Result
double Result
All results are doubles.
Definition: types.hh:56
gem5::statistics::HistStor::sample
void sample(Counter val, int number)
Add a value to the distribution for the given number of times.
Definition: storage.cc:177
gem5::statistics::AvgStor::current
Counter current
The current count.
Definition: storage.hh:131
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::statistics::DistStor::Params::bucket_size
Counter bucket_size
The number of entries in each bucket.
Definition: storage.hh:269
gem5::statistics::SampleStor
Templatized storage and interface for a distribution that calculates mean and variance.
Definition: storage.hh:560
gem5::statistics::AvgSampleStor::size
size_type size() const
Return the number of entries, in this case 1.
Definition: storage.hh:676
gem5::statistics::AvgSampleStor::prepare
void prepare(const StorageParams *const storage_params, DistData &data)
Definition: storage.hh:685
gem5::statistics::HistStor::logs
Counter logs
The sum of logarithm of each sample, used to compute geometric mean.
Definition: storage.hh:412
gem5::statistics::SparseHistStor::sample
void sample(Counter val, int number)
Add a value to the distribution for the given number of times.
Definition: storage.hh:740
gem5::statistics::AvgSampleStor::AvgSampleStor
AvgSampleStor(const StorageParams *const storage_params)
Create and initialize this storage.
Definition: storage.hh:655
gem5::statistics::SampleStor::squares
Counter squares
The sum of squares.
Definition: storage.hh:566
gem5::statistics::AvgSampleStor::Params
Definition: storage.hh:647
gem5::statistics::DistStor::Params::Params
Params(Counter _min, Counter _max, Counter _bucket_size)
Definition: storage.hh:273
gem5::statistics::DistStor::min_val
Counter min_val
The smallest value sampled.
Definition: storage.hh:244
gem5::statistics::DistStor::Params::buckets
size_type buckets
The number of buckets.
Definition: storage.hh:271
gem5::statistics::SparseHistStor::Params::Params
Params()
Definition: storage.hh:726
gem5::statistics::DistStor::zero
bool zero() const
Returns true if any calls to sample have been made.
Definition: storage.hh:312
cur_tick.hh
gem5::statistics::AvgSampleStor::reset
void reset(const StorageParams *const storage_params)
Reset stat value to default.
Definition: storage.hh:700
gem5::statistics::HistStor::size
size_type size() const
Return the number of buckets in this distribution.
Definition: storage.hh:497
gem5::statistics::HistStor::zero
bool zero() const
Returns true if any calls to sample have been made.
Definition: storage.hh:504
gem5::statistics::SparseHistData
Data structure of sparse histogram.
Definition: types.hh:85
gem5::statistics::AvgSampleStor::zero
bool zero() const
Return true if no samples have been added.
Definition: storage.hh:682
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:775
cast.hh
gem5::statistics::AvgSampleStor::squares
Counter squares
Current sum of squares.
Definition: storage.hh:644
std::vector< Counter >
gem5::statistics::AvgStor::result
Result result() const
Return the current average.
Definition: storage.hh:185
gem5::statistics::StatStor::value
Counter value() const
Return the value of this stat as its base type.
Definition: storage.hh:96
gem5::statistics::HistStor::bucket_size
Counter bucket_size
The number of entries in each bucket.
Definition: storage.hh:407
gem5::statistics::AvgStor::AvgStor
AvgStor(const StorageParams *const storage_params)
Build and initializes this stat storage.
Definition: storage.hh:145
gem5::statistics::StatStor::data
Counter data
The statistic value.
Definition: storage.hh:61
gem5::statistics::HistStor::sum
Counter sum
The current sum.
Definition: storage.hh:410
gem5::statistics::DistStor::min_track
Counter min_track
The minimum value to track.
Definition: storage.hh:237
gem5::statistics::SampleStor::sample
void sample(Counter val, int number)
Add a value the given number of times to this running average.
Definition: storage.hh:591
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:66
gem5::statistics::SampleStor::reset
void reset(const StorageParams *const storage_params)
Reset stat value to default.
Definition: storage.hh:626
gem5::statistics::HistStor::Params::Params
Params(size_type _buckets)
Definition: storage.hh:465
gem5::statistics::DistStor::max_track
Counter max_track
The maximum value to track.
Definition: storage.hh:239
gem5::statistics::SparseHistStor::samples
Counter samples
Counter for number of samples.
Definition: storage.hh:718
gem5::safe_cast
T safe_cast(U ptr)
Definition: cast.hh:62
gem5::statistics::DistStor::cvec
VCounter cvec
Counter for each bucket.
Definition: storage.hh:258
gem5::statistics::HistStor::Params
The parameters for a distribution stat.
Definition: storage.hh:460
gem5::statistics::AvgStor::Params
Definition: storage.hh:140
gem5::statistics::HistStor::max_bucket
Counter max_bucket
Lower bound of the last bucket's range.
Definition: storage.hh:405
gem5::statistics::SampleStor::samples
Counter samples
The number of samples.
Definition: storage.hh:568
gem5::statistics::AvgStor::last
Tick last
The tick that current last changed.
Definition: storage.hh:137
gem5::statistics::StatStor::prepare
void prepare(const StorageParams *const storage_params)
Prepare stat data for dumping or serialization.
Definition: storage.hh:107
gem5::statistics::StatStor::set
void set(Counter val)
The the stat to the given value.
Definition: storage.hh:78
gem5::statistics::Hist
@ Hist
Definition: types.hh:63
gem5::statistics::HistStor::growUp
void growUp()
Given a bucket size B, and a range of values [0, N], this function doubles the bucket size to double ...
Definition: storage.cc:155
gem5::statistics::off_type
unsigned int off_type
Definition: types.hh:61
gem5::statistics::HistStor::prepare
void prepare(const StorageParams *const storage_params, DistData &data)
Definition: storage.hh:510
gem5::statistics::StatStor::StatStor
StatStor(const StorageParams *const storage_params)
Builds this storage element and calls the base constructor of the datatype.
Definition: storage.hh:70
gem5::statistics::HistStor::samples
Counter samples
The number of samples.
Definition: storage.hh:416
gem5::statistics::DistStor::sum
Counter sum
The current sum.
Definition: storage.hh:252
gem5::statistics::AvgStor::lastReset
Tick lastReset
The tick of the last reset.
Definition: storage.hh:133
gem5::statistics::DistStor::max_val
Counter max_val
The largest value sampled.
Definition: storage.hh:246
gem5::statistics::HistStor::Params::buckets
size_type buckets
The number of buckets.
Definition: storage.hh:463
gem5::statistics::AvgStor::reset
void reset(const StorageParams *const storage_params)
Reset stat value to default.
Definition: storage.hh:210
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::statistics::StatStor::reset
void reset(const StorageParams *const storage_params)
Reset stat value to default.
Definition: storage.hh:112
gem5::statistics::StatStor::zero
bool zero() const
Definition: storage.hh:117
gem5::statistics::Deviation
@ Deviation
Definition: types.hh:63
gem5::statistics::AvgSampleStor::sample
void sample(Counter val, int number)
Add a value to the distribution for the given number of times.
Definition: storage.hh:666
gem5::statistics::DistStor::overflow
Counter overflow
The number of values sampled more than max.
Definition: storage.hh:250
gem5::statistics::StatStor::Params
Definition: storage.hh:64
gem5::statistics::StatStor::dec
void dec(Counter val)
Decrement the stat by the given value.
Definition: storage.hh:90
gem5::statistics::SampleStor::size
size_type size() const
Return the number of entries in this stat, 1.
Definition: storage.hh:602
gem5::statistics::StatStor::result
Result result() const
Return the value of this stat as a result type.
Definition: storage.hh:102
compiler.hh
gem5::statistics::HistStor::HistStor
HistStor(const StorageParams *const storage_params)
Definition: storage.hh:474
gem5::statistics::DistStor::sample
void sample(Counter val, int number)
Add a value to the distribution for the given number of times.
Definition: storage.cc:54
gem5::statistics::HistStor::growDown
void growDown()
Given a bucket size B, and a range of values [0, N], this function doubles the bucket size to double ...
Definition: storage.cc:116
gem5::ArmISA::t
Bitfield< 5 > t
Definition: misc_types.hh:70
gem5::statistics::size_type
unsigned int size_type
Definition: types.hh:60
gem5::statistics::SparseHistStor::zero
bool zero() const
Returns true if any calls to sample have been made.
Definition: storage.hh:757
gem5::statistics::SparseHistStor::prepare
void prepare(const StorageParams *const storage_params, SparseHistData &data)
Definition: storage.hh:763
gem5::statistics::DistStor::squares
Counter squares
The sum of squares.
Definition: storage.hh:254
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::statistics::DistStor::underflow
Counter underflow
The number of values sampled less than min.
Definition: storage.hh:248
gem5::statistics::MCounter
std::map< Counter, int > MCounter
map of counters
Definition: types.hh:51
gem5::statistics::AvgStor::total
Result total
The total count for all tick.
Definition: storage.hh:135
warn_if
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
Definition: logging.hh:272
gem5::statistics::DistStor::DistStor
DistStor(const StorageParams *const storage_params)
Definition: storage.hh:288
gem5::statistics::AvgStor::inc
void inc(Counter val)
Increment the current count by the provided value, calls set.
Definition: storage.hh:166
gem5::statistics::AvgSampleStor::Params::Params
Params()
Definition: storage.hh:649
gem5::statistics::StorageParams
Definition: storage.hh:49
gem5::statistics::SparseHistStor::reset
void reset(const StorageParams *const storage_params)
Reset stat value to default.
Definition: storage.hh:778
gem5::statistics::DistData
General container for distribution data.
Definition: types.hh:66
gem5::statistics::DistParams::DistParams
DistParams(DistType t)
Definition: storage.hh:223
gem5::statistics::StatStor::inc
void inc(Counter val)
Increment the stat by the given value.
Definition: storage.hh:84
gem5::statistics::SparseHistStor::SparseHistStor
SparseHistStor(const StorageParams *const storage_params)
Definition: storage.hh:729
gem5::statistics::HistStor::reset
void reset(const StorageParams *const storage_params)
Reset stat value to default.
Definition: storage.hh:538
gem5::statistics::SparseHistStor::Params
The parameters for a sparse histogram stat.
Definition: storage.hh:724
gem5::statistics::HistStor::min_bucket
Counter min_bucket
Lower bound of the first bucket's range.
Definition: storage.hh:403
gem5::statistics::Counter
double Counter
All counters are of 64-bit values.
Definition: types.hh:47
gem5::statistics::HistStor::squares
Counter squares
The sum of squares.
Definition: storage.hh:414
logging.hh
gem5::statistics::HistStor
Templatized storage and interface for a histogram stat.
Definition: storage.hh:399
gem5::statistics::Dist
@ Dist
Definition: types.hh:63
gem5::statistics::SparseHistStor::size
size_type size() const
Return the number of buckets in this distribution.
Definition: storage.hh:750
gem5::statistics::StatStor
Templatized storage and interface for a simple scalar stat.
Definition: storage.hh:57
gem5::statistics::DistType
DistType
Definition: types.hh:63
gem5::statistics::SampleStor::SampleStor
SampleStor(const StorageParams *const storage_params)
Create and initialize this storage.
Definition: storage.hh:579
gem5::statistics::DistStor::bucket_size
Counter bucket_size
The number of entries in each bucket.
Definition: storage.hh:241
fatal_if
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Definition: logging.hh:225
gem5::statistics::DistParams::type
const DistType type
Definition: storage.hh:222
gem5::statistics::AvgStor::value
Counter value() const
Return the current count.
Definition: storage.hh:178
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::statistics::DistStor::Params
The parameters for a distribution stat.
Definition: storage.hh:262
gem5::statistics::SampleStor::Params::Params
Params()
Definition: storage.hh:573
gem5::statistics::AvgStor::prepare
void prepare(const StorageParams *const storage_params)
Prepare stat data for dumping or serialization.
Definition: storage.hh:200
gem5::statistics::DistStor::size
size_type size() const
Return the number of buckets in this distribution.
Definition: storage.hh:305
gem5::statistics::StorageParams::~StorageParams
virtual ~StorageParams()=default
gem5::statistics::AvgStor::set
void set(Counter val)
Set the current count to the one provided, update the total and last set values.
Definition: storage.hh:155
gem5::statistics::HistStor::growOut
void growOut()
Given a bucket size B, and a range of values [M, N], where M < 0, this function doubles the bucket si...
Definition: storage.cc:77
gem5::statistics::DistStor::Params::max
Counter max
The maximum value to track.
Definition: storage.hh:267
gem5::statistics::DistParams
The parameters for a distribution stat.
Definition: storage.hh:220
gem5::statistics::SparseHistStor::cmap
MCounter cmap
Counter for each bucket.
Definition: storage.hh:720
gem5::statistics::HistStor::add
void add(HistStor *other)
Adds the contents of the given storage to this storage.
Definition: storage.cc:210
gem5::statistics::SampleStor::zero
bool zero() const
Return true if no samples have been added.
Definition: storage.hh:608
gem5::statistics::DistStor::reset
void reset(const StorageParams *const storage_params)
Reset stat value to default.
Definition: storage.hh:346
gem5::statistics::DistStor::samples
Counter samples
The number of samples.
Definition: storage.hh:256
gem5::statistics::AvgStor
Templatized storage and interface to a per-tick average stat.
Definition: storage.hh:127

Generated on Tue Sep 21 2021 12:24:59 for gem5 by doxygen 1.8.17