diff options
author | gatecat <gatecat@ds0.me> | 2022-02-18 12:07:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 12:07:49 +0000 |
commit | 347ba3afb3f541edc594c8bc276cce481c7a7e03 (patch) | |
tree | 28483964fb3c92bc104ab6162d1c9196651ced26 /common/basectx.cc | |
parent | 61d1db16be2c68cf6ae8b4d2ff3266b5c7086ad2 (diff) | |
parent | 6a32aca4ac8705b637943c236cedd2f36422fb21 (diff) | |
download | nextpnr-347ba3afb3f541edc594c8bc276cce481c7a7e03.tar.gz nextpnr-347ba3afb3f541edc594c8bc276cce481c7a7e03.tar.bz2 nextpnr-347ba3afb3f541edc594c8bc276cce481c7a7e03.zip |
Merge pull request #919 from YosysHQ/gatecat/netlist-iii
refactor: New member functions to replace design_utils
Diffstat (limited to 'common/basectx.cc')
-rw-r--r-- | common/basectx.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/common/basectx.cc b/common/basectx.cc index b55cd072..83a2deea 100644 --- a/common/basectx.cc +++ b/common/basectx.cc @@ -22,7 +22,6 @@ #include <boost/algorithm/string.hpp> #include "context.h" -#include "design_utils.h" #include "log.h" NEXTPNR_NAMESPACE_BEGIN @@ -223,13 +222,23 @@ void BaseCtx::connectPort(IdString net, IdString cell, IdString port) { NetInfo *net_info = getNetByAlias(net); CellInfo *cell_info = cells.at(cell).get(); - connect_port(getCtx(), net_info, cell_info, port); + cell_info->connectPort(port, net_info); } void BaseCtx::disconnectPort(IdString cell, IdString port) { CellInfo *cell_info = cells.at(cell).get(); - disconnect_port(getCtx(), cell_info, port); + cell_info->disconnectPort(port); +} + +void BaseCtx::renameNet(IdString old_name, IdString new_name) +{ + NetInfo *net = nets.at(old_name).get(); + NPNR_ASSERT(!nets.count(new_name)); + nets[new_name]; + std::swap(nets.at(net->name), nets.at(new_name)); + nets.erase(net->name); + net->name = new_name; } void BaseCtx::ripupNet(IdString name) |