aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-02-03 11:54:38 +0000
committerDavid Shah <dave@ds0.me>2020-02-03 11:54:38 +0000
commit7123209324c93297efab6c2b2fc92286196be3fb (patch)
tree537ed003aa78a2d7d0548a6fa4d8f9fe96feb0ac /ice40
parent25f57a1e387dd3155cf1dacb14657f000ad02fc8 (diff)
downloadnextpnr-7123209324c93297efab6c2b2fc92286196be3fb.tar.gz
nextpnr-7123209324c93297efab6c2b2fc92286196be3fb.tar.bz2
nextpnr-7123209324c93297efab6c2b2fc92286196be3fb.zip
Allow selection of router algorithm
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch.cc17
-rw-r--r--ice40/arch.h2
2 files changed, 17 insertions, 2 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 0f8e5969..edc104f0 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -28,6 +28,7 @@
#include "placer1.h"
#include "placer_heap.h"
#include "router1.h"
+#include "router2.h"
#include "timing_opt.h"
#include "util.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -696,10 +697,19 @@ bool Arch::place()
bool Arch::route()
{
- bool retVal = router1(getCtx(), Router1Cfg(getCtx()));
+ std::string router = str_or_default(settings, id("router"), defaultRouter);
+ bool result;
+ if (router == "router1") {
+ result = router1(getCtx(), Router1Cfg(getCtx()));
+ } else if (router == "router2") {
+ router2(getCtx(), Router2Cfg(getCtx()));
+ result = router1(getCtx(), Router1Cfg(getCtx()));
+ } else {
+ log_error("iCE40 architecture does not support router '%s'\n", router.c_str());
+ }
getCtx()->settings[getCtx()->id("route")] = 1;
archInfoToAttributes();
- return retVal;
+ return result;
}
// -----------------------------------------------------------------------
@@ -1257,4 +1267,7 @@ const std::vector<std::string> Arch::availablePlacers = {"sa",
#endif
};
+const std::string Arch::defaultRouter = "router1";
+const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};
+
NEXTPNR_NAMESPACE_END
diff --git a/ice40/arch.h b/ice40/arch.h
index ea29f4f1..a6a3cd70 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -900,6 +900,8 @@ struct Arch : BaseCtx
static const std::string defaultPlacer;
static const std::vector<std::string> availablePlacers;
+ static const std::string defaultRouter;
+ static const std::vector<std::string> availableRouters;
};
void ice40DelayFuzzerMain(Context *ctx);