aboutsummaryrefslogtreecommitdiffstats
path: root/common/design_utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'common/design_utils.cc')
-rw-r--r--common/design_utils.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/design_utils.cc b/common/design_utils.cc
index 8762f068..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);