gem5  v21.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
thermal_model.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, 2021 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
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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 
38 #ifndef __SIM_THERMAL_MODEL_HH__
39 #define __SIM_THERMAL_MODEL_HH__
40 
41 #include <vector>
42 
43 #include "base/temperature.hh"
44 #include "sim/clocked_object.hh"
48 #include "sim/sim_object.hh"
49 
50 struct ThermalCapacitorParams;
51 struct ThermalModelParams;
52 struct ThermalReferenceParams;
53 struct ThermalResistorParams;
54 
60 class ThermalResistor : public SimObject, public ThermalEntity
61 {
62  public:
63  typedef ThermalResistorParams Params;
64  ThermalResistor(const Params &p);
65 
66  void setNodes(ThermalNode * n1, ThermalNode * n2) {
67  node1 = n1;
68  node2 = n2;
69  }
70 
71  LinearEquation getEquation(ThermalNode * tn, unsigned n,
72  double step) const override;
73 
74  private:
75  /* Resistance value in K/W */
76  const double _resistance;
77  /* Nodes connected to the resistor */
79 };
80 
87 {
88  public:
89  typedef ThermalCapacitorParams Params;
90  ThermalCapacitor(const Params &p);
91 
92  LinearEquation getEquation(ThermalNode * tn, unsigned n,
93  double step) const override;
94 
95  void setNodes(ThermalNode * n1, ThermalNode * n2) {
96  node1 = n1;
97  node2 = n2;
98  }
99 
100  private:
101  /* Capacitance value in J/K */
102  const double _capacitance;
103  /* Nodes connected to the resistor */
105 };
106 
112 {
113  public:
114  typedef ThermalReferenceParams Params;
115  ThermalReference(const Params &p);
116 
117  void
119  {
120  node = n;
121  }
122 
123  LinearEquation getEquation(ThermalNode * tn, unsigned n,
124  double step) const override;
125 
126  /* Fixed temperature value */
128  /* Nodes connected to the resistor */
130 };
131 
132 
142 {
143  public:
144  typedef ThermalModelParams Params;
145  ThermalModel(const Params &p);
146 
147  void addDomain(ThermalDomain * d);
150  void addResistor(ThermalResistor * r);
151 
152  void addNode(ThermalNode * n) { nodes.push_back(n); }
153 
154  Temperature getTemperature() const;
155 
156  void startup() override;
157  void doStep();
158 
159  private:
160 
161  /* Keep track of all components used for the thermal model */
166 
168 
169  /* Keep a list of the instantiated nodes */
172 
175 
177  const double _step;
178 };
179 
180 #endif
ThermalResistor::Params
ThermalResistorParams Params
Definition: thermal_model.hh:63
ThermalDomain
A ThermalDomain is used to group objects under that operate under the same temperature.
Definition: thermal_domain.hh:58
ThermalModel
Definition: thermal_model.hh:141
ThermalModel::capacitors
std::vector< ThermalCapacitor * > capacitors
Definition: thermal_model.hh:164
ThermalModel::domains
std::vector< ThermalDomain * > domains
Definition: thermal_model.hh:162
ThermalResistor::node2
ThermalNode * node2
Definition: thermal_model.hh:78
ThermalNode
A ThermalNode is used to connect thermal entities, such as resistors, capacitors, references and doma...
Definition: thermal_node.hh:51
ThermalCapacitor::node1
ThermalNode * node1
Definition: thermal_model.hh:104
ThermalModel::addReference
void addReference(ThermalReference *r)
Definition: thermal_model.cc:217
LinearEquation
This class describes a linear equation with constant coefficients.
Definition: linear_solver.hh:52
ThermalResistor::_resistance
const double _resistance
Definition: thermal_model.hh:76
ThermalReference::setNode
void setNode(ThermalNode *n)
Definition: thermal_model.hh:118
thermal_entity.hh
std::vector< ThermalDomain * >
ThermalReference
A ThermalReference is a thermal domain with fixed temperature.
Definition: thermal_model.hh:111
ThermalResistor::ThermalResistor
ThermalResistor(const Params &p)
ThermalResistor.
Definition: thermal_model.cc:68
ThermalCapacitor::Params
ThermalCapacitorParams Params
Definition: thermal_model.hh:89
ThermalResistor::getEquation
LinearEquation getEquation(ThermalNode *tn, unsigned n, double step) const override
Definition: thermal_model.cc:74
ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:231
Temperature
The class stores temperatures in Kelvin and provides helper methods to convert to/from Celsius.
Definition: temperature.hh:47
EventFunctionWrapper
Definition: eventq.hh:1112
ArmISA::n
Bitfield< 31 > n
Definition: miscregs_types.hh:450
ThermalModel::resistors
std::vector< ThermalResistor * > resistors
Definition: thermal_model.hh:165
thermal_node.hh
ThermalCapacitor::ThermalCapacitor
ThermalCapacitor(const Params &p)
ThermalCapacitor.
Definition: thermal_model.cc:103
ClockedObject::Params
ClockedObjectParams Params
Parameters of ClockedObject.
Definition: clocked_object.hh:237
ThermalModel::Params
ThermalModelParams Params
Definition: thermal_model.hh:144
ThermalReference::getEquation
LinearEquation getEquation(ThermalNode *tn, unsigned n, double step) const override
Definition: thermal_model.cc:59
ThermalCapacitor::_capacitance
const double _capacitance
Definition: thermal_model.hh:102
sim_object.hh
ArmISA::d
Bitfield< 9 > d
Definition: miscregs_types.hh:60
ThermalModel::addNode
void addNode(ThermalNode *n)
Definition: thermal_model.hh:152
ThermalCapacitor::getEquation
LinearEquation getEquation(ThermalNode *tn, unsigned n, double step) const override
Definition: thermal_model.cc:109
MipsISA::r
r
Definition: pra_constants.hh:95
ThermalCapacitor::setNodes
void setNodes(ThermalNode *n1, ThermalNode *n2)
Definition: thermal_model.hh:95
ThermalResistor
A ThermalResistor is used to model a thermal resistance between two thermal domains.
Definition: thermal_model.hh:60
ThermalModel::nodes
std::vector< ThermalNode * > nodes
Definition: thermal_model.hh:170
ThermalCapacitor
A ThermalCapacitor is used to model a thermal capacitance between two thermal domains.
Definition: thermal_model.hh:86
thermal_domain.hh
ThermalResistor::node1
ThermalNode * node1
Definition: thermal_model.hh:78
temperature.hh
ThermalModel::eq_nodes
std::vector< ThermalNode * > eq_nodes
Definition: thermal_model.hh:171
ThermalModel::addDomain
void addDomain(ThermalDomain *d)
Definition: thermal_model.cc:210
ThermalReference::_temperature
const Temperature _temperature
Definition: thermal_model.hh:127
ThermalModel::stepEvent
EventFunctionWrapper stepEvent
Stepping event to update the model values.
Definition: thermal_model.hh:174
ThermalCapacitor::node2
ThermalNode * node2
Definition: thermal_model.hh:104
clocked_object.hh
ThermalModel::doStep
void doStep()
Definition: thermal_model.cc:148
ThermalModel::addCapacitor
void addCapacitor(ThermalCapacitor *c)
Definition: thermal_model.cc:224
ThermalReference::Params
ThermalReferenceParams Params
Definition: thermal_model.hh:114
ThermalResistor::setNodes
void setNodes(ThermalNode *n1, ThermalNode *n2)
Definition: thermal_model.hh:66
ArmISA::c
Bitfield< 29 > c
Definition: miscregs_types.hh:50
ThermalModel::startup
void startup() override
startup() is the final initialization call before simulation.
Definition: thermal_model.cc:177
ThermalReference::ThermalReference
ThermalReference(const Params &p)
ThermalReference.
Definition: thermal_model.cc:53
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
ThermalModel::ThermalModel
ThermalModel(const Params &p)
ThermalModel.
Definition: thermal_model.cc:142
ThermalModel::addResistor
void addResistor(ThermalResistor *r)
Definition: thermal_model.cc:231
ThermalModel::_step
const double _step
Step in seconds for thermal updates.
Definition: thermal_model.hh:177
ThermalEntity
An abstract class that represents any thermal entity which is used in the circuital thermal equivalen...
Definition: thermal_entity.hh:51
ThermalReference::node
ThermalNode * node
Definition: thermal_model.hh:129
ThermalModel::getTemperature
Temperature getTemperature() const
Definition: thermal_model.cc:238
ThermalModel::references
std::vector< ThermalReference * > references
Definition: thermal_model.hh:163
ThermalModel::entities
std::vector< ThermalEntity * > entities
Definition: thermal_model.hh:167
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:141

Generated on Tue Mar 23 2021 19:41:28 for gem5 by doxygen 1.8.17