aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pack.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-25 16:29:37 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-25 16:29:37 +0200
commit64208da1f986f104682c9c050c43f2273900810a (patch)
tree911077e3605b466261bdf7a991c9cceb405e7fd2 /ice40/pack.cc
parenta279720fc185cf32599b4d45c74e8752ca6b514f (diff)
downloadnextpnr-64208da1f986f104682c9c050c43f2273900810a.tar.gz
nextpnr-64208da1f986f104682c9c050c43f2273900810a.tar.bz2
nextpnr-64208da1f986f104682c9c050c43f2273900810a.zip
ice40: Remove constant driver cells in packer
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/pack.cc')
-rw-r--r--ice40/pack.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc
index dd9fba27..d0419098 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -263,12 +263,16 @@ static void pack_constants(Context *ctx)
for (auto net : sorted(ctx->nets)) {
NetInfo *ni = net.second;
if (ni->driver.cell != nullptr && ni->driver.cell->type == ctx->id("GND")) {
+ IdString drv_cell = ni->driver.cell->name;
set_net_constant(ctx, ni, gnd_net, false);
gnd_used = true;
dead_nets.push_back(net.first);
+ ctx->cells.erase(drv_cell);
} else if (ni->driver.cell != nullptr && ni->driver.cell->type == ctx->id("VCC")) {
+ IdString drv_cell = ni->driver.cell->name;
set_net_constant(ctx, ni, vcc_net, true);
dead_nets.push_back(net.first);
+ ctx->cells.erase(drv_cell);
}
}
@@ -284,8 +288,9 @@ static void pack_constants(Context *ctx)
ctx->cells[vcc_cell->name] = vcc_cell;
ctx->nets[vcc_net->name] = vcc_net;
- for (auto dn : dead_nets)
+ for (auto dn : dead_nets) {
ctx->nets.erase(dn);
+ }
}
static bool is_nextpnr_iob(Context *ctx, CellInfo *cell)