diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-03-25 16:38:54 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-03-25 16:38:54 +0100 |
commit | a3542e2dcbc356ca89128f07c20d0ff098ee587c (patch) | |
tree | aa935ece7b3b3ef2a466b1db130ab57f3e90fe5c | |
parent | 3d31c35b499bd8ddee786cd6b3ea972f13e89126 (diff) |
analyze-config: Use AnalyticModel for JSON output
-rwxr-xr-x | bin/analyze-config.py | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/bin/analyze-config.py b/bin/analyze-config.py index 025ade7..e18c63d 100755 --- a/bin/analyze-config.py +++ b/bin/analyze-config.py @@ -17,7 +17,7 @@ import os import numpy as np from dfatool.functions import SplitFunction, StaticFunction -from dfatool.model import AnalyticModel +from dfatool.model import AnalyticModel, ModelAttribute from dfatool.utils import NpEncoder @@ -154,16 +154,31 @@ def main(): return SplitFunction(np.mean(rom_sizes), symbol_index, child) - rom_model = get_min(symbols, data, 1, 100) - ram_model = get_min(symbols, data, 2, 20) + model.attr_by_name["multipass"] = dict() + model.attr_by_name["multipass"]["rom_usage"] = ModelAttribute( + "multipass", + "rom_usage", + by_name["multipass"]["rom_usage"], + by_name["multipass"]["param"], + symbols, + ) + model.attr_by_name["multipass"]["ram_usage"] = ModelAttribute( + "multipass", + "rom_usage", + by_name["multipass"]["ram_usage"], + by_name["multipass"]["param"], + symbols, + ) - output = { - "model": {"rom": rom_model.to_json(), "ram": ram_model.to_json()}, - "symbols": symbols, - } + model.attr_by_name["multipass"]["rom_usage"].model_function = get_min( + symbols, data, 1, 100 + ) + model.attr_by_name["multipass"]["ram_usage"].model_function = get_min( + symbols, data, 2, 20 + ) with open("kconfigmodel.json", "w") as f: - json.dump(output, f, cls=NpEncoder) + json.dump(model.to_json(), f, cls=NpEncoder) if __name__ == "__main__": |