41#include "params/PowerModel.hh"
42#include "params/PowerModelState.hh"
50 :
SimObject(
p), _temp(0), clocked_object(NULL),
51 ADD_STAT(dynamicPower, statistics::units::Watt::get(),
52 "Dynamic power for this object (Watts)"),
53 ADD_STAT(staticPower, statistics::units::Watt::get(),
54 "Static power for this object (Watts)")
64 clocked_object(NULL), power_model_type(
p.pm_type),
65 ADD_STAT(dynamicPower, statistics::units::Watt::get(),
66 "Dynamic power for this power state"),
67 ADD_STAT(staticPower, statistics::units::Watt::get(),
68 "Static power for this power state")
71 "Subsystem is NULL! This is not acceptable for a PowerModel!\n");
76 pms->setTemperature(
p.ambient_temp);
92 pms->setClockedObject(clkobj);
99 pms->setTemperature(temp);
125 warn_if(
w[enums::PwrState::UNDEFINED] > 0,
126 "SimObject in UNDEFINED power state! Power figures might be wrong!\n");
153 warn(
"SimObject in UNDEFINED power state! "
154 "Power figures might be wrong!\n");
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
PowerModelStateParams Params
statistics::Value dynamicPower
PowerModelState(const Params &p)
virtual double getDynamicPower() const =0
Get the dynamic power consumption.
virtual double getStaticPower() const =0
Get the static power consumption.
statistics::Value staticPower
Listener class to catch thermal events.
virtual void regProbePoints()
Register probe points for this object.
enums::PMType power_model_type
The type of power model - collects all power, static or dynamic only.
statistics::Value staticPower
double getStaticPower() const
Get the static power consumption.
void setClockedObject(ClockedObject *clkobj)
ClockedObject * clocked_object
The clocked object we belong to.
PowerModel(const Params &p)
SubSystem * subsystem
The subsystem this power model belongs to.
void thermalUpdateCallback(const Temperature &temp)
std::vector< PowerModelState * > states_pm
Actual power models (one per power state)
double getDynamicPower() const
Get the dynamic power consumption.
statistics::Value dynamicPower
std::unique_ptr< ThermalProbeListener > thermalListener
Listener to catch temperature changes in the SubSystem.
std::vector< double > getWeights() const
Returns the percentage residency for each power state.
Abstract superclass for simulation objects.
void registerPowerProducer(PowerModel *pm)
The class stores temperatures in Kelvin and provides helper methods to convert to/from Celsius.
Derived & method(T *obj, V(T::*method)() const)
Extended functor that calls the specified method of the provided object.
ClockedObject declaration and implementation.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
ProbeManager * getProbeManager()
Get the probe manager for this object.
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Declaration of Statistics objects.