From ce2b11ebd935b808737e2068519772363e305634 Mon Sep 17 00:00:00 2001 From: Mik Igor <136681630+htm23x@users.noreply.github.com> Date: Thu, 26 Oct 2023 23:53:03 +0200 Subject: [PATCH] Validate tech_name param in compiler/globals.py We need to pre-validate the tech_name param in the config file or python will comply with a non-very-descriptive message that can confuse the user about where's the problem. --- compiler/globals.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/globals.py b/compiler/globals.py index b0de2c06..9d39b80f 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -564,6 +564,12 @@ def import_tech(): sys.path.append(tech_path) debug.info(1, "Adding technology path: {}".format(tech_path)) + # Validate tech_name param + techname_lower = OPTS.tech_name.lower() + if (techname_lower is None) or (techname_lower!="sky130" and techname_lower!="scn3m_subm" and techname_lower!="scn4m_subm") : + debug.error("tech_name in config file should be sky130|scn3m_subm|scn4m_subm") + quit() + # Import the tech try: tech_mod = __import__(OPTS.tech_name)