aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/pack.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-03-01 16:38:48 +0000
committerGitHub <noreply@github.com>2022-03-01 16:38:48 +0000
commit0a70b9c992c06a7553725b3742052eb95abd5f20 (patch)
treed1d8436576bad3424031c5ce435d76717fef196e /gowin/pack.cc
parentd8bea3ccfc7b6e925a9fd63c9172748ea0420e88 (diff)
parent86699b42f619960bfefd4d0b479dd44a90527ea4 (diff)
downloadnextpnr-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 'gowin/pack.cc')
-rw-r--r--gowin/pack.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/gowin/pack.cc b/gowin/pack.cc
index cc715864..c17a20c7 100644
--- a/gowin/pack.cc
+++ b/gowin/pack.cc
@@ -68,7 +68,7 @@ static void pack_alus(Context *ctx)
continue;
}
- if (!is_alu(ctx, cin_ci) || cin->users.size() > 1) {
+ if (!is_alu(ctx, cin_ci) || cin->users.entries() > 1) {
if (ctx->verbose) {
log_info("ALU head found %s. CIN net is %s\n", ctx->nameOf(ci), ctx->nameOf(cin));
}
@@ -177,9 +177,9 @@ static void pack_alus(Context *ctx)
new_cells.push_back(std::move(packed));
- if (cout != nullptr && cout->users.size() > 0) {
+ if (cout != nullptr && cout->users.entries() > 0) {
// if COUT used by logic
- if ((cout->users.size() > 1) || (!is_alu(ctx, cout->users.at(0).cell))) {
+ if ((cout->users.entries() > 1) || (!is_alu(ctx, (*cout->users.begin()).cell))) {
if (ctx->verbose) {
log_info("COUT is used by logic\n");
}
@@ -204,7 +204,7 @@ static void pack_alus(Context *ctx)
break;
}
// next ALU
- ci = cout->users.at(0).cell;
+ ci = (*cout->users.begin()).cell;
// if ALU is too big
if (alu_idx == (ctx->gridDimX - 2) * 6 - 1) {
log_error("ALU %s is the %dth in the chain. Such long chains are not supported.\n", ctx->nameOf(ci),
@@ -596,9 +596,10 @@ static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constne
log_info("%s user %s\n", ctx->nameOf(orig), ctx->nameOf(uc));
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);
}
}
}