diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2019-06-07 14:23:57 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2019-06-07 14:23:57 +0200 |
commit | 5b62f33dd57ffd8df3aa4922f94d36ff3d288fbd (patch) | |
tree | d9bc5fe0d914c5241e96d89de7d827545e2ea21b /common | |
parent | 07b21c51299d7ec38aca2a7994542e3c50f93aa3 (diff) | |
download | nextpnr-5b62f33dd57ffd8df3aa4922f94d36ff3d288fbd.tar.gz nextpnr-5b62f33dd57ffd8df3aa4922f94d36ff3d288fbd.tar.bz2 nextpnr-5b62f33dd57ffd8df3aa4922f94d36ff3d288fbd.zip |
Restore routing from json
Diffstat (limited to 'common')
-rw-r--r-- | common/nextpnr.cc | 22 |
1 files changed, 21 insertions, 1 deletions
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<std::string> strs; + boost::split(strs,val->second.str,boost::is_any_of(";")); + for(size_t i=0;i<strs.size()/2;i++) + { + std::string wire = strs[i*2]; + std::string pip = strs[i*2 + 1]; + if (pip.empty()) + getCtx()->bindWire(getCtx()->getWireByName(id(wire)), ni, STRENGTH_WEAK); + else + getCtx()->bindPip(getCtx()->getPipByName(id(pip)), ni, STRENGTH_WEAK); + } + } + } getCtx()->assignArchInfo(); } |