summaryrefslogtreecommitdiff
path: root/lib/cli.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-06-25 11:02:10 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2021-06-25 11:02:10 +0200
commit6af715d4f5d0af3f3c1c1e2ce69b4db209251c54 (patch)
tree96d3f6c49c60d3e6f676e793767d818551f6ed56 /lib/cli.py
parente761a12419477776a0846de5210d58c8ee57ffee (diff)
move print_static to cli module
Diffstat (limited to 'lib/cli.py')
-rw-r--r--lib/cli.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/cli.py b/lib/cli.py
new file mode 100644
index 0000000..6c6419c
--- /dev/null
+++ b/lib/cli.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+
+
+def print_static(model, static_model, name, attribute):
+ unit = " "
+ if attribute == "power":
+ unit = "µW"
+ elif attribute == "duration":
+ unit = "µs"
+ elif attribute == "substate_count":
+ unit = "su"
+ print(
+ "{:10s}: {:.0f} {:s} ({:.2f})".format(
+ name,
+ static_model(name, attribute),
+ unit,
+ model.attr_by_name[name][attribute].stats.generic_param_dependence_ratio(),
+ )
+ )
+ for param in model.parameters:
+ print(
+ "{:10s} dependence on {:15s}: {:.2f}".format(
+ "",
+ param,
+ model.attr_by_name[name][attribute].stats.param_dependence_ratio(param),
+ )
+ )