diff options
author | David Shah <davey1576@gmail.com> | 2018-06-25 15:39:46 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-25 15:39:46 +0200 |
commit | 6d154cfa1300cf88c1556657b37f7fbcc8da8d6a (patch) | |
tree | 65715433416752fa6081689c6a319c63d8eed639 /ice40/pack.cc | |
parent | 8d9444b6f0df174fcbf0b9a619ce7793ae5adc02 (diff) | |
download | nextpnr-6d154cfa1300cf88c1556657b37f7fbcc8da8d6a.tar.gz nextpnr-6d154cfa1300cf88c1556657b37f7fbcc8da8d6a.tar.bz2 nextpnr-6d154cfa1300cf88c1556657b37f7fbcc8da8d6a.zip |
ice40: Creating a carry chain splitter function
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/pack.cc')
-rw-r--r-- | ice40/pack.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc index 85c1af8c..54e6dad2 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -258,7 +258,7 @@ static void pack_constants(Context *ctx) std::vector<IdString> dead_nets; - bool gnd_used = false, vcc_used = false; + bool gnd_used = false; for (auto net : sorted(ctx->nets)) { NetInfo *ni = net.second; @@ -268,7 +268,6 @@ static void pack_constants(Context *ctx) 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); - vcc_used = true; dead_nets.push_back(net.first); } } @@ -277,11 +276,10 @@ static void pack_constants(Context *ctx) 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; - } + // 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] = vcc_cell; + ctx->nets[vcc_net->name] = vcc_net; for (auto dn : dead_nets) ctx->nets.erase(dn); |