diff options
author | David Shah <dave@ds0.me> | 2019-03-24 11:10:20 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2019-03-24 11:10:20 +0000 |
commit | 02ae21d8fc3bc1375848f40702cd4bb7f6700595 (patch) | |
tree | db9e1fc5f4329285c9c5c5a5eb1c615418530138 /ecp5 | |
parent | 52e05f4a0706b1c108221e600ff11e654f6e85a5 (diff) | |
download | nextpnr-02ae21d8fc3bc1375848f40702cd4bb7f6700595.tar.gz nextpnr-02ae21d8fc3bc1375848f40702cd4bb7f6700595.tar.bz2 nextpnr-02ae21d8fc3bc1375848f40702cd4bb7f6700595.zip |
Add --placer option and refactor placer selection
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/arch.cc | 30 | ||||
-rw-r--r-- | ecp5/arch.h | 3 | ||||
-rw-r--r-- | ecp5/main.cc | 6 |
3 files changed, 24 insertions, 15 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc index d4b53f47..9da8abdf 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -508,21 +508,21 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay bool Arch::place() { - // HeAP is the default unless overriden or not built -#ifdef WITH_HEAP - if (bool_or_default(settings, id("sa_placer"), false)) { -#endif - if (!placer1(getCtx(), Placer1Cfg(getCtx()))) - return false; -#ifdef WITH_HEAP - } else { + std::string placer = str_or_default(settings, id("placer"), defaultPlacer); + + if (placer == "heap") { PlacerHeapCfg cfg(getCtx()); cfg.criticalityExponent = 7; cfg.ioBufTypes.insert(id_TRELLIS_IO); if (!placer_heap(getCtx(), cfg)) return false; + } else if (placer == "sa") { + if (!placer1(getCtx(), Placer1Cfg(getCtx()))) + return false; + } else { + log_error("ECP5 architecture does not support placer '%s'\n", placer.c_str()); } -#endif + permute_luts(); return true; } @@ -986,4 +986,16 @@ WireId Arch::getBankECLK(int bank, int eclk) return getWireByLocAndBasename(Location(0, 0), "G_BANK" + std::to_string(bank) + "ECLK" + std::to_string(eclk)); } +#ifdef WITH_HEAP +const std::string Arch::defaultPlacer = "heap"; +#else +const std::string Arch::defaultPlacer = "sa"; +#endif + +const std::vector<std::string> Arch::availablePlacers = {"sa", +#ifdef WITH_HEAP + "heap" +#endif +}; + NEXTPNR_NAMESPACE_END diff --git a/ecp5/arch.h b/ecp5/arch.h index 2e86988a..3de06a42 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -1045,6 +1045,9 @@ struct Arch : BaseCtx IdString id_srmode, id_mode; mutable std::unordered_map<DelayKey, std::pair<bool, DelayInfo>> celldelay_cache; + + static const std::string defaultPlacer; + static const std::vector<std::string> availablePlacers; }; NEXTPNR_NAMESPACE_END diff --git a/ecp5/main.cc b/ecp5/main.cc index de279e63..bb18aa58 100644 --- a/ecp5/main.cc +++ b/ecp5/main.cc @@ -59,8 +59,6 @@ po::options_description ECP5CommandHandler::getArchOptions() specific.add_options()("um5g-45k", "set device type to LFE5UM5G-45F"); specific.add_options()("um5g-85k", "set device type to LFE5UM5G-85F"); - specific.add_options()("sa-placer", "use pure simulated annealing placer instead of HeAP analytic placer"); - specific.add_options()("package", po::value<std::string>(), "select device package (defaults to CABGA381)"); specific.add_options()("speed", po::value<int>(), "select device speedgrade (6, 7 or 8)"); @@ -152,10 +150,6 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext() } } auto ctx = std::unique_ptr<Context>(new Context(chipArgs)); - - if (vm.count("sa-placer")) - ctx->settings[ctx->id("sa_placer")] = "1"; - return ctx; } |