diff options
author | Louis Verhaard <louis.verhaard@arm.com> | 2020-05-25 15:05:26 +0200 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2020-06-18 17:53:52 +0100 |
commit | 7db78969dc8ead72f3ded81b6d2a6a7ed798ea62 (patch) | |
tree | 011bcf579cc8e0f007f9564a98cc5c05df34322b /ethosu/vela/architecture_features.py | |
parent | 78792223369fa34dacd0e69e189af035283da2ae (diff) | |
download | ethos-u-vela-7db78969dc8ead72f3ded81b6d2a6a7ed798ea62.tar.gz |
MLBEDSW-2067: added custom exceptions
Added custom exceptions to handle different types of input errors.
Also performed minor formatting changes using flake8/black.
Change-Id: Ie5b05361507d5e569aff045757aec0a4a755ae98
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/architecture_features.py')
-rw-r--r-- | ethosu/vela/architecture_features.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ethosu/vela/architecture_features.py b/ethosu/vela/architecture_features.py index c712588f..1bf9d950 100644 --- a/ethosu/vela/architecture_features.py +++ b/ethosu/vela/architecture_features.py @@ -21,6 +21,7 @@ from configparser import ConfigParser import numpy as np +from .errors import OptionError from .numeric_util import round_up from .numeric_util import round_up_divide from .operation import NpuBlockType @@ -158,7 +159,7 @@ Note the difference between ArchitectureFeatures and CompilerOptions self.vela_config = vela_config self.accelerator_config = accelerator_config if self.accelerator_config not in ArchitectureFeatures.accelerator_configs: - raise Exception("Unknown accelerator configuration " + self.accelerator_config) + raise OptionError("--accelerator-config", self.accelerator_config, "Unknown accelerator configuration") accel_config = ArchitectureFeatures.accelerator_configs[self.accelerator_config] self.config = accel_config @@ -564,7 +565,7 @@ Note the difference between ArchitectureFeatures and CompilerOptions else: section_key = "SysConfig." + self.system_config if section_key not in self.vela_config: - raise Exception("Unknown system configuration " + self.system_config) + raise OptionError("--system-config", self.system_config, "Unknown system configuration") try: self.npu_clock = float(self.__sys_config("npu_freq", "500e6")) |