From 88a2f60de2e0c6b4333465b63a99a051e3aa361b Mon Sep 17 00:00:00 2001
From: auphelia <jakobapk@web.de>
Date: Thu, 23 Apr 2020 16:47:43 +0100
Subject: [PATCH] [Core] Read network metrics as dictionary in throughput test
 function

---
 src/finn/core/throughput_test.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/finn/core/throughput_test.py b/src/finn/core/throughput_test.py
index fed44ce75..ced14a02b 100644
--- a/src/finn/core/throughput_test.py
+++ b/src/finn/core/throughput_test.py
@@ -60,7 +60,7 @@ def throughput_test(model):
     process_compile = subprocess.Popen(bash_command, stdout=subprocess.PIPE)
     process_compile.communicate()
 
-    cmd = "sshpass -p {} scp -P{} {}@{}:{}/{}/nw_runtime.txt {}".format(
+    cmd = "sshpass -p {} scp -P{} {}@{}:{}/{}/nw_metrics.txt {}".format(
         pynq_password,
         pynq_port,
         pynq_username,
@@ -73,6 +73,7 @@ def throughput_test(model):
     process_compile = subprocess.Popen(bash_command, stdout=subprocess.PIPE)
     process_compile.communicate()
 
-    file = open("{}/nw_runtime.txt".format(deployment_dir), "r")
-    res = file.read()
+    with open("{}/nw_metrics.txt".format(deployment_dir), "r") as file:
+        res = eval(file.read())
+
     return res
-- 
GitLab