1/* |
2 * Copyright (c) 2014-2015 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 --- 21 unchanged lines hidden (view full) --- 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 * Authors: Geoffrey Blake 38 */ 39 |
40#include "sim/sub_system.hh" 41 |
42#include "params/SubSystem.hh" 43#include "sim/sub_system.hh" |
44#include "sim/power/power_model.hh" |
45#include "sim/power/thermal_domain.hh" 46 47SubSystem::SubSystem(const Params *p) 48 : SimObject(p) 49{ 50 // Link thermalDomain <-> SubSystem 51 if (p->thermal_domain) 52 p->thermal_domain->setSubSystem(this); 53} 54 |
55double 56SubSystem::getDynamicPower() const 57{ 58 double ret = 0.0f; 59 for (auto &obj: powerProducers) 60 ret += obj->getDynamicPower(); 61 return ret; 62} 63 64double 65SubSystem::getStaticPower() const 66{ 67 double ret = 0.0f; 68 for (auto &obj: powerProducers) 69 ret += obj->getStaticPower(); 70 return ret; 71} 72 |
73SubSystem * 74SubSystemParams::create() 75{ 76 return new SubSystem(this); 77} |