aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-10-13 11:17:23 +0100
committerGitHub <noreply@github.com>2019-10-13 11:17:23 +0100
commitee769420e3594c45a5f531a71b136125e5cb883c (patch)
tree29df0263625cf4dcc06bbd81d8b68db15705f2ba /common
parent58db38c746ad081563379d04beed1a080e080c19 (diff)
parent8f86ccc412e9e094f785d60269bd3d9c3fa8809a (diff)
downloadnextpnr-ee769420e3594c45a5f531a71b136125e5cb883c.tar.gz
nextpnr-ee769420e3594c45a5f531a71b136125e5cb883c.tar.bz2
nextpnr-ee769420e3594c45a5f531a71b136125e5cb883c.zip
Merge pull request #340 from YosysHQ/dave/ecp5_io
ecp5: IOLOGIC improvements
Diffstat (limited to 'common')
-rw-r--r--common/util.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/common/util.h b/common/util.h
index 81d7e47d..2ccfe5d2 100644
--- a/common/util.h
+++ b/common/util.h
@@ -119,7 +119,16 @@ inline const NetInfo *get_net_or_empty(const CellInfo *cell, const IdString port
return found->second.net;
else
return nullptr;
-};
+}
+
+inline NetInfo *get_net_or_empty(CellInfo *cell, const IdString port)
+{
+ auto found = cell->ports.find(port);
+ if (found != cell->ports.end())
+ return found->second.net;
+ else
+ return nullptr;
+}
NEXTPNR_NAMESPACE_END