aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
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 /ecp5
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 'ecp5')
-rw-r--r--ecp5/arch.cc18
-rw-r--r--ecp5/arch.h2
2 files changed, 18 insertions, 2 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index 52cfc187..b8abec64 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -621,12 +621,23 @@ bool Arch::place()
bool Arch::route()
{
+ std::string router = str_or_default(settings, id("router"), defaultRouter);
+
setupWireLocations();
route_ecp5_globals(getCtx());
assignArchInfo();
assign_budget(getCtx(), true);
- router2(getCtx(), Router2Cfg(getCtx()));
- bool result = router1(getCtx(), Router1Cfg(getCtx()));
+
+ 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("ECP5 architecture does not support router '%s'\n", router.c_str());
+ }
+
#if 0
std::vector<std::pair<WireId, int>> fanout_vector;
std::copy(wire_fanout.begin(), wire_fanout.end(), std::back_inserter(fanout_vector));
@@ -1173,6 +1184,9 @@ const std::vector<std::string> Arch::availablePlacers = {"sa",
#endif
};
+const std::string Arch::defaultRouter = "router1";
+const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};
+
// -----------------------------------------------------------------------
GroupId Arch::getGroupByName(IdString name) const
diff --git a/ecp5/arch.h b/ecp5/arch.h
index 24997768..55494b1f 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -1066,6 +1066,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;
};
NEXTPNR_NAMESPACE_END