aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/main.cc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-07-20 13:27:21 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-07-20 13:27:21 +0200
commit53034959f338c952f4cf905890e44aad2ba202ae (patch)
treebacf16dd8118ce63e75ec90d2653ea863c145239 /ice40/main.cc
parent3bad9c26cff1ba2da7f1810e5915246874780744 (diff)
downloadnextpnr-53034959f338c952f4cf905890e44aad2ba202ae.tar.gz
nextpnr-53034959f338c952f4cf905890e44aad2ba202ae.tar.bz2
nextpnr-53034959f338c952f4cf905890e44aad2ba202ae.zip
Start adding bitstream reading for ice40
Diffstat (limited to 'ice40/main.cc')
-rw-r--r--ice40/main.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/ice40/main.cc b/ice40/main.cc
index e77bdd34..c14b6086 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -95,6 +95,7 @@ int main(int argc, char *argv[])
options.add_options()("json", po::value<std::string>(), "JSON design file to ingest");
options.add_options()("pcf", po::value<std::string>(), "PCF constraints file to ingest");
options.add_options()("asc", po::value<std::string>(), "asc bitstream file to write");
+ options.add_options()("read", po::value<std::string>(), "asc bitstream file to read");
options.add_options()("seed", po::value<int>(), "seed value for random number generator");
options.add_options()("version,V", "show version");
options.add_options()("tmfuzz", "run path delay estimate fuzzer");
@@ -353,6 +354,13 @@ int main(int argc, char *argv[])
if (vm.count("no-tmdriv"))
ctx->timing_driven = false;
+ if (vm.count("read")) {
+ std::string filename = vm["read"].as<std::string>();
+ std::ifstream f(filename);
+ if (!read_asc(ctx.get(), f))
+ log_error("Loading ASC failed.\n");
+ }
+
#ifndef NO_GUI
if (vm.count("gui")) {
Application a(argc, argv);