aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-09-29 19:31:49 +0100
committerDavid Shah <davey1576@gmail.com>2018-09-29 19:31:49 +0100
commit0e0ad26f07354938820b6acd1d422fee3208767e (patch)
treefa4a6902ad778d4f97081dae5bda1d9dd4c6e9a9
parentab063b2456a6b1c3893af9a809d3cb276a6f8c21 (diff)
downloadnextpnr-0e0ad26f07354938820b6acd1d422fee3208767e.tar.gz
nextpnr-0e0ad26f07354938820b6acd1d422fee3208767e.tar.bz2
nextpnr-0e0ad26f07354938820b6acd1d422fee3208767e.zip
ecp5: Use ArchNetInfo to mark global nets to ignore
Signed-off-by: David Shah <davey1576@gmail.com>
-rw-r--r--common/nextpnr.cc12
-rw-r--r--common/router1.cc2
-rw-r--r--ecp5/archdefs.h2
-rw-r--r--ecp5/globals.cc1
4 files changed, 10 insertions, 7 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc
index d47a8525..068bca6f 100644
--- a/common/nextpnr.cc
+++ b/common/nextpnr.cc
@@ -89,6 +89,11 @@ WireId Context::getNetinfoSinkWire(const NetInfo *net_info, const PortRef &user_
delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef &user_info) const
{
+#ifdef ARCH_ECP5
+ if (net_info->is_global)
+ return 0;
+#endif
+
WireId src_wire = getNetinfoSourceWire(net_info);
if (src_wire == WireId())
return 0;
@@ -102,12 +107,7 @@ delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef &us
if (it == net_info->wires.end())
break;
-#ifdef ARCH_ECP5
- // ECP5 global nets currently appear part-unrouted due to arch database limitations
- // Don't touch them in the router
- if (it->second.strength == STRENGTH_LOCKED)
- return 0;
-#endif
+
PipId pip = it->second.pip;
delay += getPipDelay(pip).maxDelay();
delay += getWireDelay(cursor).maxDelay();
diff --git a/common/router1.cc b/common/router1.cc
index d29cdd68..c4708de7 100644
--- a/common/router1.cc
+++ b/common/router1.cc
@@ -535,7 +535,7 @@ void addNetRouteJobs(Context *ctx, const Router1Cfg &cfg, IdString net_name,
#ifdef ARCH_ECP5
// ECP5 global nets currently appear part-unrouted due to arch database limitations
// Don't touch them in the router
- if (!net_info->wires.empty() && net_info->wires.begin()->second.strength == STRENGTH_LOCKED)
+ if (net_info->is_global)
return;
#endif
if (net_info->driver.cell == nullptr)
diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h
index c4e1413f..b5cdea3c 100644
--- a/ecp5/archdefs.h
+++ b/ecp5/archdefs.h
@@ -136,7 +136,9 @@ struct DecalId
struct ArchNetInfo
{
+ bool is_global = false;
};
+
struct ArchCellInfo
{
struct
diff --git a/ecp5/globals.cc b/ecp5/globals.cc
index 22fcbb05..91d224e5 100644
--- a/ecp5/globals.cc
+++ b/ecp5/globals.cc
@@ -280,6 +280,7 @@ class Ecp5GlobalRouter
glbnet->name = ctx->id("$glbnet$" + net->name.str(ctx));
glbnet->driver.cell = dcc.get();
glbnet->driver.port = id_CLKO;
+ glbnet->is_global = true;
dcc->ports[id_CLKO].net = glbnet.get();
glbnet->users = net->users;