MLBEDSW-1971: Verify ifm block size calculation against specification

This commit ensures the IFM block size calculation
in architecture_features.py matches the specification
by correctly setting the ifm upscaling factor based on
the upscaling mode.

This requires adding an attribute to the Tensor object
which stores the upscaling mode for that specific
tensor and making sure that information is correctly
carried over to shared_buffer_allocation.py.

Signed-off-by: Dwight Lidman <dwight.lidman@arm.com>
Change-Id: I4ab56086f4c694d3bf759bbad30cdb969b4a26db
diff --git a/ethosu/vela/architecture_features.py b/ethosu/vela/architecture_features.py
index 1bf9d95..b59122e 100644
--- a/ethosu/vela/architecture_features.py
+++ b/ethosu/vela/architecture_features.py
@@ -22,6 +22,7 @@
 import numpy as np
 
 from .errors import OptionError
+from .ethos_u55_regs.ethos_u55_regs import resampling_mode
 from .numeric_util import round_up
 from .numeric_util import round_up_divide
 from .operation import NpuBlockType
@@ -347,10 +348,10 @@
         return min(max_block_depth, ifm_depth)
 
     # Calculate the size of the IFM block given a depth, target OFM block and a kernel
-    def get_ifm_block_size(
-        self, ifm_block_depth, ofm_block: Block, kernel: Kernel, subkernel: Block = Block(8, 8, 65536)
-    ):
-        upscaling = 1
+    def get_ifm_block_size(self, ifm_block_depth, ofm_block: Block,
+                           kernel: Kernel, subkernel: Block = Block(8, 8, 65536),
+                           ifm_resampling_mode=resampling_mode.NONE):
+        upscaling = 1 if ifm_resampling_mode == resampling_mode.NONE else 2
         # Height
         ifm_odd_2x_height_enable = 0
         dilated_kernel_height = ((kernel.height - 1) * kernel.dilation.y) + 1