diff options
author | David Shah <davey1576@gmail.com> | 2018-06-19 13:35:01 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-19 13:35:01 +0200 |
commit | 7abfd3677318152e1ff70d68a6664422b7efe5e6 (patch) | |
tree | ef50675fd3175ae026bc13dfcc9537bf6c5ddb71 /ice40 | |
parent | d2ff5fec0812b149c5938fcc388b8efa033f40e6 (diff) | |
download | nextpnr-7abfd3677318152e1ff70d68a6664422b7efe5e6.tar.gz nextpnr-7abfd3677318152e1ff70d68a6664422b7efe5e6.tar.bz2 nextpnr-7abfd3677318152e1ff70d68a6664422b7efe5e6.zip |
ice40: Don't deduplicate local tracks when counting
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/arch_place.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index 6223c801..c8806852 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -39,8 +39,7 @@ static bool logicCellsCompatible(const Context *ctx, { bool dffs_exist = false, dffs_neg = false; const NetInfo *cen = nullptr, *clk = nullptr, *sr = nullptr; - static std::unordered_set<IdString> locals; - locals.clear(); + int locals_count = 0; for (auto cell : cells) { if (bool_or_default(cell->params, "DFF_ENABLE")) { @@ -51,11 +50,11 @@ static bool logicCellsCompatible(const Context *ctx, sr = get_net_or_empty(cell, "SR"); if (!is_global_net(ctx, cen) && cen != nullptr) - locals.insert(cen->name); + locals_count++; if (!is_global_net(ctx, clk) && clk != nullptr) - locals.insert(clk->name); + locals_count++; if (!is_global_net(ctx, sr) && sr != nullptr) - locals.insert(sr->name); + locals_count++; if (bool_or_default(cell->params, "NEG_CLK")) { dffs_neg = true; @@ -77,16 +76,16 @@ static bool logicCellsCompatible(const Context *ctx, *i2 = get_net_or_empty(cell, "I2"), *i3 = get_net_or_empty(cell, "I3"); if (i0 != nullptr) - locals.insert(i0->name); + locals_count++; if (i1 != nullptr) - locals.insert(i1->name); + locals_count++; if (i2 != nullptr) - locals.insert(i2->name); + locals_count++; if (i3 != nullptr) - locals.insert(i3->name); + locals_count++; } - return locals.size() <= 32; + return locals_count <= 32; } bool isBelLocationValid(Context *ctx, BelId bel) |