From 203c60ef84a23377d9489a8bfb245c3d81dedab9 Mon Sep 17 00:00:00 2001 From: auphelia <jakobapk@web.de> Date: Wed, 20 Nov 2019 12:12:43 +0000 Subject: [PATCH] [Code gen] Added function for setting global includes and defines --- .../fpgadataflow/streamingfclayer_batch.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py b/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py index 2c5e69b17..fc525c377 100644 --- a/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py +++ b/src/finn/custom_op/fpgadataflow/streamingfclayer_batch.py @@ -18,20 +18,26 @@ class StreamingFCLayer_Batch(HLSCustomOp): self.resDataType = get_by_name(node.attribute, "resDataType").s.decode("utf-8") def global_includes(self, node): - pass + self.code_gen_dict["$GLOBALS$"] = [""] def defines(self, node): - pass + numReps = 2 + self.code_gen_dict["$DEFINES$"] = [ + """#define MW {}\n #define MH {}\n + #define SIMD {}\n #define PE {}\n #define numReps {}""".format( + self.MW, self.MH, self.SIMD, self.PE, numReps + ) + ] def read_npy_data(self, node): pass - + def strm_decl(self, node): pass def docompute(self, node): pass - + def dataoutstrm(self, node): pass -- GitLab