diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-01-08 11:49:40 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-01-08 11:49:40 +0100 |
commit | ebae0d51b9aa8fc8821e3184334352b1d4293a4f (patch) | |
tree | 48508a12af361698bb6ae8a63f2774e07d01f993 /bin/analyze-archive.py | |
parent | 86e51aecc7d625eeab46a4556bf3fb2b0100295d (diff) |
bin/analyze-archive, tests: use transition power, not energy
Diffstat (limited to 'bin/analyze-archive.py')
-rwxr-xr-x | bin/analyze-archive.py | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 49d4cb1..bf6d5f5 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -588,30 +588,45 @@ if __name__ == "__main__": ) for trans in model.transitions(): - # Mean power is not a typical transition attribute, but may be present for debugging or analysis purposes + if "energy" in model.attributes(trans): + try: + print( + "{:10s}: {:.0f} / {:.0f} / {:.0f} pJ ({:.2f} / {:.2f} / {:.2f})".format( + trans, + static_model(trans, "energy"), + static_model(trans, "rel_energy_prev"), + static_model(trans, "rel_energy_next"), + model.stats.generic_param_dependence_ratio(trans, "energy"), + model.stats.generic_param_dependence_ratio( + trans, "rel_energy_prev" + ), + model.stats.generic_param_dependence_ratio( + trans, "rel_energy_next" + ), + ) + ) + except KeyError: + print( + "{:10s}: {:.0f} pJ ({:.2f})".format( + trans, + static_model(trans, "energy"), + model.stats.generic_param_dependence_ratio(trans, "energy"), + ) + ) + print("{:10s}: {:.0f} µs".format(trans, static_model(trans, "duration"))) try: print( - "{:10s}: {:.0f} µW ({:.2f})".format( + "{:10s}: {:.0f} / {:.0f} / {:.0f} µW ({:.2f} / {:.2f} / {:.2f})".format( trans, static_model(trans, "power"), + static_model(trans, "rel_power_prev"), + static_model(trans, "rel_power_next"), model.stats.generic_param_dependence_ratio(trans, "power"), - ) - ) - except KeyError: - pass - try: - print( - "{:10s}: {:.0f} / {:.0f} / {:.0f} pJ ({:.2f} / {:.2f} / {:.2f})".format( - trans, - static_model(trans, "energy"), - static_model(trans, "rel_energy_prev"), - static_model(trans, "rel_energy_next"), - model.stats.generic_param_dependence_ratio(trans, "energy"), model.stats.generic_param_dependence_ratio( - trans, "rel_energy_prev" + trans, "rel_power_prev" ), model.stats.generic_param_dependence_ratio( - trans, "rel_energy_next" + trans, "rel_power_next" ), ) ) @@ -619,11 +634,10 @@ if __name__ == "__main__": print( "{:10s}: {:.0f} pJ ({:.2f})".format( trans, - static_model(trans, "energy"), - model.stats.generic_param_dependence_ratio(trans, "energy"), + static_model(trans, "power"), + model.stats.generic_param_dependence_ratio(trans, "power"), ) ) - print("{:10s}: {:.0f} µs".format(trans, static_model(trans, "duration"))) if xv_method == "montecarlo": static_quality = xv.montecarlo(lambda m: m.get_static(), xv_count) |