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 /ice40 | |
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 'ice40')
-rw-r--r-- | ice40/arch.cc | 15 | ||||
-rw-r--r-- | ice40/arch.h | 3 | ||||
-rw-r--r-- | ice40/main.cc | 4 |
3 files changed, 16 insertions, 6 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc index ce824c83..b0839fa5 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -671,14 +671,17 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay bool Arch::place() { - if (bool_or_default(settings, id("heap_placer"), false)) { + std::string placer = str_or_default(settings, id("placer"), defaultPlacer); + if (placer == "heap") { PlacerHeapCfg cfg(getCtx()); cfg.ioBufTypes.insert(id_SB_IO); if (!placer_heap(getCtx(), cfg)) return false; - } else { + } else if (placer == "sa") { if (!placer1(getCtx(), Placer1Cfg(getCtx()))) return false; + } else { + log_error("iCE40 architecture does not support placer '%s'\n", placer.c_str()); } if (bool_or_default(settings, id("opt_timing"), false)) { TimingOptCfg tocfg(getCtx()); @@ -1205,4 +1208,12 @@ void Arch::assignCellInfo(CellInfo *cell) } } +const std::string Arch::defaultPlacer = "sa"; + +const std::vector<std::string> Arch::availablePlacers = {"sa", +#ifdef WITH_HEAP + "heap" +#endif +}; + NEXTPNR_NAMESPACE_END diff --git a/ice40/arch.h b/ice40/arch.h index 706043b2..ea29f4f1 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -897,6 +897,9 @@ struct Arch : BaseCtx IdString glb_net = getWireName(getBelPinWire(bel, id_GLOBAL_BUFFER_OUTPUT)); return std::stoi(std::string("") + glb_net.str(this).back()); } + + static const std::string defaultPlacer; + static const std::vector<std::string> availablePlacers; }; void ice40DelayFuzzerMain(Context *ctx); diff --git a/ice40/main.cc b/ice40/main.cc index 7233f169..9b79a08c 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -69,8 +69,6 @@ po::options_description Ice40CommandHandler::getArchOptions() specific.add_options()("promote-logic", "enable promotion of 'logic' globals (in addition to clk/ce/sr by default)"); specific.add_options()("no-promote-globals", "disable all global promotion"); - specific.add_options()("heap-placer", - "use HeAP analytic placer instead of simulated annealing (faster, experimental)"); specific.add_options()("opt-timing", "run post-placement timing optimisation pass (experimental)"); specific.add_options()("tmfuzz", "run path delay estimate fuzzer"); specific.add_options()("pcf-allow-unconstrained", "don't require PCF to constrain all IO"); @@ -178,8 +176,6 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext() ctx->settings[ctx->id("opt_timing")] = "1"; if (vm.count("pcf-allow-unconstrained")) ctx->settings[ctx->id("pcf_allow_unconstrained")] = "1"; - if (vm.count("heap-placer")) - ctx->settings[ctx->id("heap_placer")] = "1"; return ctx; } |