summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-05-10 12:14:57 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-05-10 12:14:57 +0200
commitec653977c37466c5df7cee0eea75a02232e4aa92 (patch)
tree4bc63029f8ac35b6f08c88426061c7ad161f4be9
parentb64016d8bb36afa750edf1637360001a84a2d309 (diff)
dfatool: temporarily enable state energy analysis
-rwxr-xr-xlib/dfatool.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py
index 8f2e9e6..7705f21 100755
--- a/lib/dfatool.py
+++ b/lib/dfatool.py
@@ -692,8 +692,11 @@ class RawData:
offline_trace_part['us'] - 20)
online_trace_part['offline_aggregates']['power_std'].append(
offline_trace_part['uW_std'])
+ # A state's energy may get quite larg -- in fact, so large that
+ # fitting doesn't work on pJ values. For now, we just convert -all-
+ # energies to µJ -- TODO only do this for states
online_trace_part['offline_aggregates']['energy'].append(
- offline_trace_part['uW_mean'] * (offline_trace_part['us'] - 20))
+ offline_trace_part['uW_mean'] * (offline_trace_part['us'] - 20) * 1e-6)
online_trace_part['offline_aggregates']['paramkeys'].append(paramkeys)
online_trace_part['offline_aggregates']['param'].append(paramvalue)
if online_trace_part['isa'] == 'transition':
@@ -1134,7 +1137,7 @@ def _add_trace_data_to_aggregate(aggregate, key, element):
for datakey in element['offline_aggregates'].keys():
aggregate[key][datakey] = []
if element['isa'] == 'state':
- aggregate[key]['attributes'] = ['power']
+ aggregate[key]['attributes'] = ['power', 'energy']
else:
# TODO do not hardcode values
aggregate[key]['attributes'] = ['duration', 'energy', 'rel_energy_prev', 'rel_energy_next']