From 715f13db5137be8f79dcbe87ce8777bcfa9252a9 Mon Sep 17 00:00:00 2001 From: Lofty Date: Tue, 15 Jul 2025 06:14:09 +0100 Subject: [PATCH] review fixes --- himbaechel/uarch/gatemate/pack.cc | 11 ++++------- himbaechel/uarch/gatemate/pack.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/himbaechel/uarch/gatemate/pack.cc b/himbaechel/uarch/gatemate/pack.cc index ca89804d..393f56c7 100644 --- a/himbaechel/uarch/gatemate/pack.cc +++ b/himbaechel/uarch/gatemate/pack.cc @@ -26,13 +26,13 @@ NEXTPNR_NAMESPACE_BEGIN -void GateMatePacker::flush_cells(bool unbind) +void GateMatePacker::flush_cells() { for (auto pcell : packed_cells) { for (auto &port : ctx->cells[pcell]->ports) { ctx->cells[pcell]->disconnectPort(port.first); } - if (unbind) + if (ctx->cells[pcell]->bel != BelId()) ctx->unbindBel(ctx->cells[pcell]->bel); ctx->cells.erase(pcell); } @@ -127,10 +127,7 @@ void GateMatePacker::move_connections(NetInfo *from_net, NetInfo *to_net) void GateMatePacker::count_cell(CellInfo &ci) { packed_cells.insert(ci.name); - if (!count_per_type.count(ci.type)) - count_per_type[ci.type] = 1; - else - count_per_type[ci.type]++; + count_per_type[ci.type]++; count++; } @@ -378,7 +375,7 @@ void GateMatePacker::repack() packed_cells.insert(cell.second->name); } } - flush_cells(true); + flush_cells(); } void GateMateImpl::pack() diff --git a/himbaechel/uarch/gatemate/pack.h b/himbaechel/uarch/gatemate/pack.h index 22220666..b589563e 100644 --- a/himbaechel/uarch/gatemate/pack.h +++ b/himbaechel/uarch/gatemate/pack.h @@ -101,7 +101,7 @@ struct GateMatePacker // Cell creating CellInfo *create_cell_ptr(IdString type, IdString name); - void flush_cells(bool unbind = false); + void flush_cells(); void pack_ram_cell(CellInfo &ci, CellInfo *cell, int num, bool is_split); void copy_constraint(NetInfo *in_net, NetInfo *out_net);