41 #include "params/PowerModel.hh" 42 #include "params/PowerModelState.hh" 47 :
SimObject(p), _temp(0), clocked_object(NULL)
52 :
SimObject(p), states_pm(p->pm), subsystem(p->subsystem),
56 "Subsystem is NULL! This is not acceptable for a PowerModel!\n");
61 pms->setTemperature(p->ambient_temp);
72 pms->setClockedObject(clkobj);
79 pms->setTemperature(temp);
91 PowerModelParams::create()
108 assert(w.size() - 1 ==
states_pm.size());
111 warn_if(w[Enums::PwrState::UNDEFINED] > 0,
112 "SimObject in UNDEFINED power state! Power figures might be wrong!\n");
117 power +=
states_pm[
i]->getDynamicPower() * w[
i + 1];
135 assert(w.size() - 1 ==
states_pm.size());
139 warn(
"SimObject in UNDEFINED power state! " 140 "Power figures might be wrong!\n");
148 power +=
states_pm[
i]->getStaticPower() * w[
i + 1];
Enums::PMType power_model_type
The type of power model - collects all power, static or dynamic only.
Listener class to catch thermal events.
void registerPowerProducer(PowerModel *pm)
Declaration of Statistics objects.
std::vector< PowerModelState * > states_pm
Actual power models (one per power state)
double getStaticPower() const
Get the static power consumption.
PowerModelStateParams Params
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.
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
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.
ClockedObject * clocked_object
The clocked object we belong to.
PowerModelState(const Params *p)
ProbeManager * getProbeManager()
Get the probe manager for this object.
double getDynamicPower() const
Get the dynamic power consumption.
PowerModel(const Params *p)
void thermalUpdateCallback(const double &temp)
void setClockedObject(ClockedObject *clkobj)
std::vector< double > getWeights() const
Returns the percentage residency for each power state.
std::unique_ptr< ThermalProbeListener > thermalListener
Listener to catch temperature changes in the SubSystem.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Abstract superclass for simulation objects.