sim: Don't serialise params in thermal models
authorAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 19 Jan 2021 10:36:11 +0000 (10:36 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 20 Jan 2021 09:57:30 +0000 (09:57 +0000)
ThermalDomain and ThermalReference shouldn't serialise their params.

Change-Id: Idc4438b68c0db1fe312d37888c901f2ea87b1d60
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39221
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/sim/power/thermal_domain.cc
src/sim/power/thermal_domain.hh
src/sim/power/thermal_model.cc
src/sim/power/thermal_model.hh

index e9f4d3ca2ad315ebe51c1cdf8e315384c7d5a198..a5eb33c8e662fa0b0ed4945fb0ff7504f53fbe40 100644 (file)
@@ -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
index 421f3407b4eedd4aaec38e826b079d2ef8c8d56c..9da753e85b439f84563bed968e6f028c76204efb 100644 (file)
@@ -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;
index 9f970dedede45652a91f1c02d481d02da6c54ef2..a37240b9b1684a913e513259b19bb180696d924a 100644 (file)
@@ -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()
 {
index 295e5080f5d2d66863664a87866b2b50b0f38bc8..95d0c7ae79794eef76be368bb121497e89087023 100644 (file)
@@ -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