gem5 v24.0.0.0
|
A formula for statistics that is calculated when printed. More...
#include <statistics.hh>
Public Member Functions | |
Formula (Group *parent=nullptr, const char *name=nullptr, const char *desc=nullptr) | |
Create and initialize thie formula, and register it with the database. | |
Formula (Group *parent, const char *name, const units::Base *unit, const char *desc=nullptr) | |
Formula (Group *parent, const char *name, const char *desc, const Temp &r) | |
Formula (Group *parent, const char *name, const units::Base *unit, const char *desc, const Temp &r) | |
const Formula & | operator= (const Temp &r) |
Set an unitialized Formula to the given root. | |
template<typename T > | |
const Formula & | operator= (const T &v) |
const Formula & | operator+= (Temp r) |
Add the given tree to the existing one. | |
const Formula & | operator/= (Temp r) |
Divide the existing tree by the given one. | |
void | result (VResult &vec) const |
Return the result of the Fomula in a vector. | |
Result | total () const |
Return the total Formula result. | |
size_type | size () const |
Return the number of elements in the tree. | |
void | prepare () |
void | reset () |
Formulas don't need to be reset. | |
bool | zero () const |
std::string | str () const |
Public Member Functions inherited from gem5::statistics::DataWrapVec< Formula, FormulaInfoProxy > | |
DataWrapVec (Group *parent=nullptr, const char *name=nullptr, const units::Base *unit=units::Unspecified::get(), const char *desc=nullptr) | |
Formula & | subname (off_type index, const std::string &name) |
Set the subfield name for the given index, and marks this stat to print at the end of simulation. | |
Formula & | subdesc (off_type index, const std::string &desc) |
Set the subfield description for the given index and marks this stat to print at the end of simulation. | |
void | prepare () |
void | reset () |
Public Member Functions inherited from gem5::statistics::DataWrap< Formula, FormulaInfoProxy > | |
const Info * | info () const |
DataWrap ()=delete | |
DataWrap (const DataWrap &)=delete | |
DataWrap (Group *parent, const char *name, const units::Base *unit, const char *desc) | |
DataWrap & | operator= (const DataWrap &)=delete |
Formula & | name (const std::string &name) |
Set the name and marks this stat to print at the end of simulation. | |
const std::string & | name () const |
Formula & | setSeparator (const std::string &_sep) |
Set the character(s) used between the name and vector number on vectors, dist, etc. | |
const std::string & | setSeparator () const |
Formula & | unit (const units::Base *_unit) |
Set the unit of the stat. | |
Formula & | desc (const std::string &_desc) |
Set the description and marks this stat to print at the end of simulation. | |
Formula & | precision (int _precision) |
Set the precision and marks this stat to print at the end of simulation. | |
Formula & | flags (Flags _flags) |
Set the flags and marks this stat to print at the end of simulation. | |
Formula & | prereq (const Stat &prereq) |
Set the prerequisite stat and marks this stat to print at the end of simulation. | |
Public Member Functions inherited from gem5::statistics::InfoAccess | |
InfoAccess () | |
void | reset () |
Reset the stat to the default state. | |
bool | zero () const |
bool | check () const |
Check that this stat has been set up properly and is ready for use. | |
Protected Attributes | |
NodePtr | root |
The root of the tree which represents the Formula. | |
Friends | |
class | Temp |
Additional Inherited Members | |
Public Types inherited from gem5::statistics::DataWrapVec< Formula, FormulaInfoProxy > | |
typedef FormulaInfoProxy< Formula > | Info |
Public Types inherited from gem5::statistics::DataWrap< Formula, FormulaInfoProxy > | |
typedef FormulaInfoProxy< Formula > | Info |
Protected Member Functions inherited from gem5::statistics::DataWrap< Formula, FormulaInfoProxy > | |
Formula & | self () |
Info * | info () |
Protected Member Functions inherited from gem5::statistics::InfoAccess | |
void | setInfo (Group *parent, Info *info) |
Set up an info class for this statistic. | |
void | setParams (const StorageParams *params) |
Save Storage class parameters if any. | |
void | setInit () |
Save Storage class parameters if any. | |
Info * | info () |
Grab the information class for this statistic. | |
const Info * | info () const |
Grab the information class for this statistic. | |
bool | newStyleStats () const |
Check if the info is new style stats. | |
A formula for statistics that is calculated when printed.
A formula is stored as a tree of Nodes that represent the equation to calculate.
Definition at line 2538 of file statistics.hh.
gem5::statistics::Formula::Formula | ( | Group * | parent = nullptr, |
const char * | name = nullptr, | ||
const char * | desc = nullptr ) |
Create and initialize thie formula, and register it with the database.
Definition at line 144 of file statistics.cc.
gem5::statistics::Formula::Formula | ( | Group * | parent, |
const char * | name, | ||
const units::Base * | unit, | ||
const char * | desc = nullptr ) |
Definition at line 151 of file statistics.cc.
gem5::statistics::Formula::Formula | ( | Group * | parent, |
const char * | name, | ||
const char * | desc, | ||
const Temp & | r ) |
Definition at line 157 of file statistics.cc.
References gem5::MipsISA::r.
gem5::statistics::Formula::Formula | ( | Group * | parent, |
const char * | name, | ||
const units::Base * | unit, | ||
const char * | desc, | ||
const Temp & | r ) |
Definition at line 165 of file statistics.cc.
References gem5::MipsISA::r.
Add the given tree to the existing one.
r | The root of the expression tree. |
Definition at line 183 of file statistics.cc.
References gem5::MipsISA::r, root, gem5::statistics::InfoAccess::setInit(), and size().
Divide the existing tree by the given one.
r | The root of the expression tree. |
Definition at line 197 of file statistics.cc.
References gem5::MipsISA::r, root, and size().
|
inline |
Definition at line 2569 of file statistics.hh.
References Temp, and gem5::ArmISA::v.
Set an unitialized Formula to the given root.
r | The root of the expression tree. |
Definition at line 173 of file statistics.cc.
References gem5::MipsISA::r, root, gem5::statistics::InfoAccess::setInit(), and size().
|
inline |
Definition at line 2615 of file statistics.hh.
void gem5::statistics::Formula::reset | ( | ) |
Formulas don't need to be reset.
Definition at line 230 of file statistics.cc.
void gem5::statistics::Formula::result | ( | VResult & | vec | ) | const |
Return the result of the Fomula in a vector.
If there were no Vector components to the Formula, then the vector is size 1. If there were, like x/y with x being a vector of size 3, then the result returned will be x[0]/y, x[1]/y, x[2]/y, respectively.
Definition at line 208 of file statistics.cc.
References root, and gem5::PowerISA::vec.
Referenced by gem5::statistics::FormulaNode::result(), and zero().
size_type gem5::statistics::Formula::size | ( | ) | const |
Return the number of elements in the tree.
Definition at line 221 of file statistics.cc.
References root.
Referenced by operator+=(), operator/=(), operator=(), and gem5::statistics::FormulaNode::size().
std::string gem5::statistics::Formula::str | ( | ) | const |
Definition at line 246 of file statistics.cc.
References root.
Referenced by gem5::statistics::FormulaNode::str().
Result gem5::statistics::Formula::total | ( | ) | const |
Return the total Formula result.
If there is a Vector component to this Formula, then this is the result of the Formula if the formula is applied after summing all the components of the Vector. For example, if Formula is x/y where x is size 3, then total() will return (x[1]+x[2]+x[3])/y. If there is no Vector component, total() returns the same value as the first entry in the VResult val() returns.
Definition at line 215 of file statistics.cc.
References root.
Referenced by gem5::statistics::FormulaNode::total().
bool gem5::statistics::Formula::zero | ( | ) | const |
Definition at line 235 of file statistics.cc.
References gem5::ArmISA::i, result(), and gem5::PowerISA::vec.
|
friend |
Definition at line 2543 of file statistics.hh.
Referenced by operator=().
|
protected |
The root of the tree which represents the Formula.
Definition at line 2542 of file statistics.hh.
Referenced by operator+=(), operator/=(), operator=(), result(), size(), str(), and total().