aboutsummaryrefslogtreecommitdiffstats
path: root/common/design_utils.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2019-02-24 22:12:24 +0000
committerGitHub <noreply@github.com>2019-02-24 22:12:24 +0000
commit8c7050191233265662b4e9f15d73c0e7de44c597 (patch)
tree345ebca41eecca08c163ae6a877d9c2220816a00 /common/design_utils.cc
parent92a4a48f47fc544950201935db9532a970e2d5b8 (diff)
parent64dc453f122dd849e63b30aa5fe7e7b925f40b70 (diff)
downloadnextpnr-8c7050191233265662b4e9f15d73c0e7de44c597.tar.gz
nextpnr-8c7050191233265662b4e9f15d73c0e7de44c597.tar.bz2
nextpnr-8c7050191233265662b4e9f15d73c0e7de44c597.zip
Merge pull request #236 from YosysHQ/ddrn
ecp5: Support for advanced IO functionality
Diffstat (limited to 'common/design_utils.cc')
-rw-r--r--common/design_utils.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/design_utils.cc b/common/design_utils.cc
index a0b87764..da170030 100644
--- a/common/design_utils.cc
+++ b/common/design_utils.cc
@@ -27,6 +27,8 @@ NEXTPNR_NAMESPACE_BEGIN
void replace_port(CellInfo *old_cell, IdString old_name, CellInfo *rep_cell, IdString rep_name)
{
+ if (!old_cell->ports.count(old_name))
+ return;
PortInfo &old = old_cell->ports.at(old_name);
PortInfo &rep = rep_cell->ports.at(rep_name);
NPNR_ASSERT(old.type == rep.type);
@@ -107,6 +109,8 @@ void disconnect_port(const Context *ctx, CellInfo *cell, IdString port_name)
return user.cell == cell && user.port == port_name;
}),
port.net->users.end());
+ if (port.net->driver.cell == cell && port.net->driver.port == port_name)
+ port.net->driver.cell = nullptr;
}
}