From 6af715d4f5d0af3f3c1c1e2ce69b4db209251c54 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 25 Jun 2021 11:02:10 +0200 Subject: move print_static to cli module --- lib/cli.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/cli.py (limited to 'lib/cli.py') 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), + ) + ) -- cgit v1.2.3