summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2023-11-27 13:43:43 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2023-11-27 13:43:43 +0100
commit9103959499ef1f87381f7c406170afca1ee3bb27 (patch)
treef30c7139d76e3ed3eaa6ad2f041c25bae8a8c678
parent7b564fc3f766c2428ba70a449c12024607f555a7 (diff)
show-model=static: leave out parameter dependence heuristics
-rwxr-xr-xbin/analyze-archive.py14
-rwxr-xr-xbin/analyze-kconfig.py8
-rwxr-xr-xbin/analyze-log.py8
-rw-r--r--lib/cli.py21
4 files changed, 38 insertions, 13 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index 5638182..1d623b1 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -651,13 +651,23 @@ if __name__ == "__main__":
if "static" in show_models or "all" in show_models:
for state in model.states:
for attribute in model.attributes(state):
- dfatool.cli.print_static(model, static_model, state, attribute)
+ dfatool.cli.print_static(
+ model,
+ static_model,
+ state,
+ attribute,
+ with_dependence="all" in show_models,
+ )
if args.with_substates:
for submodel in model.submodel_by_name.values():
for substate in submodel.states:
for subattribute in submodel.attributes(substate):
dfatool.cli.print_static(
- submodel, submodel.get_static(), substate, subattribute
+ submodel,
+ submodel.get_static(),
+ substate,
+ subattribut,
+ with_dependence="all" in show_modelse,
)
for trans in model.transitions:
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index 0f7c4ba..0900255 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -493,7 +493,13 @@ def main():
print("--- static model ---")
for name in model.names:
for attribute in model.attributes(name):
- dfatool.cli.print_static(model, static_model, name, attribute)
+ dfatool.cli.print_static(
+ model,
+ static_model,
+ name,
+ attribute,
+ with_dependence="all" in args.show_model,
+ )
if "param" in args.show_model or "all" in args.show_model:
print("--- param model ---")
diff --git a/bin/analyze-log.py b/bin/analyze-log.py
index 41aa9af..3538a98 100755
--- a/bin/analyze-log.py
+++ b/bin/analyze-log.py
@@ -215,7 +215,13 @@ def main():
print("--- static model ---")
for name in sorted(model.names):
for attribute in sorted(model.attributes(name)):
- dfatool.cli.print_static(model, static_model, name, attribute)
+ dfatool.cli.print_static(
+ model,
+ static_model,
+ name,
+ attribute,
+ with_dependence="all" in args.show_model,
+ )
if "param" in args.show_model or "all" in args.show_model:
print("--- param model ---")
diff --git a/lib/cli.py b/lib/cli.py
index 0f35f88..7bed07d 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -9,7 +9,7 @@ from dfatool.functions import (
import numpy as np
-def print_static(model, static_model, name, attribute):
+def print_static(model, static_model, name, attribute, with_dependence=False):
unit = " "
if attribute == "power":
unit = "µW"
@@ -26,15 +26,18 @@ def print_static(model, static_model, name, attribute):
model.attr_by_name[name][attribute].stats.generic_param_dependence_ratio(),
)
)
- for param in model.parameters:
- print(
- "{:10s} {:13s} {:15s}: {:.2f}".format(
- "",
- "dependence on",
- param,
- model.attr_by_name[name][attribute].stats.param_dependence_ratio(param),
+ if with_dependence:
+ for param in model.parameters:
+ print(
+ "{:10s} {:13s} {:15s}: {:.2f}".format(
+ "",
+ "dependence on",
+ param,
+ model.attr_by_name[name][attribute].stats.param_dependence_ratio(
+ param
+ ),
+ )
)
- )
def print_info_by_name(model, by_name):