diff --git a/src/finn/custom_op/fpgadataflow/fmpadding_batch.py b/src/finn/custom_op/fpgadataflow/fmpadding_batch.py index d326ae7dfc7830a0081c3b13233d67ef08b12eff..c25975d0c3974a68a8e6ce0502d294406f76cd72 100644 --- a/src/finn/custom_op/fpgadataflow/fmpadding_batch.py +++ b/src/finn/custom_op/fpgadataflow/fmpadding_batch.py @@ -42,6 +42,14 @@ class FMPadding_Batch(HLSCustomOp): pad = self.get_nodeattr("Padding") return idim + pad + def get_exp_cycles(self): + odim = self.get_padded_odim() + channels = self.get_nodeattr("NumChannels") + simd = self.get_nodeattr("SIMD") + batch_size = self.get_nodeattr("numInputVectors") + exp_cycles = channels / simd * batch_size * odim * odim + return exp_cycles + def get_normal_input_shape(self): idim = self.get_nodeattr("ImgDim") num_ch = self.get_nodeattr("NumChannels") diff --git a/src/finn/custom_op/fpgadataflow/pool_batch.py b/src/finn/custom_op/fpgadataflow/pool_batch.py index 801a634fdba1cd5e16c7c211175c1e7380bf0070..d5efe3e81880fad31ba6ecb0abe1ef66e09aaa16 100644 --- a/src/finn/custom_op/fpgadataflow/pool_batch.py +++ b/src/finn/custom_op/fpgadataflow/pool_batch.py @@ -136,6 +136,10 @@ class Pool_Batch(HLSCustomOp): folded_oshape = self.get_folded_output_shape() return np.prod(folded_oshape[1:-1]) + def get_exp_cycles(self): + # Channels/PE * batch size * odim * odim + return np.prod(self.get_folded_output_shape()[:-1]) + def get_instream_width(self): dt_bits = self.get_input_datatype().bitwidth() pe = self.get_nodeattr("PE")