From 02ae21d8fc3bc1375848f40702cd4bb7f6700595 Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 24 Mar 2019 11:10:20 +0000 Subject: Add --placer option and refactor placer selection Signed-off-by: David Shah --- generic/arch.cc | 15 ++++++++++++++- generic/arch.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'generic') diff --git a/generic/arch.cc b/generic/arch.cc index 77417d27..aca81559 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -21,6 +21,7 @@ #include "nextpnr.h" #include "placer1.h" #include "router1.h" +#include "util.h" NEXTPNR_NAMESPACE_BEGIN @@ -439,7 +440,16 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay // --------------------------------------------------------------- -bool Arch::place() { return placer1(getCtx(), Placer1Cfg(getCtx())); } +bool Arch::place() +{ + std::string placer = str_or_default(settings, id("placer"), defaultPlacer); + // FIXME: No HeAP because it needs a list of IO buffers + if (placer == "sa") { + return placer1(getCtx(), Placer1Cfg(getCtx())); + } else { + log_error("Generic architecture does not support placer '%s'\n", placer.c_str()); + } +} bool Arch::route() { return router1(getCtx(), Router1Cfg(getCtx())); } @@ -476,4 +486,7 @@ TimingClockingInfo Arch::getPortClockingInfo(const CellInfo *cell, IdString port bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const { return true; } bool Arch::isBelLocationValid(BelId bel) const { return true; } +const std::string Arch::defaultPlacer = "sa"; +const std::vector Arch::availablePlacers = {"sa"}; + NEXTPNR_NAMESPACE_END diff --git a/generic/arch.h b/generic/arch.h index dc4258cc..5b5d8c55 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -240,6 +240,9 @@ struct Arch : BaseCtx bool isValidBelForCell(CellInfo *cell, BelId bel) const; bool isBelLocationValid(BelId bel) const; + + static const std::string defaultPlacer; + static const std::vector availablePlacers; }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3