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.
This commit is contained in:
Mik Igor 2023-10-26 23:53:03 +02:00 committed by GitHub
parent 3113798b13
commit ce2b11ebd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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)