aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/globals.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-05-14 13:12:30 +0100
committerDavid Shah <dave@ds0.me>2020-05-14 13:12:30 +0100
commit3c60ea383d988937c45559fcc2f387b3c187287f (patch)
treedf7c99cd3bdc9dba87c9f91ae2b25d095d688bd4 /ecp5/globals.cc
parent2aaef61547b78fc005cc7e0e7b6651660f58123a (diff)
downloadnextpnr-3c60ea383d988937c45559fcc2f387b3c187287f.tar.gz
nextpnr-3c60ea383d988937c45559fcc2f387b3c187287f.tar.bz2
nextpnr-3c60ea383d988937c45559fcc2f387b3c187287f.zip
ecp5: Improve global routing robustness
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/globals.cc')
-rw-r--r--ecp5/globals.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/ecp5/globals.cc b/ecp5/globals.cc
index 28061e1a..550af615 100644
--- a/ecp5/globals.cc
+++ b/ecp5/globals.cc
@@ -63,6 +63,13 @@ class Ecp5GlobalRouter
return false;
}
+ bool is_logic_port(const PortRef &user)
+ {
+ if (user.cell->type == id_TRELLIS_SLICE && user.port != id_CLK && user.port != id_WCK)
+ return true;
+ return false;
+ }
+
std::vector<NetInfo *> get_clocks()
{
std::unordered_map<IdString, int> clockCount;
@@ -162,6 +169,8 @@ class Ecp5GlobalRouter
if (ctx->checkWireAvail(next)) {
for (auto pip : ctx->getPipsUphill(next)) {
WireId src = ctx->getPipSrcWire(pip);
+ if (backtrace.count(src))
+ continue;
backtrace[src] = pip;
upstream.push(src);
}
@@ -414,6 +423,8 @@ class Ecp5GlobalRouter
keep_users.push_back(user);
} else if (net->driver.cell->type == id_EXTREFB && user.cell->type == id_DCUA) {
keep_users.push_back(user);
+ } else if (is_logic_port(user)) {
+ keep_users.push_back(user);
} else {
glbnet->users.push_back(user);
user.cell->ports.at(user.port).net = glbnet.get();