Cleaning up CLI config order
1.) Read env
2.) if sc_target is set and one of preconfigured platforms, load config with python call
3.) if sc_cfgfiles set at command line read those
4.) Command line overrides
@@ -141,10 +141,11 @@ def main():
#Create one (or many...) instances of Chip class
mychip = sc.Chip()
mychip.writecfg("default.json")
+
# Reading in user variables
mychip.readenv()
- # Checking for built in targets
+ # Loading presetvalues from the command line
if 'sc_target' in cmdlinecfg.keys():
target = cmdlinecfg['sc_target']['value']
if target == 'nangate45':
@@ -156,7 +157,12 @@ def main():
setup_asap7_library(mychip)
setup_openroad(mychip)
- # Reading in command line arguments
+ # Reading in config files specified at command line
+ if 'sc_cfgfile' in cmdlinecfg.keys():
+ for cfgfile in cmdlinecfg['sc_cfgfile']['value']:
+ chip.readcfg(cfgfile)
+
+ # Override with command line arguments
mychip.mergecfg(cmdlinecfg)
#Resolve as absolute paths (should be a switch)
@@ -175,7 +181,6 @@ def main():
for stage in all_stages:
mychip.run(stage)
-
#########################
if __name__ == "__main__":
sys.exit(main())
