diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/initialize.py | 9 | ||||
-rwxr-xr-x | scripts/loop.py | 65 | ||||
-rw-r--r-- | scripts/solution.py | 14 |
3 files changed, 33 insertions, 55 deletions
diff --git a/scripts/initialize.py b/scripts/initialize.py index da54aee..2c2ca59 100755 --- a/scripts/initialize.py +++ b/scripts/initialize.py @@ -17,11 +17,10 @@ def all(): base() parse_kconfig() gen_requred() - if conf.gen_all_solution_oninit: - try: - solution.generate() - except exceptions.NoSolution: - pass + try: + solution.generate() + except exceptions.NoSolution: + pass def base(): print('Initialize base...') diff --git a/scripts/loop.py b/scripts/loop.py index 0fd3639..712b054 100755 --- a/scripts/loop.py +++ b/scripts/loop.py @@ -23,16 +23,7 @@ def step(): phase_message(2) phase_set(3) elif phs == 3: - if not conf.gen_all_solution_oninit: - phase_message(3) - solution.generate() - iteration_inc() - phase_set(4) - elif phs == 4: - phase_message(4) - phase_set(5) - elif phs == 5: - phase_message(5) + phase_message(3) try: solution.apply() except exceptions.NoApplicableSolution: @@ -42,54 +33,52 @@ def step(): pass print('\nAll done.') exit(0) - phase_set(6) - elif phs == 6: - phase_message(6) - phase_set(7) - elif phs == 7: - phase_message(7) + phase_set(4) + elif phs == 4: + phase_message(4) + phase_set(5) + elif phs == 5: + phase_message(5) try: kernel.config() except exceptions.ConfigurationError: if not conf.ignore_misconfig: print("Configuration mismatch. Exiting.") sys.exit(-2) - phase_set(8) - elif phs == 8: - phase_message(8) + phase_set(6) + elif phs == 6: + phase_message(6) if conf.only_config: phase_set(3) else: - phase_set(9) + phase_set(7) + elif phs == 7: + phase_message(7) + kernel.make() + phase_set(8) + elif phs == 8: + phase_message(8) + phase_set(9) elif phs == 9: phase_message(9) - kernel.make() + boot.boot() phase_set(10) elif phs == 10: phase_message(10) - phase_set(11) - elif phs == 11: - phase_message(11) - boot.boot() - phase_set(12) - elif phs == 12: - phase_message(12) phase_set(3) # Phase # phases = ("Not Initialized", #0 "Initializing", #1 "Initialized", #2 - "Solution generating", #3 - "Solution generated", #4 - "Solution applying", #5 - "Solution applied", #6 - "Kernel configuration", #7 - "Kernel configured", #8 - "Kernel build", #9 - "Kernel built", #10 - "System boot", #11 - "Benchmark successful" #12 + "Solution applying", #3 + "Solution applied", #4 + "Kernel configuration", #5 + "Kernel configured", #6 + "Kernel build", #7 + "Kernel built", #8 + "System boot", #9 + "Benchmark successful" #10 ) def phase_get(): diff --git a/scripts/solution.py b/scripts/solution.py index 930297b..722aaaf 100644 --- a/scripts/solution.py +++ b/scripts/solution.py @@ -17,7 +17,7 @@ def generate(): if not os.path.isfile(sf(conf.rules_file)): raise exceptions.MissingFile(conf.rules_file,"Run parse_kconfig.") - if os.path.isfile(sf(conf.solution_file)) and conf.gen_all_solution_oninit: + if os.path.isfile(sf(conf.solution_file)): raise exceptions.SolutionGenerated() w_file = tempfile.NamedTemporaryFile(delete=False) @@ -28,11 +28,6 @@ def generate(): ln = lnn.rstrip() if ln not in lines: lines.add(ln) - if os.path.isfile(sf(conf.solved_file)): - for lnn in open(sf(conf.solved_file), 'r'): - ln = lnn.rstrip() - if ln not in lines: - lines.add(ln) if os.path.isfile(sf(conf.required_file)): for lnn in open(sf(conf.required_file), 'r'): ln = lnn.rstrip() @@ -57,8 +52,7 @@ def generate(): pass picosat_cmd = [sf(conf.picosat), w_file.name] - if (conf.gen_all_solution_oninit): - picosat_cmd += ['--all'] + picosat_cmd += conf.picosat_args satprc = subprocess.Popen(picosat_cmd, stdout = subprocess.PIPE) with open(os.path.join(sf(conf.log_folder), "picosat.log"), 'a') as f: @@ -77,10 +71,6 @@ def generate(): for sl in solut: fm.write(str(sl) + ' ') fm.write('\n') - with open(sf(conf.solved_file), 'a') as fs: - for sl in solut: - fs.write(str(-1 * sl) + ' ') - fs.write('\n') except ValueError: pass solut = [] |