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.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/sim/clock_domain.cc') diff --git a/src/sim/clock_domain.cc b/src/sim/clock_domain.cc index 262ae904c..8b563d598 100644 --- a/src/sim/clock_domain.cc +++ b/src/sim/clock_domain.cc @@ -44,8 +44,16 @@ #include "params/DerivedClockDomain.hh" #include "params/SrcClockDomain.hh" #include "sim/clock_domain.hh" +#include "sim/voltage_domain.hh" -SrcClockDomain::SrcClockDomain(const Params *p) : ClockDomain(p) +double +ClockDomain::voltage() const +{ + return _voltageDomain->voltage(); +} + +SrcClockDomain::SrcClockDomain(const Params *p) : + ClockDomain(p, p->voltage_domain) { clockPeriod(p->clock); } @@ -76,7 +84,7 @@ SrcClockDomainParams::create() } DerivedClockDomain::DerivedClockDomain(const Params *p) : - ClockDomain(p), + ClockDomain(p, p->clk_domain->voltageDomain()), parent(*p->clk_domain), clockDivider(p->clk_divider) { -- cgit v1.2.3