#include "sim/sub_system.hh"
PowerModelState::PowerModelState(const Params &p)
- : SimObject(p), _temp(0), clocked_object(NULL)
+ : SimObject(p), _temp(0), clocked_object(NULL),
+ ADD_STAT(dynamicPower, "Dynamic power for this object (Watts)"),
+ ADD_STAT(staticPower, "Static power for this object (Watts)")
{
+ dynamicPower
+ .method(this, &PowerModelState::getDynamicPower);
+ staticPower
+ .method(this, &PowerModelState::getStaticPower);
}
PowerModel::PowerModel(const Params &p)
: SimObject(p), states_pm(p.pm), subsystem(p.subsystem),
- clocked_object(NULL), power_model_type(p.pm_type)
+ clocked_object(NULL), power_model_type(p.pm_type),
+ ADD_STAT(dynamicPower, "Dynamic power for this power state"),
+ ADD_STAT(staticPower, "Static power for this power state")
{
panic_if(subsystem == NULL,
"Subsystem is NULL! This is not acceptable for a PowerModel!\n");
pms->setTemperature(p.ambient_temp);
}
+ dynamicPower
+ .method(this, &PowerModel::getDynamicPower);
+ staticPower
+ .method(this, &PowerModel::getStaticPower);
+
}
void
clocked_object = clkobj;
}
- void regStats() {
- SimObject::regStats();
-
- dynamicPower
- .method(this, &PowerModelState::getDynamicPower)
- .name(params().name + ".dynamic_power")
- .desc("Dynamic power for this object (Watts)")
- ;
-
- staticPower
- .method(this, &PowerModelState::getStaticPower)
- .name(params().name + ".static_power")
- .desc("Static power for this object (Watts)")
- ;
- }
-
protected:
- Stats::Value dynamicPower, staticPower;
/** Current temperature */
double _temp;
/** The clocked object we belong to */
ClockedObject * clocked_object;
+
+ Stats::Value dynamicPower, staticPower;
};
/**
*/
double getStaticPower() const;
- void regStats() {
- SimObject::regStats();
-
- dynamicPower
- .method(this, &PowerModel::getDynamicPower)
- .name(params().name + ".dynamic_power")
- .desc("Dynamic power for this power state")
- ;
-
- staticPower
- .method(this, &PowerModel::getStaticPower)
- .name(params().name + ".static_power")
- .desc("Static power for this power state")
- ;
- }
-
void setClockedObject(ClockedObject *clkobj);
virtual void regProbePoints();
PowerModel ±
};
- Stats::Value dynamicPower, staticPower;
-
/** Actual power models (one per power state) */
std::vector<PowerModelState*> states_pm;
/** The type of power model - collects all power, static or dynamic only */
Enums::PMType power_model_type;
+
+ Stats::Value dynamicPower, staticPower;
};
#endif
ThermalDomain::ThermalDomain(const Params &p)
: SimObject(p), _initTemperature(p.initial_temperature),
- node(NULL), subsystem(NULL)
+ node(NULL), subsystem(NULL),
+ ADD_STAT(currentTemp, "Temperature in centigrade degrees")
{
+ currentTemp
+ .method(this, &ThermalDomain::currentTemperature);
}
double
"thermalUpdate");
}
-void
-ThermalDomain::regStats()
-{
- SimObject::regStats();
-
- currentTemp
- .method(this, &ThermalDomain::currentTemperature)
- .name(params().name + ".temp")
- .desc("Temperature in centigrate degrees")
- ;
-}
-
void
ThermalDomain::emitUpdate()
{
*/
void setSubSystem(SubSystem * ss);
- void regStats() override;
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp) override;