aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-07-13 09:14:48 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-07-13 09:14:48 +0200
commit8e54ac15421be441ece2a85ff0d61e850a99b2e9 (patch)
treeeb21944633c881ff6f3e411f4ce9dfc67f9e47c4 /ecp5
parent499951cb65ff31fe15aa360a6b44371b13815d66 (diff)
downloadnextpnr-8e54ac15421be441ece2a85ff0d61e850a99b2e9.tar.gz
nextpnr-8e54ac15421be441ece2a85ff0d61e850a99b2e9.tar.bz2
nextpnr-8e54ac15421be441ece2a85ff0d61e850a99b2e9.zip
Use command line parameters settings for GUI as well.
Diffstat (limited to 'ecp5')
-rw-r--r--ecp5/main.cc66
1 files changed, 34 insertions, 32 deletions
diff --git a/ecp5/main.cc b/ecp5/main.cc
index 59403a93..734ae560 100644
--- a/ecp5/main.cc
+++ b/ecp5/main.cc
@@ -93,16 +93,18 @@ int main(int argc, char *argv[])
}
if (vm.count("help") || argc == 1) {
- std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git "
- "sha1 " GIT_COMMIT_HASH_STR ")\n";
+ std::cout << boost::filesystem::basename(argv[0])
+ << " -- Next Generation Place and Route (git "
+ "sha1 " GIT_COMMIT_HASH_STR ")\n";
std::cout << "\n";
std::cout << options << "\n";
return argc != 1;
}
if (vm.count("version")) {
- std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git "
- "sha1 " GIT_COMMIT_HASH_STR ")\n";
+ std::cout << boost::filesystem::basename(argv[0])
+ << " -- Next Generation Place and Route (git "
+ "sha1 " GIT_COMMIT_HASH_STR ")\n";
return 1;
}
@@ -112,41 +114,51 @@ int main(int argc, char *argv[])
args.type = ArchArgs::LFE5U_45F;
args.package = "CABGA381";
args.speed = 6;
- Context ctx(args);
+ std::unique_ptr<Context> ctx = std::unique_ptr<Context>(new Context(args));
if (vm.count("verbose")) {
- ctx.verbose = true;
+ ctx->verbose = true;
}
if (vm.count("force")) {
- ctx.force = true;
+ ctx->force = true;
}
if (vm.count("seed")) {
- ctx.rngseed(vm["seed"].as<int>());
+ ctx->rngseed(vm["seed"].as<int>());
}
+ ctx->timing_driven = true;
+ if (vm.count("no-tmdriv"))
+ ctx->timing_driven = false;
+
+#ifndef NO_GUI
+ if (vm.count("gui")) {
+ Application a(argc, argv);
+ MainWindow w(std::move(ctx));
+ w.show();
+
+ return a.exec();
+ }
+#endif
if (vm.count("json")) {
std::string filename = vm["json"].as<std::string>();
std::ifstream f(filename);
- if (!parse_json_file(f, filename, &ctx))
+ if (!parse_json_file(f, filename, ctx.get()))
log_error("Loading design failed.\n");
- if (!pack_design(&ctx) && !ctx.force)
+ if (!pack_design(ctx.get()) && !ctx->force)
log_error("Packing design failed.\n");
if (vm.count("freq"))
- ctx.target_freq = vm["freq"].as<double>() * 1e6;
- assign_budget(&ctx);
- ctx.check();
- print_utilisation(&ctx);
- ctx.timing_driven = true;
- if (vm.count("no-tmdriv"))
- ctx.timing_driven = false;
-
- if (!ctx.place() && !ctx.force)
+ ctx->target_freq = vm["freq"].as<double>() * 1e6;
+ assign_budget(ctx.get());
+ ctx->check();
+ print_utilisation(ctx.get());
+
+ if (!ctx->place() && !ctx->force)
log_error("Placing design failed.\n");
- ctx.check();
- if (!ctx.route() && !ctx.force)
+ ctx->check();
+ if (!ctx->route() && !ctx->force)
log_error("Routing design failed.\n");
std::string basecfg;
@@ -160,7 +172,7 @@ int main(int argc, char *argv[])
std::string textcfg;
if (vm.count("textcfg"))
textcfg = vm["textcfg"].as<std::string>();
- write_bitstream(&ctx, basecfg, textcfg, bitstream);
+ write_bitstream(ctx.get(), basecfg, textcfg, bitstream);
}
#ifndef NO_PYTHON
@@ -175,16 +187,6 @@ int main(int argc, char *argv[])
deinit_python();
}
#endif
-
-#ifndef NO_GUI
- if (vm.count("gui")) {
- Application a(argc, argv);
- MainWindow w;
- w.show();
-
- rc = a.exec();
- }
-#endif
return rc;
} catch (log_execution_error_exception) {
#if defined(_MSC_VER)