aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ice40/main.cc')
-rw-r--r--ice40/main.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/ice40/main.cc b/ice40/main.cc
index 0724acdf..4a2e9532 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -168,6 +168,11 @@ int main(int argc, char *argv[])
pt::read_json(filename, root);
log_info("Loading project %s...\n", filename.c_str());
log_break();
+
+ bool isLoadingGui = vm.count("gui") > 0;
+ std::string ascOutput;
+ if (vm.count("asc"))
+ ascOutput = vm["asc"].as<std::string>();
vm.clear();
int version = root.get<int>("project.version");
@@ -199,6 +204,10 @@ int main(int argc, char *argv[])
if (params.count("seed"))
vm.insert(std::make_pair("seed", po::variable_value(params.get<int>("seed"), false)));
}
+ if (!ascOutput.empty())
+ vm.insert(std::make_pair("asc", po::variable_value(ascOutput, false)));
+ if (isLoadingGui)
+ vm.insert(std::make_pair("gui", po::variable_value()));
po::notify(vm);
} catch (...) {
log_error("Error loading project file.\n");
@@ -397,9 +406,11 @@ int main(int argc, char *argv[])
if (vm.count("json")) {
std::string filename = vm["json"].as<std::string>();
std::string pcf = "";
- if (vm.count("pcf"))
+ w.load_json(filename);
+ if (vm.count("pcf")) {
pcf = vm["pcf"].as<std::string>();
- w.load_json(filename, pcf);
+ w.load_pcf(pcf);
+ }
}
w.show();