ThermalModel.py (11899:d04da1f9c961) ThermalModel.py (11988:665cd5f8b52b)
1# Copyright (c) 2015 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 21 unchanged lines hidden (view full) ---

30# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35#
36# Authors: David Guillen Fandos
37
1# Copyright (c) 2015 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 21 unchanged lines hidden (view full) ---

30# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35#
36# Authors: David Guillen Fandos
37
38from m5.SimObject import SimObject
38from m5.SimObject import *
39from ClockedObject import ClockedObject
40
41from m5.params import *
42from m5.objects import ThermalDomain
43
44
45# Represents a thermal node
46class ThermalNode(SimObject):
47 type = 'ThermalNode'
48 cxx_header = "sim/power/thermal_node.hh"
49
50# Represents a thermal resistor
51class ThermalResistor(SimObject):
52 type = 'ThermalResistor'
53 cxx_header = "sim/power/thermal_model.hh"
54
39from ClockedObject import ClockedObject
40
41from m5.params import *
42from m5.objects import ThermalDomain
43
44
45# Represents a thermal node
46class ThermalNode(SimObject):
47 type = 'ThermalNode'
48 cxx_header = "sim/power/thermal_node.hh"
49
50# Represents a thermal resistor
51class ThermalResistor(SimObject):
52 type = 'ThermalResistor'
53 cxx_header = "sim/power/thermal_model.hh"
54
55 @classmethod
56 def export_methods(cls, code):
57 code('''
58 void setNodes(ThermalNode * node1, ThermalNode * node2);
59''')
55 cxx_exports = [
56 PyBindMethod("setNodes"),
57 ]
60
61 resistance = Param.Float(1.0, "Thermal resistance, expressed in Kelvin per Watt")
62
63# Represents a thermal capacitor
64class ThermalCapacitor(SimObject):
65 type = 'ThermalCapacitor'
66 cxx_header = "sim/power/thermal_model.hh"
67
58
59 resistance = Param.Float(1.0, "Thermal resistance, expressed in Kelvin per Watt")
60
61# Represents a thermal capacitor
62class ThermalCapacitor(SimObject):
63 type = 'ThermalCapacitor'
64 cxx_header = "sim/power/thermal_model.hh"
65
68 @classmethod
69 def export_methods(cls, code):
70 code('''
71 void setNodes(ThermalNode * node1, ThermalNode * node2);
72''')
66 cxx_exports = [
67 PyBindMethod("setNodes"),
68 ]
73
74 capacitance = Param.Float(1.0, "Thermal capacitance, expressed in Joules per Kelvin")
75
76# Represents a fixed temperature node (ie. air)
77class ThermalReference(SimObject, object):
78 type = 'ThermalReference'
79 cxx_header = "sim/power/thermal_model.hh"
80
69
70 capacitance = Param.Float(1.0, "Thermal capacitance, expressed in Joules per Kelvin")
71
72# Represents a fixed temperature node (ie. air)
73class ThermalReference(SimObject, object):
74 type = 'ThermalReference'
75 cxx_header = "sim/power/thermal_model.hh"
76
81 @classmethod
82 def export_methods(cls, code):
83 code('''
84 void setNode(ThermalNode * node);
85''')
77 cxx_exports = [
78 PyBindMethod("setNode"),
79 ]
86
87 # Static temperature which may change over time
88 temperature = Param.Float(25.0, "Operational temperature in Celsius")
89
90
91# Represents a thermal capacitor
92class ThermalModel(ClockedObject):
93 type = 'ThermalModel'
94 cxx_header = "sim/power/thermal_model.hh"
95
80
81 # Static temperature which may change over time
82 temperature = Param.Float(25.0, "Operational temperature in Celsius")
83
84
85# Represents a thermal capacitor
86class ThermalModel(ClockedObject):
87 type = 'ThermalModel'
88 cxx_header = "sim/power/thermal_model.hh"
89
96 @classmethod
97 def export_methods(cls, code):
98 code('''
99 void addCapacitor(ThermalCapacitor *obj);
100 void addResistor(ThermalResistor *obj);
101 void addReference(ThermalReference *obj);
102 void addDomain(ThermalDomain *obj);
103 void addNode(ThermalNode *obj);
104 void doStep();
105''')
90 cxx_exports = [
91 PyBindMethod("addCapacitor"),
92 PyBindMethod("addResistor"),
93 PyBindMethod("addReference"),
94 PyBindMethod("addDomain"),
95 PyBindMethod("addNode"),
96 PyBindMethod("doStep"),
97 ]
106
107 step = Param.Float(0.01, "Simulation step (in seconds) for thermal simulation")
108
109 def populate(self):
110 if not hasattr(self,"_capacitors"): self._capacitors = []
111 if not hasattr(self,"_resistors"): self._resistors = []
112 if not hasattr(self,"_domains"): self._domains = []
113 if not hasattr(self,"_references"): self._references = []

--- 55 unchanged lines hidden ---
98
99 step = Param.Float(0.01, "Simulation step (in seconds) for thermal simulation")
100
101 def populate(self):
102 if not hasattr(self,"_capacitors"): self._capacitors = []
103 if not hasattr(self,"_resistors"): self._resistors = []
104 if not hasattr(self,"_domains"): self._domains = []
105 if not hasattr(self,"_references"): self._references = []

--- 55 unchanged lines hidden ---