Skip to content

Commit 32fbff0

Browse files
committed
[LookUp] With npy type being float we can use parent class method for read_npy_data
1 parent e65da62 commit 32fbff0

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/finn/custom_op/fpgadataflow/hls/lookup_hls.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -88,31 +88,6 @@ def defines(self, var):
8888
my_defines.append("#define EmbeddingType %s" % emb_hls_type)
8989
self.code_gen_dict["$DEFINES$"] = my_defines
9090

91-
def read_npy_data(self):
92-
code_gen_dir = self.get_nodeattr("code_gen_dir_cppsim")
93-
dtype = self.get_input_datatype()
94-
if dtype == DataType["BIPOLAR"]:
95-
# use binary for bipolar storage
96-
dtype = DataType["BINARY"]
97-
elem_bits = dtype.bitwidth()
98-
packed_bits = self.get_instream_width()
99-
packed_hls_type = "ap_uint<%d>" % packed_bits
100-
elem_hls_type = dtype.get_hls_datatype_str()
101-
npy_type = "float"
102-
npy_in = "%s/input_0.npy" % code_gen_dir
103-
self.code_gen_dict["$READNPYDATA$"] = []
104-
self.code_gen_dict["$READNPYDATA$"].append(
105-
'npy2apintstream<%s, %s, %d, %s>("%s", in0_%s);'
106-
% (
107-
packed_hls_type,
108-
elem_hls_type,
109-
elem_bits,
110-
npy_type,
111-
npy_in,
112-
self.hls_sname(),
113-
)
114-
)
115-
11691
def dataoutstrm(self):
11792
code_gen_dir = self.get_nodeattr("code_gen_dir_cppsim")
11893
dtype = self.get_output_datatype()

0 commit comments

Comments
 (0)