Go to the documentation of this file.
43 #include "params/MathExprPowerModel.hh"
59 for (
auto var: vars) {
61 if (var ==
"temp" || var ==
"voltage" || var ==
"clock_period") {
66 fatal_if(!info,
"Failed to evaluate %s in expression:\n%s\n",
78 this, std::placeholders::_1)
85 using namespace Stats;
90 }
else if (
name ==
"voltage") {
92 }
else if (
name==
"clock_period") {
98 const Info *info = it->second;
108 panic(
"Unknown stat type!\n");
118 MathExprPowerModelParams::create()
void startup() override
startup() is the final initialization call before simulation.
std::unordered_map< std::string, const Stats::Info * > statsMap
void regStats()
Callback to set stat parameters.
const Info * resolve(const std::string &name)
MathExprPowerModelParams Params
MathExprPowerModel(const Params *p)
const std::string & name()
virtual const std::string name() const
double eval(const MathExpr &expr) const
Evaluate an expression in the context of this object, fatal if evaluation fails.
void regStats() override
Callback to set stat parameters.
double eval(EvalCallback fn) const
Evaluates the expression.
double _temp
Current temperature.
A PowerModelState is an abstract class used as interface to get power figures out of SimObjects.
ClockedObject * clocked_object
The clocked object we belong to.
double getStatValue(const std::string &name) const
Get the value for a variable (maps to a stat)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17