Refactoring to adding lock check in loadtool
Less boilerplate checking inside every tool
Adding automatic conversion from true/false to bool for non value fields
@@ -351,6 +351,12 @@ class Chip:
'''
Dynamic load of tool module based on search path.
'''
+
+ # Only load tool if not already loaded
+ if self.get('eda', tool, step, index, 'exe', field='lock'):
+ self.logger.warning('Tool already configured: ' + tool)
+ return
+
try:
searchdir = "siliconcompiler.tools." + tool
modulename = '.'+tool+'_setup'
@@ -363,6 +369,9 @@ class Chip:
self.logger.error(f"Setup failed for '{tool}' in step '{step} and index {index}'")
self.error = 1
+ # Locking the tool after loading
+ self.set('eda', tool, step, index, 'exe', 'true', field='lock')
+
###########################################################################
def loadpdk(self, process):
'''
@@ -926,6 +935,11 @@ class Chip:
scalar = selval
return scalar
#all non-value fields are strings
+ else:
+ if cfg[param][field] == 'true':
+ return True
+ elif cfg[param][field] == 'false':
+ return False
else:
return cfg[param][field]
#if not leaf cell descend tree
