From: Andreas Sandberg Date: Tue, 19 Jan 2021 10:36:11 +0000 (+0000) Subject: sim: Don't serialise params in thermal models X-Git-Tag: develop-gem5-snapshot~268 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5fca1729e30f571790b2823fd1aa060fcd7e8f38;p=gem5.git sim: Don't serialise params in thermal models ThermalDomain and ThermalReference shouldn't serialise their params. Change-Id: Idc4438b68c0db1fe312d37888c901f2ea87b1d60 Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39221 Reviewed-by: Gabe Black Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/sim/power/thermal_domain.cc b/src/sim/power/thermal_domain.cc index e9f4d3ca2..a5eb33c8e 100644 --- a/src/sim/power/thermal_domain.cc +++ b/src/sim/power/thermal_domain.cc @@ -46,7 +46,6 @@ #include "sim/linear_solver.hh" #include "sim/power/thermal_model.hh" #include "sim/probe/probe.hh" -#include "sim/serialize.hh" #include "sim/sub_system.hh" ThermalDomain::ThermalDomain(const Params &p) @@ -80,18 +79,6 @@ ThermalDomain::emitUpdate() ppThermalUpdate->notify(node->temp); } -void -ThermalDomain::serialize(CheckpointOut &cp) const -{ - SERIALIZE_SCALAR(_initTemperature); -} - -void -ThermalDomain::unserialize(CheckpointIn &cp) -{ - UNSERIALIZE_SCALAR(_initTemperature); -} - LinearEquation ThermalDomain::getEquation(ThermalNode * tn, unsigned n, double step) const diff --git a/src/sim/power/thermal_domain.hh b/src/sim/power/thermal_domain.hh index 421f3407b..9da753e85 100644 --- a/src/sim/power/thermal_domain.hh +++ b/src/sim/power/thermal_domain.hh @@ -93,9 +93,6 @@ class ThermalDomain : public SimObject, public ThermalEntity */ void setSubSystem(SubSystem * ss); - void serialize(CheckpointOut &cp) const override; - void unserialize(CheckpointIn &cp) override; - private: double _initTemperature; ThermalNode * node; diff --git a/src/sim/power/thermal_model.cc b/src/sim/power/thermal_model.cc index 9f970dede..a37240b9b 100644 --- a/src/sim/power/thermal_model.cc +++ b/src/sim/power/thermal_model.cc @@ -45,7 +45,6 @@ #include "sim/clocked_object.hh" #include "sim/linear_solver.hh" #include "sim/power/thermal_domain.hh" -#include "sim/serialize.hh" #include "sim/sim_object.hh" /** @@ -56,18 +55,6 @@ ThermalReference::ThermalReference(const Params &p) { } -void -ThermalReference::serialize(CheckpointOut &cp) const -{ - SERIALIZE_SCALAR(_temperature); -} - -void -ThermalReference::unserialize(CheckpointIn &cp) -{ - UNSERIALIZE_SCALAR(_temperature); -} - LinearEquation ThermalReference::getEquation(ThermalNode * n, unsigned nnodes, double step) const { @@ -83,18 +70,6 @@ ThermalResistor::ThermalResistor(const Params &p) { } -void -ThermalResistor::serialize(CheckpointOut &cp) const -{ - SERIALIZE_SCALAR(_resistance); -} - -void -ThermalResistor::unserialize(CheckpointIn &cp) -{ - UNSERIALIZE_SCALAR(_resistance); -} - LinearEquation ThermalResistor::getEquation(ThermalNode * n, unsigned nnodes, double step) const @@ -130,18 +105,6 @@ ThermalCapacitor::ThermalCapacitor(const Params &p) { } -void -ThermalCapacitor::serialize(CheckpointOut &cp) const -{ - SERIALIZE_SCALAR(_capacitance); -} - -void -ThermalCapacitor::unserialize(CheckpointIn &cp) -{ - UNSERIALIZE_SCALAR(_capacitance); -} - LinearEquation ThermalCapacitor::getEquation(ThermalNode * n, unsigned nnodes, double step) const @@ -180,18 +143,6 @@ ThermalModel::ThermalModel(const Params &p) { } -void -ThermalModel::serialize(CheckpointOut &cp) const -{ - SERIALIZE_SCALAR(_step); -} - -void -ThermalModel::unserialize(CheckpointIn &cp) -{ - UNSERIALIZE_SCALAR(_step); -} - void ThermalModel::doStep() { diff --git a/src/sim/power/thermal_model.hh b/src/sim/power/thermal_model.hh index 295e5080f..95d0c7ae7 100644 --- a/src/sim/power/thermal_model.hh +++ b/src/sim/power/thermal_model.hh @@ -62,9 +62,6 @@ class ThermalResistor : public SimObject, public ThermalEntity typedef ThermalResistorParams Params; ThermalResistor(const Params &p); - void serialize(CheckpointOut &cp) const override; - void unserialize(CheckpointIn &cp) override; - void setNodes(ThermalNode * n1, ThermalNode * n2) { node1 = n1; node2 = n2; @@ -75,7 +72,7 @@ class ThermalResistor : public SimObject, public ThermalEntity private: /* Resistance value in K/W */ - double _resistance; + const double _resistance; /* Nodes connected to the resistor */ ThermalNode * node1, * node2; }; @@ -91,9 +88,6 @@ class ThermalCapacitor : public SimObject, public ThermalEntity typedef ThermalCapacitorParams Params; ThermalCapacitor(const Params &p); - void serialize(CheckpointOut &cp) const override; - void unserialize(CheckpointIn &cp) override; - LinearEquation getEquation(ThermalNode * tn, unsigned n, double step) const override; @@ -104,7 +98,7 @@ class ThermalCapacitor : public SimObject, public ThermalEntity private: /* Capacitance value in J/K */ - double _capacitance; + const double _capacitance; /* Nodes connected to the resistor */ ThermalNode * node1, * node2; }; @@ -128,11 +122,8 @@ class ThermalReference : public SimObject, public ThermalEntity LinearEquation getEquation(ThermalNode * tn, unsigned n, double step) const override; - void serialize(CheckpointOut &cp) const override; - void unserialize(CheckpointIn &cp) override; - /* Fixed temperature value in centigrate degrees */ - double _temperature; + const double _temperature; /* Nodes connected to the resistor */ ThermalNode * node; }; @@ -164,8 +155,6 @@ class ThermalModel : public ClockedObject void startup() override; void doStep(); - void serialize(CheckpointOut &cp) const override; - void unserialize(CheckpointIn &cp) override; private: /* Keep track of all components used for the thermal model */ @@ -184,8 +173,7 @@ class ThermalModel : public ClockedObject EventFunctionWrapper stepEvent; /** Step in seconds for thermal updates */ - double _step; - + const double _step; }; #endif