diff --git a/src/finn/transformation/fpgadataflow/derive_characteristic.py b/src/finn/transformation/fpgadataflow/derive_characteristic.py index c171fce3cd00f1a72fac71d9b6be520246b4087f..849ecea1e9696c8ebb30e5e33a75c3a25cc21284 100644 --- a/src/finn/transformation/fpgadataflow/derive_characteristic.py +++ b/src/finn/transformation/fpgadataflow/derive_characteristic.py @@ -149,7 +149,7 @@ class DeriveFIFOSizes(NodeLocalTransformation): assert ( len(prod_chrc) == 2 * period ), "Found unexpected characterization attribute" - if prod.get_nodeattr("outFIFODepth") > 2: + if any({[x > 2 for x in prod.get_nodeattr("outFIFODepths")]}): # FIFO depth already set, can skip this node return (node, False) @@ -180,9 +180,6 @@ class DeriveFIFOSizes(NodeLocalTransformation): # set output FIFO depth for this (producing) node # InsertFIFO looks at the max of (outFIFODepth, inFIFODepth) # for each tensor - if len(out_fifo_depths) > 0: - prod.set_nodeattr("outFIFODepth", out_fifo_depths[0]) - # used only for multi-producer nodes prod.set_nodeattr("outFIFODepths", out_fifo_depths) except KeyError: diff --git a/src/finn/transformation/fpgadataflow/insert_fifo.py b/src/finn/transformation/fpgadataflow/insert_fifo.py index e75d1880cb1b7c5c07d3c7a4e155216e4adc740d..b3c83d96e83b4dcec781f2fa0f4ad7972593c612 100644 --- a/src/finn/transformation/fpgadataflow/insert_fifo.py +++ b/src/finn/transformation/fpgadataflow/insert_fifo.py @@ -256,10 +256,11 @@ class InsertFIFO(Transformation): ), """Insert tlast marker should be done after inserting the FIFOs""" n0 = getCustomOp(final_node) + out_ind = list(final_node.output).index(graph_out_name) # determine fifo node attributes - fld_shape = n0.get_folded_output_shape() - dtype = n0.get_output_datatype() - fifo_depth = n0.get_nodeattr("outFIFODepth") + fld_shape = n0.get_folded_output_shape(out_ind) + dtype = n0.get_output_datatype(out_ind) + fifo_depth = n0.get_nodeattr("outFIFODepths")[out_ind] if fifo_depth <= 2: warnings.warn("Overriding output FIFO depth to 32")