diff options
author | gatecat <gatecat@ds0.me> | 2022-03-01 16:38:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 16:38:48 +0000 |
commit | 0a70b9c992c06a7553725b3742052eb95abd5f20 (patch) | |
tree | d1d8436576bad3424031c5ce435d76717fef196e /generic/pack.cc | |
parent | d8bea3ccfc7b6e925a9fd63c9172748ea0420e88 (diff) | |
parent | 86699b42f619960bfefd4d0b479dd44a90527ea4 (diff) | |
download | nextpnr-0a70b9c992c06a7553725b3742052eb95abd5f20.tar.gz nextpnr-0a70b9c992c06a7553725b3742052eb95abd5f20.tar.bz2 nextpnr-0a70b9c992c06a7553725b3742052eb95abd5f20.zip |
Merge pull request #925 from YosysHQ/gatecat/netlist-iv
Switch to potentially-sparse net users array
Diffstat (limited to 'generic/pack.cc')
-rw-r--r-- | generic/pack.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/pack.cc b/generic/pack.cc index cb3f5897..428d6642 100644 --- a/generic/pack.cc +++ b/generic/pack.cc @@ -124,9 +124,10 @@ static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constne log_info("%s user %s\n", orig->name.c_str(ctx), uc->name.c_str(ctx)); if ((is_lut(ctx, uc) || is_lc(ctx, uc)) && (user.port.str(ctx).at(0) == 'I') && !constval) { uc->ports[user.port].net = nullptr; + uc->ports[user.port].user_idx = {}; } else { uc->ports[user.port].net = constnet; - constnet->users.push_back(user); + uc->ports[user.port].user_idx = constnet->users.add(user); } } } @@ -224,8 +225,8 @@ static void pack_io(Context *ctx) ci->type.c_str(ctx), ci->name.c_str(ctx)); NetInfo *net = iob->ports.at(ctx->id("PAD")).net; if (((ci->type == ctx->id("$nextpnr_ibuf") || ci->type == ctx->id("$nextpnr_iobuf")) && - net->users.size() > 1) || - (ci->type == ctx->id("$nextpnr_obuf") && (net->users.size() > 2 || net->driver.cell != nullptr))) + net->users.entries() > 1) || + (ci->type == ctx->id("$nextpnr_obuf") && (net->users.entries() > 2 || net->driver.cell != nullptr))) log_error("PAD of %s '%s' connected to more than a single top level IO.\n", iob->type.c_str(ctx), iob->name.c_str(ctx)); |