aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/pack.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-10-18 15:58:57 +0100
committerDavid Shah <dave@ds0.me>2019-10-18 15:58:57 +0100
commitcf5cbd1153c3ebaf6bcff98f2d936e1663407dff (patch)
treeed5d58e7f7be8b6340ca0f357816fa3bdc5cd80b /ecp5/pack.cc
parent872e296f7b6b679be89ad3757a9ff9936dc71ba9 (diff)
downloadnextpnr-cf5cbd1153c3ebaf6bcff98f2d936e1663407dff.tar.gz
nextpnr-cf5cbd1153c3ebaf6bcff98f2d936e1663407dff.tar.bz2
nextpnr-cf5cbd1153c3ebaf6bcff98f2d936e1663407dff.zip
ecp5: Preserve top level IO properly
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/pack.cc')
-rw-r--r--ecp5/pack.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc
index 244a79d5..00ed891a 100644
--- a/ecp5/pack.cc
+++ b/ecp5/pack.cc
@@ -362,8 +362,7 @@ class Ecp5Packer
for (auto &port : ci->ports)
disconnect_port(ctx, ci, port.first);
} else if (trio != nullptr) {
- // Trivial case, TRELLIS_IO used. Just destroy the net and the
- // iobuf
+ // Trivial case, TRELLIS_IO used. Just remove the IOBUF
log_info("%s feeds TRELLIS_IO %s, removing %s %s.\n", ci->name.c_str(ctx), trio->name.c_str(ctx),
ci->type.c_str(ctx), ci->name.c_str(ctx));
@@ -384,14 +383,6 @@ class Ecp5Packer
std::swap(net->clkconstr, onet->clkconstr);
}
}
- ctx->nets.erase(net->name);
- trio->ports.at(ctx->id("B")).net = nullptr;
- }
- if (ci->type == ctx->id("$nextpnr_iobuf")) {
- NetInfo *net2 = ci->ports.at(ctx->id("I")).net;
- if (net2 != nullptr) {
- ctx->nets.erase(net2->name);
- }
}
} else if (drives_top_port(ionet, tp)) {
log_info("%s feeds %s %s.%s, removing %s %s.\n", ci->name.c_str(ctx), tp.cell->type.c_str(ctx),
@@ -414,7 +405,8 @@ class Ecp5Packer
new_cells.push_back(std::move(tr_cell));
trio = new_cells.back().get();
}
-
+ for (auto port : ci->ports)
+ disconnect_port(ctx, ci, port.first);
packed_cells.insert(ci->name);
if (trio != nullptr) {
for (const auto &attr : ci->attrs)