From eeb4181c7ddb2ad6fb283a5798af1d7c4147f8fa Mon Sep 17 00:00:00 2001
From: auphelia <jakobapk@web.de>
Date: Tue, 7 Jan 2020 17:07:05 +0000
Subject: [PATCH] [code generation] Added suffix "_npysim" to slidingwindow
 involved files

---
 .../custom_op/fpgadataflow/convolutioninputgenerator.py     | 6 +++---
 tests/fpgadataflow/test_fpgadataflow_convinputgenerator.py  | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/finn/custom_op/fpgadataflow/convolutioninputgenerator.py b/src/finn/custom_op/fpgadataflow/convolutioninputgenerator.py
index 560aa3268..1afb4aab2 100644
--- a/src/finn/custom_op/fpgadataflow/convolutioninputgenerator.py
+++ b/src/finn/custom_op/fpgadataflow/convolutioninputgenerator.py
@@ -57,7 +57,7 @@ class ConvolutionInputGenerator(HLSCustomOp):
             idt = DataType.BINARY
 
         # TODO ensure codegen dir exists
-        code_gen_dir = self.get_nodeattr("code_gen_dir")
+        code_gen_dir = self.get_nodeattr("code_gen_dir_npysim")
         # create a npy file for input of the node
 
         inp = context[node.input[0]]
@@ -100,7 +100,7 @@ class ConvolutionInputGenerator(HLSCustomOp):
         ]
 
     def read_npy_data(self):
-        code_gen_dir = self.get_nodeattr("code_gen_dir")
+        code_gen_dir = self.get_nodeattr("code_gen_dir_npysim")
         dtype = self.get_input_datatype()
         if dtype == DataType.BIPOLAR:
             # use binary for bipolar storage
@@ -136,7 +136,7 @@ class ConvolutionInputGenerator(HLSCustomOp):
         ]
 
     def dataoutstrm(self):
-        code_gen_dir = self.get_nodeattr("code_gen_dir")
+        code_gen_dir = self.get_nodeattr("code_gen_dir_npysim")
         dtype = self.get_output_datatype()
         if dtype == DataType.BIPOLAR:
             # use binary for bipolar storage
diff --git a/tests/fpgadataflow/test_fpgadataflow_convinputgenerator.py b/tests/fpgadataflow/test_fpgadataflow_convinputgenerator.py
index cb58f1ef5..b23f0297d 100644
--- a/tests/fpgadataflow/test_fpgadataflow_convinputgenerator.py
+++ b/tests/fpgadataflow/test_fpgadataflow_convinputgenerator.py
@@ -8,7 +8,7 @@ from finn.core.datatype import DataType
 from finn.core.modelwrapper import ModelWrapper
 from finn.core.utils import gen_finn_dt_tensor
 from finn.transformation.fpgadataflow.cleanup import CleanUp
-from finn.transformation.fpgadataflow.codegen import CodeGen
+from finn.transformation.fpgadataflow.codegen_npysim import CodeGen_npysim
 from finn.transformation.fpgadataflow.compile import Compile
 
 
@@ -140,12 +140,11 @@ def test_fpgadataflow_slidingwindow(idt, k, ifm_dim, ifm_ch, stride):
     ofm_dim = int(((ifm_dim - k) / stride) + 1)
 
     x = gen_finn_dt_tensor(idt, (1, ifm_ch, ifm_dim, ifm_dim))
-    # x_values = np
     model = make_single_slidingwindow_modelwrapper(
         k, ifm_ch, ifm_dim, ofm_dim, simd, stride, idt
     )
 
-    model = model.transform(CodeGen())
+    model = model.transform(CodeGen_npysim())
     model = model.transform(Compile())
 
     # prepare input data
-- 
GitLab