aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pack.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-19 14:34:45 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-19 14:34:45 +0200
commit2603c6d805ad310c6d440ab49fec5eea78cc3b15 (patch)
tree3761473c060be582a0db46bb0d938b9bae1a170a /ice40/pack.cc
parentfd40d6f58d10b0435be1f443293e4c9405cfcf05 (diff)
parent786bd6b25a2d7db691e70fd2bc9a60c796e0df35 (diff)
downloadnextpnr-2603c6d805ad310c6d440ab49fec5eea78cc3b15.tar.gz
nextpnr-2603c6d805ad310c6d440ab49fec5eea78cc3b15.tar.bz2
nextpnr-2603c6d805ad310c6d440ab49fec5eea78cc3b15.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'ice40/pack.cc')
-rw-r--r--ice40/pack.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 92f9a369..d3f07118 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -203,23 +203,33 @@ static void pack_constants(Context *ctx)
std::vector<IdString> dead_nets;
+ bool gnd_used = false, vcc_used = false;
+
for (auto net : ctx->nets) {
NetInfo *ni = net.second;
if (ni->driver.cell != nullptr &&
ni->driver.cell->type == ctx->id("GND")) {
set_net_constant(ctx, ni, gnd_net, false);
- ctx->cells[gnd_cell->name] = gnd_cell;
- ctx->nets[gnd_net->name] = gnd_net;
+ gnd_used = true;
dead_nets.push_back(net.first);
} else if (ni->driver.cell != nullptr &&
ni->driver.cell->type == ctx->id("VCC")) {
set_net_constant(ctx, ni, vcc_net, true);
- ctx->cells[vcc_cell->name] = vcc_cell;
- ctx->nets[vcc_net->name] = vcc_net;
+ vcc_used = true;
dead_nets.push_back(net.first);
}
}
+ if (gnd_used) {
+ ctx->cells[gnd_cell->name] = gnd_cell;
+ ctx->nets[gnd_net->name] = gnd_net;
+ }
+
+ if (vcc_used) {
+ ctx->cells[vcc_cell->name] = vcc_cell;
+ ctx->nets[vcc_net->name] = vcc_net;
+ }
+
for (auto dn : dead_nets)
ctx->nets.erase(dn);
}
@@ -265,7 +275,8 @@ static void pack_io(Context *ctx)
}
} else {
// Create a SB_IO buffer
- sb = create_ice_cell(ctx, "SB_IO");
+ sb = create_ice_cell(ctx, "SB_IO",
+ ci->name.str(ctx) + "$sb_io");
nxio_to_sb(ctx, ci, sb);
new_cells.push_back(sb);
}