aboutsummaryrefslogtreecommitdiff
path: root/src/mlia/target/ethos_u/__init__.py
diff options
context:
space:
mode:
authorBenjamin Klimczak <benjamin.klimczak@arm.com>2023-02-02 14:02:05 +0000
committerBenjamin Klimczak <benjamin.klimczak@arm.com>2023-02-10 13:45:18 +0000
commit7a661257b6adad0c8f53e32b42ced56a1e7d952f (patch)
tree938ad8578c5b9edc0573e810ce64ce0a5bda3d8c /src/mlia/target/ethos_u/__init__.py
parent50271dee0a84bfc481ce798184f07b5b0b4bc64d (diff)
downloadmlia-7a661257b6adad0c8f53e32b42ced56a1e7d952f.tar.gz
MLIA-769 Expand use of target/backend registries
- Use the target/backend registries to avoid hard-coded names. - Cache target profiles to avoid re-loading them Change-Id: I474b7c9ef23894e1d8a3ea06d13a37652054c62e
Diffstat (limited to 'src/mlia/target/ethos_u/__init__.py')
-rw-r--r--src/mlia/target/ethos_u/__init__.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mlia/target/ethos_u/__init__.py b/src/mlia/target/ethos_u/__init__.py
index d53be53..6b6777d 100644
--- a/src/mlia/target/ethos_u/__init__.py
+++ b/src/mlia/target/ethos_u/__init__.py
@@ -1,8 +1,23 @@
# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Ethos-U target module."""
+from mlia.backend.corstone import CORSTONE_PRIORITY
+from mlia.target.ethos_u.advisor import configure_and_get_ethosu_advisor
+from mlia.target.ethos_u.config import EthosUConfiguration
+from mlia.target.ethos_u.config import get_default_ethos_u_backends
from mlia.target.registry import registry
from mlia.target.registry import TargetInfo
-registry.register("ethos-u55", TargetInfo(["Vela", "Corstone-300", "Corstone-310"]))
-registry.register("ethos-u65", TargetInfo(["Vela", "Corstone-300", "Corstone-310"]))
+SUPPORTED_BACKENDS_PRIORITY = ["Vela", *CORSTONE_PRIORITY]
+
+
+for ethos_u in ("ethos-u55", "ethos-u65"):
+ registry.register(
+ ethos_u,
+ TargetInfo(
+ supported_backends=SUPPORTED_BACKENDS_PRIORITY,
+ default_backends=get_default_ethos_u_backends(SUPPORTED_BACKENDS_PRIORITY),
+ advisor_factory_func=configure_and_get_ethosu_advisor,
+ target_profile_cls=EthosUConfiguration,
+ ),
+ )