diff options
author | Michael McGeagh <michael.mcgeagh@arm.com> | 2020-12-02 15:29:22 +0000 |
---|---|---|
committer | Michael McGeagh <michael.mcgeagh@arm.com> | 2020-12-14 11:38:03 +0000 |
commit | 7a6f8438aaf750380a9fff799ca81ff5c7e2ae43 (patch) | |
tree | 163c6868ec869ae52a5cfd848207dcf0ef7b212e /ethosu/vela/shared_buffer_allocation.py | |
parent | 9b43f846b144d39bfb0cf16853bf6901c74b6672 (diff) | |
download | ethos-u-vela-7a6f8438aaf750380a9fff799ca81ff5c7e2ae43.tar.gz |
MLBEDSW-2066 Improve Exception messages
Minor refactoring to use fstrings.
Improve Error classes to correctly inherit the base class.
Use existing exception classes instead of plain exceptions where it
makes sense.
Signed-off-by: Michael McGeagh <michael.mcgeagh@arm.com>
Change-Id: I0941c04e91010da1db77299517a8e2d896371e77
Diffstat (limited to 'ethosu/vela/shared_buffer_allocation.py')
-rw-r--r-- | ethosu/vela/shared_buffer_allocation.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ethosu/vela/shared_buffer_allocation.py b/ethosu/vela/shared_buffer_allocation.py index 21b048bc..600b3170 100644 --- a/ethosu/vela/shared_buffer_allocation.py +++ b/ethosu/vela/shared_buffer_allocation.py @@ -26,7 +26,7 @@ from .architecture_features import ArchitectureFeatures from .architecture_features import Block from .architecture_features import SharedBufferArea from .architecture_features import SHRAMElements -from .errors import VelaError +from .errors import AllocationError from .ethos_u55_regs.ethos_u55_regs import resampling_mode from .operation import Kernel from .operation import NpuBlockType @@ -259,7 +259,7 @@ def find_suitable_block_configs(arch, alloc: SharedBufferAllocation) -> List[Tup if arch.override_block_config: config = alloc.try_block(arch.override_block_config) if config is None: - raise VelaError("Block config override '{0}' cannot be allocated".format(arch.override_block_config)) + raise AllocationError(f"Block config override '{arch.override_block_config}' cannot be allocated") return [config] # Constrain the search space if the OFM is smaller than the max block size |