From e7e17f92db8b249aaf99eb93a2447937d78270d5 Mon Sep 17 00:00:00 2001 From: Akash Bagdia Date: Mon, 19 Aug 2013 03:52:28 -0400 Subject: power: Add voltage domains to the clock domains This patch adds the notion of voltage domains, and groups clock domains that operate under the same voltage (i.e. power supply) into domains. Each clock domain is required to be associated with a voltage domain, and the latter requires the voltage to be explicitly set. A voltage domain is an independently controllable voltage supply being provided to section of the design. Thus, if you wish to perform dynamic voltage scaling on a CPU, its clock domain should be associated with a separate voltage domain. The current implementation of the voltage domain does not take into consideration cases where there are derived voltage domains running at ratio of native voltage domains, as with the case where there can be on-chip buck/boost (charge pumps) voltage regulation logic. The regression and configuration scripts are updated with a generic voltage domain for the system, and one for the CPUs. --- src/sim/clock_domain.hh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/sim/clock_domain.hh') diff --git a/src/sim/clock_domain.hh b/src/sim/clock_domain.hh index c3f53e675..619f30696 100644 --- a/src/sim/clock_domain.hh +++ b/src/sim/clock_domain.hh @@ -56,10 +56,12 @@ * Forward declaration */ class DerivedClockDomain; +class VoltageDomain; /** * The ClockDomain provides clock to group of clocked objects bundled - * under the same clock domain. The clock domains provide support for + * under the same clock domain. The clock domains, in turn, are + * grouped into voltage domains. The clock domains provide support for * a hierarchial structure with source and derived domains. */ class ClockDomain : public SimObject @@ -73,6 +75,11 @@ class ClockDomain : public SimObject */ Tick _clockPeriod; + /** + * Voltage domain this clock domain belongs to + */ + VoltageDomain *_voltageDomain; + /** * Pointers to potential derived clock domains so we can propagate * changes. @@ -82,7 +89,10 @@ class ClockDomain : public SimObject public: typedef ClockDomainParams Params; - ClockDomain(const Params *p) : SimObject(p), _clockPeriod(0) {} + ClockDomain(const Params *p, VoltageDomain *voltage_domain) : + SimObject(p), + _clockPeriod(0), + _voltageDomain(voltage_domain) {} /** * Get the clock period. @@ -91,6 +101,21 @@ class ClockDomain : public SimObject */ inline Tick clockPeriod() const { return _clockPeriod; } + /** + * Get the voltage domain. + * + * @return Voltage domain this clock domain belongs to + */ + inline VoltageDomain *voltageDomain() const { return _voltageDomain; } + + + /** + * Get the current voltage this clock domain operates at. + * + * @return Voltage applied to the clock domain + */ + inline double voltage() const; + /** * Add a derived domain. * -- cgit v1.2.3