diff options
author | David Shah <dave@ds0.me> | 2019-11-18 14:28:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-18 14:28:40 +0000 |
commit | d08e2ade889b709af124d4332a60c6b504a120a2 (patch) | |
tree | e30b28b2d5f6a1925d8912c80badbcc34d291bba /ice40/pack.cc | |
parent | e270fcd1dbc0e7d81a6775aca3472689ef39e7ef (diff) | |
parent | f2b9cc6d2311c437d740873111e806e9e5078736 (diff) | |
download | nextpnr-d08e2ade889b709af124d4332a60c6b504a120a2.tar.gz nextpnr-d08e2ade889b709af124d4332a60c6b504a120a2.tar.bz2 nextpnr-d08e2ade889b709af124d4332a60c6b504a120a2.zip |
Merge pull request #345 from YosysHQ/dave/sdf
Improve handling of top level IO and add SDF support
Diffstat (limited to 'ice40/pack.cc')
-rw-r--r-- | ice40/pack.cc | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc index a1eba411..90c6de31 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -459,7 +459,6 @@ static void pack_io(Context *ctx) { std::unordered_set<IdString> packed_cells; std::unordered_set<IdString> delete_nets; - std::vector<std::unique_ptr<CellInfo>> new_cells; log_info("Packing IOs..\n"); @@ -478,8 +477,7 @@ static void pack_io(Context *ctx) rgb = net->driver.cell; } if (sb != nullptr) { - // Trivial case, SB_IO used. Just destroy the net and the - // iobuf + // Trivial case, SB_IO used. Just destroy the iobuf log_info("%s feeds SB_IO %s, removing %s %s.\n", ci->name.c_str(ctx), sb->name.c_str(ctx), ci->type.c_str(ctx), ci->name.c_str(ctx)); NetInfo *net = sb->ports.at(ctx->id("PACKAGE_PIN")).net; @@ -490,7 +488,6 @@ static void pack_io(Context *ctx) sb->type.c_str(ctx), sb->name.c_str(ctx)); if (net != nullptr) { - if (net->clkconstr != nullptr) { if (sb->ports.count(id_D_IN_0)) { NetInfo *din0_net = sb->ports.at(id_D_IN_0).net; @@ -509,15 +506,6 @@ static void pack_io(Context *ctx) } } } - - delete_nets.insert(net->name); - sb->ports.at(ctx->id("PACKAGE_PIN")).net = nullptr; - } - if (ci->type == ctx->id("$nextpnr_iobuf")) { - NetInfo *net2 = ci->ports.at(ctx->id("I")).net; - if (net2 != nullptr) { - delete_nets.insert(net2->name); - } } } else if (rgb != nullptr) { log_info("%s use by SB_RGBA_DRV/SB_RGB_DRV %s, not creating SB_IO\n", ci->name.c_str(ctx), @@ -533,6 +521,8 @@ static void pack_io(Context *ctx) new_cells.push_back(std::move(ice_cell)); sb = new_cells.back().get(); } + for (auto port : ci->ports) + disconnect_port(ctx, ci, port.first); packed_cells.insert(ci->name); std::copy(ci->attrs.begin(), ci->attrs.end(), std::inserter(sb->attrs, sb->attrs.begin())); } else if (is_sb_io(ctx, ci) || is_sb_gb_io(ctx, ci)) { |