aboutsummaryrefslogtreecommitdiff
path: root/scripts/sat_solution.py
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-02-03 20:57:20 +0100
committerKarel Kočí <cynerd@email.cz>2015-02-03 20:57:20 +0100
commitef85245f159402fd948ff045b56ad9095d22b39e (patch)
treecf5d0f0ce017ed4c29c2c46da0cb6311c88c2733 /scripts/sat_solution.py
parent9f07dd89b7cd2de6ce341afd1aed3e6bd0122a27 (diff)
downloadlinux-conf-perf-ef85245f159402fd948ff045b56ad9095d22b39e.tar.gz
linux-conf-perf-ef85245f159402fd948ff045b56ad9095d22b39e.tar.bz2
linux-conf-perf-ef85245f159402fd948ff045b56ad9095d22b39e.zip
Implementing main loop
These new scripts are part of main loop. kernel is not finished!! Divides kconfig_parser, sat_solution to better named modules. Phasing and iteration is implemented for loop watching.
Diffstat (limited to 'scripts/sat_solution.py')
-rwxr-xr-xscripts/sat_solution.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/scripts/sat_solution.py b/scripts/sat_solution.py
deleted file mode 100755
index 1a44678..0000000
--- a/scripts/sat_solution.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/python3
-import os
-import sys
-import tempfile
-import subprocess
-from conf import conf
-
-if not os.path.isfile(conf.rules_file):
- print("Error: Rules are not generated yet, or wrong build_folder.\nCheck existence of " + rules_file, file=sys.stderr)
- sys.exit(1)
-
-
-#w_file = tempfile.NamedTemporaryFile(delete=False)
-w_file = open('bld', 'w')
-# Join files to one single file
-lines = set()
-for ln in open(conf.rules_file, 'r'):
- if ln not in lines:
- lines.add(ln)
-if os.path.isfile(conf.solved_file):
- for ln in open(conf.solved_file, 'r'):
- if ln not in lines:
- lines.add(ln)
-if os.path.isfile(conf.required_file):
- for ln in open(conf.required_file, 'r'):
- if ln not in lines:
- lines.add(ln)
-
-with open(conf.symbol_map_file) as f:
- for var_num, l in enumerate(f):
- pass
- var_num += 1
-lines_count = len(lines)
-
-first_line = "p cnf " + str(var_num) + " " + str(lines_count)
-w_file.write(first_line + '\n')
-for ln in lines:
- w_file.write(ln)
-
-w_file.close()
-
-print("temp file: " + w_file.name)
-print("Output: " + conf.solution_file)
-subprocess.call(['minisat', w_file.name, conf.solution_file])
-
-#os.remove(w_file.name)