From f93d7abe7ce78528623f9630ae65e9017293325d Mon Sep 17 00:00:00 2001
From: Elizabeth <hashim.sharif91@gmail.com>
Date: Tue, 8 Oct 2019 22:39:40 -0500
Subject: [PATCH] Uncommented out cod eto run binaries and fixed h2f/f2h bug

---
 .../hpvm-tensor-rt/build_pldi/table_generator.py  |  7 +++----
 llvm/projects/soc_simulator/src/driver.py         | 15 +++++++++++++++
 2 files changed, 18 insertions(+), 4 deletions(-)
 create mode 100644 llvm/projects/soc_simulator/src/driver.py

diff --git a/llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py b/llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py
index 18ba65b307..36247ee173 100644
--- a/llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py
+++ b/llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py
@@ -53,7 +53,7 @@ class TableGenerator:
         3. Writes the internal table to <network_name>_tensors.txt file and uses the 
         <network_name>_ops.txt file as a guideline in terms of row order 
         '''
-        #self.__run_inputted_binaries()
+        self.__run_inputted_binaries()
         self.__build_internal_table()
         self.__output_table_to_file()
 
@@ -120,14 +120,13 @@ class TableGenerator:
                         exit(1)
 
                     # Store f2h and h2f as columns in the row belonging to the original operation
-                    self.__table[orig_op_name][approx_type][TableGenerator.__time_col_name] = total_time
-                    self.__table[orig_op_name][approx_type][TableGenerator.__energy_col_name] = total_energy
+                    self.__table[orig_op_name][conversion_type][TableGenerator.__time_col_name] = total_time
+                    self.__table[orig_op_name][conversion_type][TableGenerator.__energy_col_name] = total_energy
 
                 # Create a new row in the dictionary
                 else:
                     self.__table[op_name][approx_type][TableGenerator.__time_col_name] = total_time
                     self.__table[op_name][approx_type][TableGenerator.__energy_col_name] = total_energy
-
             results_file.close()
 
 
diff --git a/llvm/projects/soc_simulator/src/driver.py b/llvm/projects/soc_simulator/src/driver.py
new file mode 100644
index 0000000000..aa20a7e7a2
--- /dev/null
+++ b/llvm/projects/soc_simulator/src/driver.py
@@ -0,0 +1,15 @@
+# Python driver -- ported from Perl driver (driver.pl)
+
+import sys
+
+# Read layer info
+
+# Read tensor info
+
+# Run simulations on promise
+
+if __name__ == "__main__":
+    if len(sys.argv) != 4):
+        print("Usage: python driver.py <layer info> <tensor info> <configurations> <results file>")
+        exit(1)
+
-- 
GitLab