From bfff0c40df3a198aeef4fd5b0ca5e0b49904e208 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 19 Jan 2021 10:29:27 +0000 Subject: [PATCH] sim: Thermal model style fixes Fix various style issues in the thermal model implementation. Change-Id: Ie31c862a23885f32f2931e927d7f87b7992bd099 Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39220 Reviewed-by: Gabe Black Reviewed-by: Daniel Carvalho Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/sim/power/thermal_model.cc | 24 +++++++++++++++++++----- src/sim/power/thermal_model.hh | 8 ++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/sim/power/thermal_model.cc b/src/sim/power/thermal_model.cc index 408642ccf..9f970dede 100644 --- a/src/sim/power/thermal_model.cc +++ b/src/sim/power/thermal_model.cc @@ -39,6 +39,7 @@ #include "base/statistics.hh" #include "params/ThermalCapacitor.hh" +#include "params/ThermalModel.hh" #include "params/ThermalReference.hh" #include "params/ThermalResistor.hh" #include "sim/clocked_object.hh" @@ -253,24 +254,37 @@ ThermalModel::startup() schedule(stepEvent, curTick() + SimClock::Int::s * _step); } -void ThermalModel::addDomain(ThermalDomain * d) { +void +ThermalModel::addDomain(ThermalDomain * d) +{ domains.push_back(d); entities.push_back(d); } -void ThermalModel::addReference(ThermalReference * r) { + +void +ThermalModel::addReference(ThermalReference * r) +{ references.push_back(r); entities.push_back(r); } -void ThermalModel::addCapacitor(ThermalCapacitor * c) { + +void +ThermalModel::addCapacitor(ThermalCapacitor * c) +{ capacitors.push_back(c); entities.push_back(c); } -void ThermalModel::addResistor(ThermalResistor * r) { + +void +ThermalModel::addResistor(ThermalResistor * r) +{ resistors.push_back(r); entities.push_back(r); } -double ThermalModel::getTemp() const { +double +ThermalModel::getTemp() const +{ // Just pick the highest temperature double temp = 0; for (auto & n : eq_nodes) diff --git a/src/sim/power/thermal_model.hh b/src/sim/power/thermal_model.hh index 81c1de8f2..295e5080f 100644 --- a/src/sim/power/thermal_model.hh +++ b/src/sim/power/thermal_model.hh @@ -40,16 +40,16 @@ #include -#include "params/ThermalCapacitor.hh" -#include "params/ThermalModel.hh" -#include "params/ThermalReference.hh" -#include "params/ThermalResistor.hh" #include "sim/clocked_object.hh" #include "sim/power/thermal_domain.hh" #include "sim/power/thermal_entity.hh" #include "sim/power/thermal_node.hh" #include "sim/sim_object.hh" +struct ThermalCapacitorParams; +struct ThermalModelParams; +struct ThermalReferenceParams; +struct ThermalResistorParams; /** * A ThermalResistor is used to model a thermal resistance between two -- 2.30.2