class EnergyModel
Defined at line 237 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
EnergyModel describes the power consumption rates of the available active and
idle states a processor may enter, which interfaces to use to effect state
transitions, and properties of the state transitions, such as energy cost and
latency. This information is used to make efficient scheduling and load
balancing decisions that meet the power vs. performance tradeoffs specified
by a product.
An energy model is constant once initialized. Updating the active energy
model requires replacing it with a new instance and incrementing a generation
count to detect stale values derived from the previous energy model.
Public Methods
zx::result<EnergyModel> Create (std::span<const zx_processor_power_level_t> levels, std::span<const zx_processor_power_level_transition_t> transitions)
Defined at line 29 of file ../../zircon/kernel/lib/power-management/energy-model.cc
zx::result<EnergyModel> Create (std::span<const zx_processor_power_level_t> levels, std::span<const zx_processor_power_level_transition_t> transitions)
Defined at line 29 of file ../../zircon/kernel/lib/power-management/energy-model.cc
std::optional<uint8_t> FindPowerLevel (ControlInterface interface_id, uint64_t control_argument)
Defined at line 174 of file ../../zircon/kernel/lib/power-management/energy-model.cc
const PowerLevel * FindActivePowerLevelForRate (ProcessingRate processing_rate)
Returns the lowest active power level that is compatible with (i.e. has a
processing rate greater or equal to) the given processing rate. However, to
simplify power calculations, the maximum active power level is returned if
the given rate exceeds the maximum processing rate for the power domain.
Defined at line 197 of file ../../zircon/kernel/lib/power-management/energy-model.cc
void EnergyModel ()
Defined at line 243 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
void EnergyModel (const EnergyModel & )
Defined at line 244 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
void EnergyModel (EnergyModel && )
Defined at line 245 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
std::span<const PowerLevel> levels ()
All power levels described in the model, sorted by processing power and energy consumption.
(1) The processing rate of power level i is less or equal than the processing rate of power
level j, where i
<
= j.
(2) The energy cost of power level i is less or equal than the processing rate of power level
j, where i
<
= j.
Defined at line 254 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
std::span<const PowerLevel> idle_levels ()
Following the same rules as `levels()` but returns only the set of power levels whose type is
`PowerLevel::Type::kIdle`. This set may be empty.
Defined at line 258 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
std::optional<uint8_t> max_idle_power_level ()
Returns the idle power level with the maximum power consumption.
Defined at line 263 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
std::optional<uint64_t> max_idle_power_coefficient_nw ()
Returns the power coefficient of the idle power level with the maximum power consumption. This
idle power level typically corresponds to clock gating, such that the power consumption is
almost entirely leakage power loss.
Defined at line 273 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
std::optional<ControlInterface> max_idle_power_level_interface ()
Returns the control interface of the idle power level with the maximum power consumption.
Defined at line 281 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
ProcessingRate max_processing_rate ()
Returns the processing rate of the fastest power level.
Defined at line 289 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
std::span<const PowerLevel> active_levels ()
Following the same rules as `levels()` but returns only the set of power levels whose type is
`PowerLevel::Type::kActive`. This set may be empty.
Defined at line 295 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h
TransitionMatrix transitions ()
Returns a transition matrix, where the entry
,j> represents the transition costs for
transitioning from i to j.
Defined at line 301 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/energy-model.h