43 #include "params/PowerModel.hh"
44 #include "params/PowerModelState.hh"
49 :
SimObject(p), _temp(0), clocked_object(NULL)
54 :
SimObject(p), states_pm(p->pm), subsystem(p->subsystem),
58 "Subsystem is NULL! This is not acceptable for a PowerModel!\n");
68 pms->setClockedObject(clkobj);
75 pms->setTemperature(temp);
87 PowerModelParams::create()
100 assert(w.size() - 1 ==
states_pm.size());
103 warn_if(w[Enums::PwrState::UNDEFINED] > 0,
104 "SimObject in UNDEFINED power state! Power figures might be wrong!\n");
109 power +=
states_pm[
i]->getDynamicPower() * w[
i + 1];
122 assert(w.size() - 1 ==
states_pm.size());
126 warn(
"SimObject in UNDEFINED power state! "
127 "Power figures might be wrong!\n");
135 power +=
states_pm[
i]->getStaticPower() * w[
i + 1];
double getDynamicPower() const
Get the dynamic power consumption.
panic_if(!root,"Invalid expression\n")
Listener class to catch thermal events.
void registerPowerProducer(PowerModel *pm)
double getStaticPower() const
Get the static power consumption.
Declaration of Statistics objects.
std::vector< PowerModelState * > states_pm
Actual power models (one per power state)
PowerModelStateParams Params
A PowerModel is a class containing a power model for a SimObject.
uint64_t power(uint32_t n, uint32_t e)
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
ClockedObject declaration and implementation.
virtual void regProbePoints()
Register probe points for this object.
SubSystem * subsystem
The subsystem this power model belongs to.
ClockedObject * clocked_object
The clocked object we belong to.
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
PowerModelState(const Params *p)
PowerModel(const Params *p)
void thermalUpdateCallback(const double &temp)
std::vector< double > pwrStateWeights() const
Returns the percentage residency for each power state.
ProbeManager * getProbeManager()
Get the probe manager for this object.
void setClockedObject(ClockedObject *clkobj)
std::unique_ptr< ThermalProbeListener > thermalListener
Listener to catch temperature changes in the SubSystem.
Abstract superclass for simulation objects.