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 /mistral/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 'mistral/pack.cc')
-rw-r--r-- | mistral/pack.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mistral/pack.cc b/mistral/pack.cc index c4b3afe3..703fa386 100644 --- a/mistral/pack.cc +++ b/mistral/pack.cc @@ -200,10 +200,10 @@ struct MistralPacker NetInfo *o = ci->getPort(id_O); if (o == nullptr) ; - else if (o->users.size() > 1) + else if (o->users.entries() > 1) log_error("Top level pin '%s' has multiple input buffers\n", ctx->nameOf(port.first)); - else if (o->users.size() == 1) - top_port = o->users.at(0); + else if (o->users.entries() == 1) + top_port = *o->users.begin(); } if (ci->type == ctx->id("$nextpnr_obuf") || ci->type == ctx->id("$nextpnr_iobuf")) { // Might have an output buffer (OB etc) connected to it @@ -215,9 +215,9 @@ struct MistralPacker top_port = i->driver; } // Edge case of a bidirectional buffer driving an output pin - if (i->users.size() > 2) { + if (i->users.entries() > 2) { log_error("Top level pin '%s' has illegal buffer configuration\n", ctx->nameOf(port.first)); - } else if (i->users.size() == 2) { + } else if (i->users.entries() == 2) { if (top_port.cell != nullptr) log_error("Top level pin '%s' has illegal buffer configuration\n", ctx->nameOf(port.first)); for (auto &usr : i->users) { @@ -300,9 +300,9 @@ struct MistralPacker const NetInfo *co = cursor->getPort(id_CO); if (co == nullptr || co->users.empty()) break; - if (co->users.size() > 1) + if (co->users.entries() > 1) log_error("Carry net %s has more than one sink!\n", ctx->nameOf(co)); - auto &usr = co->users.at(0); + auto &usr = *co->users.begin(); if (usr.port != id_CI) log_error("Carry net %s drives port %s, expected CI\n", ctx->nameOf(co), ctx->nameOf(usr.port)); cursor = usr.cell; |