Skip to content

Commit 94f887b

Browse files
committedMar 1, 2025·
[InsertFIFOs] Ensure that depth 1 FIFOs are at least depth 2 if create shallow fifos is enabled

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/finn/transformation/fpgadataflow/insert_fifo.py

+4
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ def apply(self, model):
202202
fifo_depth = n0.get_nodeattr("inFIFODepths")[inp_ind]
203203

204204
if fifo_depth > 2 or self.create_shallow_fifos:
205+
# Ensure that create shallow fifo condition doesn't create depth=1 fifos
206+
fifo_depth = max(fifo_depth, 2)
205207
# create fifo node
206208
fifo_output_tensor = oh.make_tensor_value_info(
207209
model.make_new_valueinfo_name(),
@@ -264,6 +266,8 @@ def apply(self, model):
264266
fifo_depth = n0.get_nodeattr("outFIFODepths")[out_ind]
265267

266268
if fifo_depth > 2 or self.create_shallow_fifos:
269+
# Ensure that create shallow fifo condition doesn't create depth=1 fifos
270+
fifo_depth = max(fifo_depth, 2)
267271
# create fifo node
268272
fifo_input_tensor = oh.make_tensor_value_info(
269273
model.make_new_valueinfo_name(),

0 commit comments

Comments
 (0)
Please sign in to comment.