Deleted Added
sdiff udiff text old ( 11899:d04da1f9c961 ) new ( 11988:665cd5f8b52b )
full compact
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 *
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 cxx_exports = [
56 PyBindMethod("setNodes"),
57 ]
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
66 cxx_exports = [
67 PyBindMethod("setNodes"),
68 ]
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
77 cxx_exports = [
78 PyBindMethod("setNode"),
79 ]
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
90 cxx_exports = [
91 PyBindMethod("addCapacitor"),
92 PyBindMethod("addResistor"),
93 PyBindMethod("addReference"),
94 PyBindMethod("addDomain"),
95 PyBindMethod("addNode"),
96 PyBindMethod("doStep"),
97 ]
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 ---