From 455e20e5ed0d5ce141a921e67f0219e55044e6e1 Mon Sep 17 00:00:00 2001 From: Diqing Zhong Date: Wed, 3 Feb 2021 16:37:31 +0100 Subject: MLBEDSW-3953: Output diff in mobilenet_v3 Fixed two issues: - Cmd stream can be out of order in Ifmstreaming - In H32, LUT could be corrupted if blockdep is not 0 Change-Id: I2edd84429b93d83b2794f14937ce3fd279fd4a24 Signed-off-by: Diqing Zhong --- ethosu/vela/register_command_stream_util.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ethosu/vela/register_command_stream_util.py') diff --git a/ethosu/vela/register_command_stream_util.py b/ethosu/vela/register_command_stream_util.py index 55fa620c..4cf826d9 100644 --- a/ethosu/vela/register_command_stream_util.py +++ b/ethosu/vela/register_command_stream_util.py @@ -463,6 +463,12 @@ def calc_blockdep(arch: ArchitectureFeatures, prev_op: Optional[NpuBlockOperatio return 0 assert npu_op.ifm is not None assert prev_op.ofm is not None + # Check if the reserved shram will be used in current/prev op + prev_uses_lut = prev_op.activation is not None and prev_op.activation.op_type == NpuActivationOp.TABLE_LOOKUP + curr_uses_lut = npu_op.activation is not None and npu_op.activation.op_type == NpuActivationOp.TABLE_LOOKUP + if prev_uses_lut and arch.shram_reserved_unused_banks == 0 and not curr_uses_lut: + return 0 + # Check if IFM or IFM2 overlaps with prev op's OFM prev_ofm_ranges = get_address_ranges(prev_op.ofm) ifm_ranges = get_address_ranges(npu_op.ifm) -- cgit v1.2.1