Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/5625
Change subject: config: Add an Energy param type.
......................................................................
config: Add an Energy param type.
This type expects values in joules (J).
Change-Id: I77a3a4f1c19443f573d5fe7a84d5abd954ce1603
---
M src/python/m5/params.py
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index c241b05..11a55e5 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -1563,6 +1563,17 @@
value = convert.toCurrent(value)
super(Current, self).__init__(value)
+class Energy(Float):
+ ex_str = "1pJ"
+
+ def __new__(cls, value):
+ value = convert.toEnergy(value)
+ return super(cls, Energy).__new__(cls, value)
+
+ def __init__(self, value):
+ value = convert.toEnergy(value)
+ super(Energy, self).__init__(value)
+
class NetworkBandwidth(float,ParamValue):
cxx_type = 'float'
ex_str = "1Gbps"
@@ -2035,7 +2046,7 @@
'TcpPort', 'UdpPort', 'EthernetAddr',
'IpAddress', 'IpNetmask', 'IpWithPort',
'MemorySize', 'MemorySize32',
- 'Latency', 'Frequency', 'Clock', 'Voltage', 'Current',
+ 'Latency', 'Frequency', 'Clock', 'Voltage', 'Current', 'Energy',
'NetworkBandwidth', 'MemoryBandwidth',
'AddrRange',
'MaxAddr', 'MaxTick', 'AllMemory',
--
To view, visit https://gem5-review.googlesource.com/5625
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I77a3a4f1c19443f573d5fe7a84d5abd954ce1603
Gerrit-Change-Number: 5625
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev