aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'machxo2/main.cc')
-rw-r--r--machxo2/main.cc49
1 files changed, 9 insertions, 40 deletions
diff --git a/machxo2/main.cc b/machxo2/main.cc
index e29e117b..e5b8176a 100644
--- a/machxo2/main.cc
+++ b/machxo2/main.cc
@@ -47,26 +47,9 @@ MachXO2CommandHandler::MachXO2CommandHandler(int argc, char **argv) : CommandHan
po::options_description MachXO2CommandHandler::getArchOptions()
{
po::options_description specific("Architecture specific options");
- if (Arch::is_available(ArchArgs::LCMXO2_256HC))
- specific.add_options()("256", "set device type to LCMXO2-256HC");
- if (Arch::is_available(ArchArgs::LCMXO2_640HC))
- specific.add_options()("640", "set device type to LCMXO2-640HC");
- if (Arch::is_available(ArchArgs::LCMXO2_1200HC))
- specific.add_options()("1200", "set device type to LCMXO2-1200HC");
- if (Arch::is_available(ArchArgs::LCMXO2_2000HC))
- specific.add_options()("2000", "set device type to LCMXO2-2000HC");
- if (Arch::is_available(ArchArgs::LCMXO2_4000HC))
- specific.add_options()("4000", "set device type to LCMXO2-4000HC");
- if (Arch::is_available(ArchArgs::LCMXO2_7000HC))
- specific.add_options()("7000", "set device type to LCMXO2-7000HC");
-
- specific.add_options()("package", po::value<std::string>(), "select device package");
- specific.add_options()("speed", po::value<int>(), "select device speedgrade (1 to 6 inclusive)");
-
- specific.add_options()("override-basecfg", po::value<std::string>(),
- "base chip configuration in Trellis text format");
+ specific.add_options()("device", po::value<std::string>(), "device name");
+ specific.add_options()("list-devices", "list all supported device names");
specific.add_options()("textcfg", po::value<std::string>(), "textual configuration in Trellis format to write");
-
// specific.add_options()("lpf", po::value<std::vector<std::string>>(), "LPF pin constraint file(s)");
return specific;
@@ -84,28 +67,14 @@ void MachXO2CommandHandler::customBitstream(Context *ctx)
std::unique_ptr<Context> MachXO2CommandHandler::createContext(dict<std::string, Property> &values)
{
ArchArgs chipArgs;
- chipArgs.type = ArchArgs::NONE;
- if (vm.count("256"))
- chipArgs.type = ArchArgs::LCMXO2_256HC;
- if (vm.count("640"))
- chipArgs.type = ArchArgs::LCMXO2_640HC;
- if (vm.count("1200"))
- chipArgs.type = ArchArgs::LCMXO2_1200HC;
- if (vm.count("2000"))
- chipArgs.type = ArchArgs::LCMXO2_2000HC;
- if (vm.count("4000"))
- chipArgs.type = ArchArgs::LCMXO2_4000HC;
- if (vm.count("7000"))
- chipArgs.type = ArchArgs::LCMXO2_7000HC;
- if (vm.count("package"))
- chipArgs.package = vm["package"].as<std::string>();
-
- if (values.find("arch.name") != values.end()) {
- std::string arch_name = values["arch.name"].as_string();
- if (arch_name != "machxo2")
- log_error("Unsuported architecture '%s'.\n", arch_name.c_str());
+ if (vm.count("list-devices")) {
+ Arch::list_devices();
+ exit(0);
}
-
+ if (!vm.count("device")) {
+ log_error("device must be specified on the command line (e.g. --device LCMXO2-7000HC-4TG144I)\n");
+ }
+ chipArgs.device = vm["device"].as<std::string>();
auto ctx = std::unique_ptr<Context>(new Context(chipArgs));
return ctx;
}