From f543a3347f2beed43b936cdb9cec80755fff8ca6 Mon Sep 17 00:00:00 2001
From: auphelia <jakobapk@web.de>
Date: Fri, 10 Jan 2020 10:23:25 +0000
Subject: [PATCH] [Code Generation - IP] Fixed bug in no activation case
 (Pragma for thresholds)

---
 .../fpgadataflow/streamingfclayer_batch.py     | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py b/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py
index 5066b523b..6dd55b463 100644
--- a/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py
+++ b/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py
@@ -523,11 +523,13 @@ class StreamingFCLayer_Batch(HLSCustomOp):
             """DO_PRAGMA(HLS ARRAY_PARTITION
             variable=weights complete dim=2)"""
         )
-        self.code_gen_dict["$PRAGMAS$"].append(
-            """DO_PRAGMA(HLS ARRAY_PARTITION
-            variable=threshs complete dim=1)"""
-        )
-        self.code_gen_dict["$PRAGMAS$"].append(
-            """DO_PRAGMA(HLS ARRAY_PARTITION
-            variable=threshs complete dim=3)"""
-        )
+        if self.calc_tmem() != 0:
+            # TODO find a better way of checking for no pregenerated thresholds
+            self.code_gen_dict["$PRAGMAS$"].append(
+                """DO_PRAGMA(HLS ARRAY_PARTITION
+                variable=threshs complete dim=1)"""
+            )
+            self.code_gen_dict["$PRAGMAS$"].append(
+                """DO_PRAGMA(HLS ARRAY_PARTITION
+                variable=threshs complete dim=3)"""
+            )
-- 
GitLab