gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
50namespace gem5
51{
52
53struct ThermalCapacitorParams;
54struct ThermalModelParams;
55struct ThermalReferenceParams;
56struct ThermalResistorParams;
57
64{
65 public:
66 typedef ThermalResistorParams Params;
67 ThermalResistor(const Params &p);
68
69 void setNodes(ThermalNode * n1, ThermalNode * n2) {
70 node1 = n1;
71 node2 = n2;
72 }
73
75 double step) const override;
76
77 private:
78 /* Resistance value in K/W */
79 const double _resistance;
80 /* Nodes connected to the resistor */
82};
83
90{
91 public:
92 typedef ThermalCapacitorParams Params;
94
96 double step) const override;
97
98 void setNodes(ThermalNode * n1, ThermalNode * n2) {
99 node1 = n1;
100 node2 = n2;
101 }
102
103 private:
104 /* Capacitance value in J/K */
105 const double _capacitance;
106 /* Nodes connected to the resistor */
108};
109
115{
116 public:
117 typedef ThermalReferenceParams Params;
118 ThermalReference(const Params &p);
119
120 void
122 {
123 node = n;
124 }
125
127 double step) const override;
128
129 /* Fixed temperature value */
131 /* Nodes connected to the resistor */
133};
134
135
145{
146 public:
147 typedef ThermalModelParams Params;
148 ThermalModel(const Params &p);
149
150 void addDomain(ThermalDomain * d);
154
155 void addNode(ThermalNode * n) { nodes.push_back(n); }
156
158
159 void startup() override;
160 void doStep();
161
162 private:
163
164 /* Keep track of all components used for the thermal model */
165 std::vector <ThermalDomain *> domains;
166 std::vector <ThermalReference *> references;
167 std::vector <ThermalCapacitor *> capacitors;
168 std::vector <ThermalResistor *> resistors;
169
170 std::vector <ThermalEntity *> entities;
171
172 /* Keep a list of the instantiated nodes */
173 std::vector <ThermalNode*> nodes;
174 std::vector <ThermalNode*> eq_nodes;
175
178
180 const double _step;
181};
182
183} // namespace gem5
184
185#endif
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
This class describes a linear equation with constant coefficients.
Abstract superclass for simulation objects.
The class stores temperatures in Kelvin and provides helper methods to convert to/from Celsius.
A ThermalCapacitor is used to model a thermal capacitance between two thermal domains.
ThermalCapacitor(const Params &p)
ThermalCapacitor.
LinearEquation getEquation(ThermalNode *tn, unsigned n, double step) const override
void setNodes(ThermalNode *n1, ThermalNode *n2)
ThermalCapacitorParams Params
A ThermalDomain is used to group objects under that operate under the same temperature.
An abstract class that represents any thermal entity which is used in the circuital thermal equivalen...
void addResistor(ThermalResistor *r)
void addNode(ThermalNode *n)
std::vector< ThermalDomain * > domains
std::vector< ThermalEntity * > entities
void addReference(ThermalReference *r)
std::vector< ThermalNode * > nodes
std::vector< ThermalResistor * > resistors
void startup() override
startup() is the final initialization call before simulation.
std::vector< ThermalCapacitor * > capacitors
std::vector< ThermalNode * > eq_nodes
ThermalModelParams Params
void addDomain(ThermalDomain *d)
ThermalModel(const Params &p)
ThermalModel.
Temperature getTemperature() const
const double _step
Step in seconds for thermal updates.
void addCapacitor(ThermalCapacitor *c)
EventFunctionWrapper stepEvent
Stepping event to update the model values.
std::vector< ThermalReference * > references
A ThermalNode is used to connect thermal entities, such as resistors, capacitors, references and doma...
A ThermalReference is a thermal domain with fixed temperature.
void setNode(ThermalNode *n)
ThermalReference(const Params &p)
ThermalReference.
ThermalReferenceParams Params
LinearEquation getEquation(ThermalNode *tn, unsigned n, double step) const override
const Temperature _temperature
A ThermalResistor is used to model a thermal resistance between two thermal domains.
void setNodes(ThermalNode *n1, ThermalNode *n2)
ThermalResistor(const Params &p)
ThermalResistor.
LinearEquation getEquation(ThermalNode *tn, unsigned n, double step) const override
ThermalResistorParams Params
ClockedObject declaration and implementation.
Bitfield< 31 > n
Bitfield< 29 > c
Definition misc_types.hh:53
Bitfield< 9 > d
Definition misc_types.hh:64
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0