43a44,45
> #include <vector>
>
45a48
> #include "sim/clock_domain.hh"
54a58
> public:
56c60,61
< private:
---
> typedef VoltageDomainParams Params;
> VoltageDomain(const Params *p);
59c64,66
< * The voltage of the domain expressed in Volts
---
> * Get the current voltage.
> *
> * @return Voltage of the domain
61c68
< double _voltage;
---
> double voltage() const { return voltageOpPoints[_perfLevel]; }
62a70,73
> uint32_t numVoltages() const { return (uint32_t)voltageOpPoints.size(); }
>
> typedef SrcClockDomain::PerfLevel PerfLevel;
>
64c75,76
< * Stat for reporting voltage of the domain
---
> * Set the voltage point of the domain.
> * @param Voltage value to be set
66c78
< Stats::Value currentVoltage;
---
> void perfLevel(PerfLevel perf_level);
68c80,84
< public:
---
> /**
> * Get the voltage point of the domain.
> * @param Voltage value to be set
> */
> PerfLevel perfLevel() const { return _perfLevel; }
70,71c86,93
< typedef VoltageDomainParams Params;
< VoltageDomain(const Params *p);
---
> /**
> * Register a SrcClockDomain with this voltage domain.
> * @param src_clock_domain The SrcClockDomain to register.
> */
> void registerSrcClockDom(SrcClockDomain *src_clock_dom) {
> assert(src_clock_dom->voltageDomain() == this);
> srcClockChildren.push_back(src_clock_dom);
> }
74,76c96,97
< * Get the current volate.
< *
< * @return Voltage of the domain
---
> * Startup has all SrcClockDomains registered with this voltage domain, so
> * try to make sure that all perf level requests from them are met.
78c99
< inline double voltage() const { return _voltage; }
---
> void startup();
81c102,108
< * Set the voltage of the domain.
---
> * Recomputes the highest (fastest, i.e., numerically lowest) requested
> * performance level of all associated clock domains, and updates the
> * performance level of this voltage domain to match. This means that for
> * two connected clock domains, one fast and one slow, the voltage domain
> * will provide the voltage associated with the fast DVFS operation point.
> * Must be called whenever a clock domain decides to swtich its performance
> * level.
83c110
< * @param Voltage value to be set
---
> * @return True, if the voltage was actually changed.
85c112
< void voltage(double voltage);
---
> bool sanitiseVoltages();
88a116,140
> void serialize(std::ostream &os);
> void unserialize(Checkpoint *cp, const std::string &section);
> private:
> typedef std::vector<double> Voltages;
> /**
> * List of possible minimum voltage at each of the frequency operational
> * points, should be in descending order and same size as freqOpPoints.
> * An empty list corresponds to default voltage specified for the voltage
> * domain its clock domain belongs. The same voltage is applied for each
> * freqOpPoints, overall implying NO DVS
> */
> const Voltages voltageOpPoints;
> PerfLevel _perfLevel;
>
> /**
> * Stat for reporting voltage of the domain
> */
> Stats::Value currentVoltage;
>
> /**
> * List of associated SrcClockDomains that are connected to this voltage
> * domain.
> */
> typedef std::vector<SrcClockDomain *> SrcClockChildren;
> SrcClockChildren srcClockChildren;