aboutsummaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-03-24 11:10:20 +0000
committerDavid Shah <dave@ds0.me>2019-03-24 11:10:20 +0000
commit02ae21d8fc3bc1375848f40702cd4bb7f6700595 (patch)
treedb9e1fc5f4329285c9c5c5a5eb1c615418530138 /generic
parent52e05f4a0706b1c108221e600ff11e654f6e85a5 (diff)
downloadnextpnr-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 'generic')
-rw-r--r--generic/arch.cc15
-rw-r--r--generic/arch.h3
2 files changed, 17 insertions, 1 deletions
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<std::string> 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<std::string> availablePlacers;
};
NEXTPNR_NAMESPACE_END