aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-06-22 16:57:00 +0100
committerDavid Shah <dave@ds0.me>2019-08-07 14:22:47 +0100
commit661237eb64a694a11900f736b07132ef8da4b0dd (patch)
tree68f7e853f8182adf931100da3c69d1ab9379a568 /common/nextpnr.cc
parent90364fc3fad72f8c23b7200160f1acc0343c94d9 (diff)
downloadnextpnr-661237eb64a694a11900f736b07132ef8da4b0dd.tar.gz
nextpnr-661237eb64a694a11900f736b07132ef8da4b0dd.tar.bz2
nextpnr-661237eb64a694a11900f736b07132ef8da4b0dd.zip
ecp5: Add --out-of-context for building hard macros
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common/nextpnr.cc')
-rw-r--r--common/nextpnr.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc
index 0d89b55a..ab4601a6 100644
--- a/common/nextpnr.cc
+++ b/common/nextpnr.cc
@@ -294,6 +294,9 @@ delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef &us
break;
PipId pip = it->second.pip;
+ if (pip == PipId())
+ break;
+
delay += getPipDelay(pip).maxDelay();
delay += getWireDelay(cursor).maxDelay();
cursor = getPipSrcWire(pip);
@@ -571,6 +574,16 @@ void BaseCtx::attributesToArchInfo()
BelId b = getCtx()->getBelByName(id(val->second.as_string()));
getCtx()->bindBel(b, ci, strength);
}
+
+ val = ci->attrs.find(id("CONSTR_PARENT"));
+ if (val != ci->attrs.end()) {
+ auto parent = cells.find(id(val->second.str));
+ if (parent != cells.end())
+ ci->constr_parent = parent->second.get();
+ else
+ continue;
+ }
+
val = ci->attrs.find(id("CONSTR_X"));
if (val != ci->attrs.end())
ci->constr_x = val->second.as_int64();
@@ -599,7 +612,8 @@ void BaseCtx::attributesToArchInfo()
auto children = val->second.as_string();
boost::split(strs, children, boost::is_any_of(";"));
for (auto val : strs) {
- ci->constr_children.push_back(cells.find(id(val.c_str()))->second.get());
+ if (cells.count(id(val.c_str())))
+ ci->constr_children.push_back(cells.find(id(val.c_str()))->second.get());
}
}
}