diff options
author | Alexander Hansson <Alexander.Hansson@arm.com> | 2023-06-22 16:01:27 +0000 |
---|---|---|
committer | tim.hall <tim.hall@arm.com> | 2023-07-11 08:51:15 +0000 |
commit | ca9cc420984eba39b85885bf0d2d7b48bb920da9 (patch) | |
tree | a938cfe68a16cbe38574eed6b8726af38c073a67 /ethosu/vela/register_command_stream_generator.py | |
parent | 8df91f5b0ef5f270cbe848d8cebb5bf31ac4a088 (diff) | |
download | ethos-u-vela-ca9cc420984eba39b85885bf0d2d7b48bb920da9.tar.gz |
MLBEDSW-7728: Fix DMA_WAITs in register_command_stream_generator
* Fix bug in register_command_stream_generator where certain
high-level command streams resulted in missing DMA_WAIT commands
* Add unit-tests for DMA_WAIT and KERNEL_WAIT commands
Signed-off-by: Alexander Hansson <Alexander.Hansson@arm.com>
Change-Id: Iabb3ea3e95fa1ef933c50356d047b6b3f5aeafe3
Diffstat (limited to 'ethosu/vela/register_command_stream_generator.py')
-rw-r--r-- | ethosu/vela/register_command_stream_generator.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py index f5f530d3..6001a3b8 100644 --- a/ethosu/vela/register_command_stream_generator.py +++ b/ethosu/vela/register_command_stream_generator.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2020-2022 Arm Limited and/or its affiliates <open-source-office@arm.com> +# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> # # SPDX-License-Identifier: Apache-2.0 # @@ -1039,13 +1039,14 @@ def generate_command_stream( if arch.is_ethos_u65_system: emit.cmd0_with_param(cmd0.NPU_SET_PARALLEL_MODE, arch.ncores - 1) - dep_watermark = Watermark(0, 0) prev_op = None # Generate register commands for all operations + outstanding_dma_ops: List[NpuOperation] = list() + outstanding_npu_ops: List[NpuOperation] = list() for op_index, npu_op in enumerate(npu_op_list): try: check_mem_limits(memory_accesses[npu_op], mem_limits) - dep_watermark, cmd_waits = get_wait_dependency(arch, npu_op_list, memory_accesses, op_index, dep_watermark) + cmd_waits = get_wait_dependency(arch, npu_op, memory_accesses, outstanding_dma_ops, outstanding_npu_ops) generate_registers_for_op(emit, npu_op, arch) except VelaError as e: # Add operation info and rethrow |