summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-04-20 09:10:23 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2021-04-20 09:10:23 +0200
commitf48482529e34cc5d9f7d11681febb57905251b47 (patch)
tree062bfc6ad4f4f137332401a00fac038532948fb9 /bin
parent6db34440a794b501e0a92b5351effcd473465016 (diff)
add dot export of energy models
Diffstat (limited to 'bin')
-rwxr-xr-xbin/analyze-archive.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index 6f5fc37..8b58478 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -615,6 +615,12 @@ if __name__ == "__main__":
help="Load DFA hardware model from JSON or YAML FILE",
)
parser.add_argument(
+ "--export-dot",
+ metavar="FILE",
+ type=str,
+ help="Export PTA representation suitable for Graphviz dot to FILE",
+ )
+ parser.add_argument(
"--export-energymodel",
metavar="FILE",
type=str,
@@ -1222,4 +1228,13 @@ if __name__ == "__main__":
with open(args.export_energymodel, "w") as f:
json.dump(json_model, f, indent=2, sort_keys=True, cls=NpEncoder)
+ if args.export_dot:
+ if not pta:
+ print(
+ "Note: v0 measurements do not embed the PTA used for benchmark generation. Estimating PTA from recorded observations."
+ )
+ json_model = model.to_json()
+ with open(args.export_dot, "w") as f:
+ f.write(model.to_dot())
+
sys.exit(0)