aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-06-02 08:51:32 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2019-06-02 08:51:32 +0200
commiteff1a1341a14c105ecf3bd8c559bf425915c3e01 (patch)
tree0964eb35ab8dab6bb0dd8160b509f38e0a4a0c28
parentbab6c9a09f9a5107267da70f5b2990975a1ce643 (diff)
downloadnextpnr-eff1a1341a14c105ecf3bd8c559bf425915c3e01.tar.gz
nextpnr-eff1a1341a14c105ecf3bd8c559bf425915c3e01.tar.bz2
nextpnr-eff1a1341a14c105ecf3bd8c559bf425915c3e01.zip
Revert "Do not add VCC if not used, loading json works"
This reverts commit f1b3a14bc23ccee6acaf6bbe27827523dc13c111.
-rw-r--r--ice40/pack.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 6c5dad39..4cb76add 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -352,7 +352,6 @@ static void pack_constants(Context *ctx)
std::vector<IdString> dead_nets;
bool gnd_used = false;
- bool vcc_used = false;
for (auto net : sorted(ctx->nets)) {
NetInfo *ni = net.second;
@@ -365,7 +364,6 @@ static void pack_constants(Context *ctx)
} 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.get(), true);
- vcc_used = true;
dead_nets.push_back(net.first);
ctx->cells.erase(drv_cell);
}
@@ -375,10 +373,11 @@ static void pack_constants(Context *ctx)
ctx->cells[gnd_cell->name] = std::move(gnd_cell);
ctx->nets[gnd_net->name] = std::move(gnd_net);
}
- if (vcc_used) {
- ctx->cells[vcc_cell->name] = std::move(vcc_cell);
- ctx->nets[vcc_net->name] = std::move(vcc_net);
- }
+ // Vcc cell always inserted for now, as it may be needed during carry legalisation (TODO: trim later if actually
+ // never used?)
+ ctx->cells[vcc_cell->name] = std::move(vcc_cell);
+ ctx->nets[vcc_net->name] = std::move(vcc_net);
+
for (auto dn : dead_nets) {
ctx->nets.erase(dn);
}