dvfs_handler.hh (10360:919c02740209) dvfs_handler.hh (10395:77b9f96786c1)
1/*
2 * Copyright (c) 2013-2014 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

--- 38 unchanged lines hidden (view full) ---

47 */
48
49
50#ifndef __SIM_DVFS_HANDLER_HH__
51#define __SIM_DVFS_HANDLER_HH__
52
53#include <vector>
54
1/*
2 * Copyright (c) 2013-2014 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

--- 38 unchanged lines hidden (view full) ---

47 */
48
49
50#ifndef __SIM_DVFS_HANDLER_HH__
51#define __SIM_DVFS_HANDLER_HH__
52
53#include <vector>
54
55#include "debug/DVFS.hh"
55#include "params/ClockDomain.hh"
56#include "params/DVFSHandler.hh"
57#include "params/VoltageDomain.hh"
58#include "sim/clock_domain.hh"
59#include "sim/eventq.hh"
60#include "sim/sim_object.hh"
56#include "params/ClockDomain.hh"
57#include "params/DVFSHandler.hh"
58#include "params/VoltageDomain.hh"
59#include "sim/clock_domain.hh"
60#include "sim/eventq.hh"
61#include "sim/sim_object.hh"
62#include "sim/voltage_domain.hh"
61
63
62
63/**
64 * DVFS Handler class, maintains a list of all the domains it can handle.
65 * Each entry of that list is an object of the DomainConfig class, and the
66 * handler uses the methods provided by that class to get access to the
67 * configuration of each domain. The handler is responsible for setting/getting
68 * clock periods and voltages from clock/voltage domains.
69 * The handler acts the bridge between software configurable information
70 * for each domain as provided to the controller and the hardware

--- 4 unchanged lines hidden (view full) ---

75 public:
76 typedef DVFSHandlerParams Params;
77 DVFSHandler(const Params *p);
78
79 typedef SrcClockDomain::DomainID DomainID;
80 typedef SrcClockDomain::PerfLevel PerfLevel;
81
82 /**
64/**
65 * DVFS Handler class, maintains a list of all the domains it can handle.
66 * Each entry of that list is an object of the DomainConfig class, and the
67 * handler uses the methods provided by that class to get access to the
68 * configuration of each domain. The handler is responsible for setting/getting
69 * clock periods and voltages from clock/voltage domains.
70 * The handler acts the bridge between software configurable information
71 * for each domain as provided to the controller and the hardware

--- 4 unchanged lines hidden (view full) ---

76 public:
77 typedef DVFSHandlerParams Params;
78 DVFSHandler(const Params *p);
79
80 typedef SrcClockDomain::DomainID DomainID;
81 typedef SrcClockDomain::PerfLevel PerfLevel;
82
83 /**
84 * Get the number of domains assigned to this DVFS handler.
85 * @return Number of domains
86 */
87 uint32_t numDomains() const { return domainIDList.size(); }
88
89 /**
90 * Get the n-th domain ID, from the domains managed by this handler.
91 * @return Domain ID
92 */
93 DomainID domainID(uint32_t index) const;
94
95 /**
83 * Check whether a domain ID is known to the handler or not.
84 * @param domain_id Domain ID to check
85 * @return Domain ID known to handler?
86 */
87 bool validDomainID(DomainID domain_id) const;
88
89 /**
90 * Get transition latency to switch between performance levels.

--- 32 unchanged lines hidden (view full) ---

123 * the respective domain
124 */
125 Tick clkPeriodAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
126 {
127 return findDomain(domain_id)->clkPeriodAtPerfLevel(perf_level);
128 }
129
130 /**
96 * Check whether a domain ID is known to the handler or not.
97 * @param domain_id Domain ID to check
98 * @return Domain ID known to handler?
99 */
100 bool validDomainID(DomainID domain_id) const;
101
102 /**
103 * Get transition latency to switch between performance levels.

--- 32 unchanged lines hidden (view full) ---

136 * the respective domain
137 */
138 Tick clkPeriodAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
139 {
140 return findDomain(domain_id)->clkPeriodAtPerfLevel(perf_level);
141 }
142
143 /**
144 * Read the voltage of the specified domain at the specified
145 * performance level.
146 * @param domain_id Domain ID to query
147 * @param perf_level Performance level of interest
148 * @return Voltage for the requested performance level of the respective
149 * domain
150 */
151 double voltageAtPerfLevel(DomainID domain_id, PerfLevel perf_level) const
152 {
153 return findDomain(domain_id)->voltageDomain()->voltage(perf_level);
154 }
155
156 /**
131 * Get the total number of available performance levels.
132 *
133 * @param domain_id Domain ID to query
134 * @return Number of performance levels that where configured for the
135 * respective domain
136 */
137 PerfLevel numPerfLevels(PerfLevel domain_id) const
138 {

--- 10 unchanged lines hidden (view full) ---

149 void serialize(std::ostream &os);
150 void unserialize(Checkpoint *cp, const std::string &section);
151
152 private:
153 typedef std::map<DomainID, SrcClockDomain*> Domains;
154 Domains domains;
155
156 /**
157 * Get the total number of available performance levels.
158 *
159 * @param domain_id Domain ID to query
160 * @return Number of performance levels that where configured for the
161 * respective domain
162 */
163 PerfLevel numPerfLevels(PerfLevel domain_id) const
164 {

--- 10 unchanged lines hidden (view full) ---

175 void serialize(std::ostream &os);
176 void unserialize(Checkpoint *cp, const std::string &section);
177
178 private:
179 typedef std::map<DomainID, SrcClockDomain*> Domains;
180 Domains domains;
181
182 /**
183 * List of IDs avaiable in the domain list
184 */
185 std::vector<DomainID> domainIDList;
186
187 /**
157 * Clock domain of the system the handler is instantiated.
158 */
159 SrcClockDomain* sysClkDomain;
160
161 /**
162 * Search for a domain based on the domain ID.
163 *
164 * @param domain_id Domain ID to search for

--- 67 unchanged lines hidden ---
188 * Clock domain of the system the handler is instantiated.
189 */
190 SrcClockDomain* sysClkDomain;
191
192 /**
193 * Search for a domain based on the domain ID.
194 *
195 * @param domain_id Domain ID to search for

--- 67 unchanged lines hidden ---