From 5b62f33dd57ffd8df3aa4922f94d36ff3d288fbd Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 7 Jun 2019 14:23:57 +0200 Subject: Restore routing from json --- common/nextpnr.cc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 09d8349f..fd2efa22 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -488,11 +488,14 @@ void BaseCtx::archInfoToAttributes() for (auto &net : getCtx()->nets) { auto ni = net.second.get(); std::string routing; + bool first = true; for (auto &item : ni->wires) { + if (!first) routing += ";"; routing += getCtx()->getWireName(item.first).c_str(this); - routing += ","; + routing += ";"; if (item.second.pip != PipId()) routing += getCtx()->getPipName(item.second.pip).c_str(this); + first = false; } ni->attrs[id("ROUTING")] = routing; } @@ -544,6 +547,23 @@ void BaseCtx::attributesToArchInfo() } } } + for (auto &net : getCtx()->nets) { + auto ni = net.second.get(); + auto val = ni->attrs.find(id("ROUTING")); + if (val != ni->attrs.end()) { + std::vector strs; + boost::split(strs,val->second.str,boost::is_any_of(";")); + for(size_t i=0;ibindWire(getCtx()->getWireByName(id(wire)), ni, STRENGTH_WEAK); + else + getCtx()->bindPip(getCtx()->getPipByName(id(pip)), ni, STRENGTH_WEAK); + } + } + } getCtx()->assignArchInfo(); } -- cgit v1.2.3