diff options
Diffstat (limited to 'ecp5/main.cc')
| -rw-r--r-- | ecp5/main.cc | 23 | 
1 files changed, 18 insertions, 5 deletions
| diff --git a/ecp5/main.cc b/ecp5/main.cc index 75126cea..24a98df4 100644 --- a/ecp5/main.cc +++ b/ecp5/main.cc @@ -71,6 +71,10 @@ po::options_description ECP5CommandHandler::getArchOptions()      specific.add_options()("lpf", po::value<std::vector<std::string>>(), "LPF pin constraint file(s)");      specific.add_options()("lpf-allow-unconstrained", "don't require LPF file(s) to constrain all IO"); +    specific.add_options()( +            "out-of-context", +            "disable IO buffer insertion and global promotion/routing, for building pre-routed blocks (experimental)"); +      return specific;  }  void ECP5CommandHandler::validate() @@ -91,6 +95,10 @@ void ECP5CommandHandler::customBitstream(Context *ctx)          basecfg = vm["basecfg"].as<std::string>();      } +    if (bool_or_default(ctx->settings, ctx->id("arch.ooc")) && vm.count("textcfg")) +        log_error("bitstream generation is not available in out-of-context mode (use --write to create a post-PnR JSON " +                  "design)\n"); +      std::string textcfg;      if (vm.count("textcfg"))          textcfg = vm["textcfg"].as<std::string>(); @@ -162,12 +170,12 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st              chipArgs.speed = ArchArgs::SPEED_6;      }      if (values.find("arch.name") != values.end()) { -        std::string arch_name = values["arch.name"].str; +        std::string arch_name = values["arch.name"].as_string();          if (arch_name != "ecp5")              log_error("Unsuported architecture '%s'.\n", arch_name.c_str());      }      if (values.find("arch.type") != values.end()) { -        std::string arch_type = values["arch.type"].str; +        std::string arch_type = values["arch.type"].as_string();          if (chipArgs.type != ArchArgs::NONE)              log_error("Overriding architecture is unsuported.\n"); @@ -196,10 +204,10 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st      if (values.find("arch.package") != values.end()) {          if (vm.count("package"))              log_error("Overriding architecture is unsuported.\n"); -        chipArgs.package = values["arch.package"].str; +        chipArgs.package = values["arch.package"].as_string();      }      if (values.find("arch.speed") != values.end()) { -        std::string arch_speed = values["arch.speed"].str; +        std::string arch_speed = values["arch.speed"].as_string();          if (arch_speed == "6")              chipArgs.speed = ArchArgs::SPEED_6;          else if (arch_speed == "7") @@ -212,8 +220,11 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st      if (chipArgs.type == ArchArgs::NONE)          chipArgs.type = ArchArgs::LFE5U_45F; -    if (chipArgs.package.empty()) +    if (chipArgs.package.empty()) {          chipArgs.package = "CABGA381"; +        log_warning("Use of default value for --package is deprecated. Please add '--package %s' to arguments.\n", +                    chipArgs.package.c_str()); +    }      if (chipArgs.type == ArchArgs::LFE5UM5G_25F || chipArgs.type == ArchArgs::LFE5UM5G_45F ||          chipArgs.type == ArchArgs::LFE5UM5G_85F) { @@ -228,6 +239,8 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st          ctx->settings[ctx->id(val.first)] = val.second;      ctx->settings[ctx->id("arch.package")] = ctx->archArgs().package;      ctx->settings[ctx->id("arch.speed")] = speedString(ctx->archArgs().speed); +    if (vm.count("out-of-context")) +        ctx->settings[ctx->id("arch.ooc")] = 1;      return ctx;  } | 
