aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/main.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-27 12:00:37 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-27 12:00:37 +0200
commit87a5b7212667daa55a72f62c35cc248bdce2c744 (patch)
treecd541aeba55bbc67e1a935bb00b7669a9eed0d32 /ice40/main.cc
parent2cc7ade05b52b89186f5210c97ebbc61aa5c166d (diff)
parentbafb4702c7176a08e4a9b2088297071a7bed6656 (diff)
downloadnextpnr-87a5b7212667daa55a72f62c35cc248bdce2c744.tar.gz
nextpnr-87a5b7212667daa55a72f62c35cc248bdce2c744.tar.bz2
nextpnr-87a5b7212667daa55a72f62c35cc248bdce2c744.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'ice40/main.cc')
-rw-r--r--ice40/main.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/ice40/main.cc b/ice40/main.cc
index ecaba87f..f1736fab 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -269,11 +269,6 @@ int main(int argc, char *argv[])
Context ctx(chipArgs);
-#ifndef NO_PYTHON
- init_python(argv[0]);
- python_export_global("ctx", ctx);
-#endif
-
if (vm.count("verbose")) {
ctx.verbose = true;
}
@@ -390,9 +385,14 @@ int main(int argc, char *argv[])
#ifndef NO_PYTHON
if (vm.count("run")) {
+ init_python(argv[0], true);
+ python_export_global("ctx", ctx);
+
std::vector<std::string> files = vm["run"].as<std::vector<std::string>>();
for (auto filename : files)
execute_python_file(filename.c_str());
+
+ deinit_python();
}
#endif
@@ -405,10 +405,6 @@ int main(int argc, char *argv[])
rc = a.exec();
}
#endif
-
-#ifndef NO_PYTHON
- deinit_python();
-#endif
return rc;
} catch (log_execution_error_exception) {
#if defined(_MSC_VER)