gem5 v24.0.0.0
Loading...
Searching...
No Matches
power_domain.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017, 2019-2020 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions are
16 * met: redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer;
18 * redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution;
21 * neither the name of the copyright holders nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 */
38
39#ifndef __SIM_POWER_DOMAIN_HH__
40#define __SIM_POWER_DOMAIN_HH__
41
42#include <string>
43#include <vector>
44
45#include "base/statistics.hh"
46#include "params/PowerDomain.hh"
47#include "sim/clocked_object.hh"
48#include "sim/power_state.hh"
49
50namespace gem5
51{
52
59class PowerDomain : public PowerState
60{
61 public:
62 PowerDomain(const PowerDomainParams &p);
63 typedef PowerDomainParams Params;
64 ~PowerDomain() override {};
65
72 void startup() override;
73
79 void pwrStateChangeCallback(enums::PwrState new_pwr_state,
80 PowerState* leader);
81
86 void addFollower(PowerState* pwr_obj) override;
87
88 private:
98 enums::PwrState calculatePowerDomainState(
99 const std::vector<enums::PwrState> &f_states={});
100
105 bool isPossiblePwrState(enums::PwrState p_state);
106
113
120
121 private: /* Power domain attributes */
130
136 enums::PwrState leaderTargetState;
137
144
150
156
157 protected:
167};
168
169} // namespace gem5
170
171#endif // __SIM_POWER_DOMAIN_HH__
Wrap a member function inside MemberEventWrapper to use it as an event callback.
Definition eventq.hh:1092
The PowerDomain groups PowerState objects together to regulate their power states.
PowerDomain(const PowerDomainParams &p)
std::vector< PowerState * > followers
List of all followers in the PowerDomain.
enums::PwrState calculatePowerDomainState(const std::vector< enums::PwrState > &f_states={})
Calculate the power state of the power domain, based upon the power states of the leaders.
void calculatePossiblePwrStates()
Calculate the possible power states of the domain based upon the intersection of the power states of ...
void startup() override
During startup, the list of possible power states the PowerDomain can be in is populated,...
PowerDomainParams Params
void addFollower(PowerState *pwr_obj) override
Function called by a follower to register itself as a dependant of this power domain.
void pwrStateChangeCallback(enums::PwrState new_pwr_state, PowerState *leader)
Register the change in power state in one of the leader.
enums::PwrState leaderTargetState
Power state requested by the leader.
const Tick updateLatency
Latency with which power state changes of the leaders will ripple through to the followers.
gem5::PowerDomain::PowerDomainStats stats
void setFollowerPowerStates()
Update the followers of the newly updated power state.
~PowerDomain() override
std::vector< PowerState * > leaders
List of all leaders in the PowerDomain.
bool isPossiblePwrState(enums::PwrState p_state)
Check if a given p_state is available across all leaders and followers in this domain.
MemberEventWrapper<&PowerDomain::setFollowerPowerStates > pwrStateUpdateEvent
Event to update the power states of the followers.
Helper class for objects that have power states.
Statistics container.
Definition group.hh:93
This is a simple scalar statistic, like a counter.
STL vector class.
Definition stl.hh:37
ClockedObject declaration and implementation.
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Tick
Tick count type.
Definition types.hh:58
PowerState declaration and implementation.
Declaration of Statistics objects.
void regStats() override
Callback to set stat parameters.
statistics::Scalar numLeaderCallsChangingState

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0