summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/analyze-archive.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index a2596d3..fcfb139 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -7,20 +7,24 @@ from scipy.cluster.vq import kmeans2
import struct
import sys
import tarfile
-from dfatool import Analysis, RawData
+from dfatool import EnergyModel, RawData
if __name__ == '__main__':
filename = sys.argv[1]
raw_data = RawData(filename)
preprocessed_data = raw_data.get_preprocessed_data()
- print(preprocessed_data)
- foo = Analysis(preprocessed_data)
- res = foo.analyze()
- print(res)
- for key in res.keys():
- print(key)
- for subkey in res[key].keys():
- if subkey != 'isa' and len(res[key][subkey]) > 0:
- print(' {:s}: {:f}'.format(subkey, np.mean(res[key][subkey])))
+ model = EnergyModel(preprocessed_data)
+ static_model = model.get_static()
+
+ print('--- simple static model ---')
+ for state in model.states():
+ print('{:10s}: {:.0f} µW'.format(state, static_model(state, 'power')))
+ for trans in model.transitions():
+ print('{:10s}: {:.0f} / {:.0f} / {:.0f} pJ'.format(
+ trans, static_model(trans, 'energy'),
+ static_model(trans, 'rel_energy_prev'),
+ static_model(trans, 'rel_energy_next')))
+
+ model.assess(model.get_static())
sys.exit(0)