From 7ce6b32b815b6eb01bf3b348a3df37bb783c3a94 Mon Sep 17 00:00:00 2001 From: Rickard Bolin Date: Thu, 2 Jun 2022 09:30:33 +0000 Subject: MLBEDSW-4783: Make config handling more user friendly Vela was not able to parse config file paths entered with forward slashes. This patch will make it possible to use both forward and backslashes when specifying paths. Signed-off-by: Rickard Bolin Change-Id: I0f4cfc16bde5738c73059af6216d2bdc3821c68b --- ethosu/vela/architecture_features.py | 2 ++ ethosu/vela/vela.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ethosu/vela/architecture_features.py b/ethosu/vela/architecture_features.py index 679947f..e0e44b2 100644 --- a/ethosu/vela/architecture_features.py +++ b/ethosu/vela/architecture_features.py @@ -741,6 +741,8 @@ class ArchitectureFeatures: # display the system configuration and memory mode if verbose_config: + print("Configuration files:") + print(f" {vela_config_files}") print(f"System Configuration ({self.system_config}):") print(f" core_clock = {self.core_clock}") print(f" axi0_port = {self.axi0_port.name}") diff --git a/ethosu/vela/vela.py b/ethosu/vela/vela.py index bbacc9c..90cff03 100644 --- a/ethosu/vela/vela.py +++ b/ethosu/vela/vela.py @@ -51,7 +51,7 @@ from .tosa_model_semantic import TosaSemantic from .tosa_supported_operators import TosaSupportedOperators from ethosu.vela.architecture_features import ArchitectureFeatures -CONFIG_FILES_PATH = os.path.abspath(f"{__file__}/../../config_files") +CONFIG_FILES_PATH = os.path.normpath(os.path.join(__file__, "..", "..", "config_files")) def process(input_name, enable_debug_db, arch, model_reader_options, compiler_options, scheduler_options): @@ -464,6 +464,9 @@ def main(args=None): parser.error("the following argument is required: NETWORK") def _parse_config(config): + # Make sure the correct separator is used depending on OS + config = os.path.normpath(config) + if not config.endswith(".ini"): raise InputFileError(config, "Configuration files must use the .ini extension") -- cgit v1.2.1