From 6f93d87ac8b27684b80bf2385853ebfeed6af753 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 23 Jun 2025 10:57:22 +0200 Subject: [PATCH] Optimize --- himbaechel/uarch/gatemate/gatemate.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/himbaechel/uarch/gatemate/gatemate.cc b/himbaechel/uarch/gatemate/gatemate.cc index 4195735b..14174c8f 100644 --- a/himbaechel/uarch/gatemate/gatemate.cc +++ b/himbaechel/uarch/gatemate/gatemate.cc @@ -192,18 +192,16 @@ void GateMateImpl::prePlace() { assign_cell_info(); } void GateMateImpl::postPlace() { ctx->assignArchInfo(); + std::vector delete_cells; for (auto &cell : ctx->cells) { - if (getBelBucketForCellType(cell.second->type) == id_CPE_LT) { + if (cell.second->type.in(id_CPE_L2T4,id_CPE_CI)) { Loc l = ctx->getBelLocation(cell.second->bel); if (l.z == 1) { // CPE_HALF_L if (!cell.second->params.count(id_INIT_L20)) cell.second->params[id_INIT_L20] = Property(0b1100, 4); } } - } - std::vector delete_cells; - for (auto &cell : ctx->cells) { - if (cell.second->type.in(id_CPE_L2T5_L,id_CPE_LT_L)) { + else if (cell.second->type.in(id_CPE_L2T5_L,id_CPE_LT_L)) { BelId bel = cell.second->bel; PlaceStrength strength = cell.second->belStrength; uint8_t func = int_or_default(cell.second->params, id_C_FUNCTION, 0); @@ -218,6 +216,8 @@ void GateMateImpl::postPlace() cell.second->renamePort(id_IN4, id_IN8); cell.second->renamePort(id_OUT, id_OUT1); cell.second->renamePort(id_CPOUT, id_CPOUT1); + if (!cell.second->params.count(id_INIT_L20)) + cell.second->params[id_INIT_L20] = Property(0b1100, 4); rename_param(cell.second.get(), id_INIT_L00, id_INIT_L02, 4); rename_param(cell.second.get(), id_INIT_L01, id_INIT_L03, 4); rename_param(cell.second.get(), id_INIT_L10, id_INIT_L11, 4); @@ -255,7 +255,7 @@ void GateMateImpl::postPlace() } // Mark for deletion - if (cell.second->type.in(id_CPE_L2T5_U,id_CPE_LT_U)) { + else if (cell.second->type.in(id_CPE_L2T5_U,id_CPE_LT_U)) { delete_cells.push_back(cell.second->name); } }