From 6dc5d8c98adaba0f6d47ded4b216143be9f21837 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 30 Jun 2025 14:29:03 +0200 Subject: [PATCH] Make sure we at least generate bitstream with all info --- himbaechel/uarch/gatemate/bitstream.cc | 2 +- himbaechel/uarch/gatemate/gatemate.cc | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/himbaechel/uarch/gatemate/bitstream.cc b/himbaechel/uarch/gatemate/bitstream.cc index 3c3539b0..fa255989 100644 --- a/himbaechel/uarch/gatemate/bitstream.cc +++ b/himbaechel/uarch/gatemate/bitstream.cc @@ -284,7 +284,7 @@ struct BitstreamBackend // Update configuration bits based on signal inversion dict params = cell.second->params; Loc l = ctx->getBelLocation(cell.second->bel); - if (cell.second->type.in(id_CPE_L2T4, id_CPE_CI)) { + if (cell.second->type.in(id_CPE_L2T4, id_CPE_CI, id_CPE_LT_L, id_CPE_LT_U)) { if (l.z == CPE_LT_U_Z) { update_cpe_lt(cell.second.get(), id_IN1, id_INIT_L00, params); update_cpe_lt(cell.second.get(), id_IN2, id_INIT_L00, params); diff --git a/himbaechel/uarch/gatemate/gatemate.cc b/himbaechel/uarch/gatemate/gatemate.cc index f6b0c58c..f538db2d 100644 --- a/himbaechel/uarch/gatemate/gatemate.cc +++ b/himbaechel/uarch/gatemate/gatemate.cc @@ -195,7 +195,19 @@ void GateMateImpl::postPlace() ctx->assignArchInfo(); std::vector delete_cells; for (auto &cell : ctx->cells) { - if (cell.second->type.in(id_CPE_L2T4, id_CPE_CI)) { + /// TODO: Remove this section when pack_mult is cleaned + if (cell.second->type.in(id_CPE_LT_L,id_CPE_LT_U) && int_or_default(cell.second->params, id_C_FUNCTION, 0)==0) { + Loc l = ctx->getBelLocation(cell.second->bel); + if (l.z == CPE_LT_L_Z) { + if (!cell.second->params.count(id_INIT_L20)) + cell.second->params[id_INIT_L20] = Property(0b1100, 4); + // Rename params since currently in pack_mult they have final names + // and we do rename again later for bitstream + rename_param(cell.second.get(), id_INIT_L02, id_INIT_L00, 4); + rename_param(cell.second.get(), id_INIT_L03, id_INIT_L01, 4); + rename_param(cell.second.get(), id_INIT_L11, id_INIT_L10, 4); + } + } else if (cell.second->type.in(id_CPE_L2T4, id_CPE_CI)) { Loc l = ctx->getBelLocation(cell.second->bel); if (l.z == CPE_LT_L_Z) { if (!cell.second->params.count(id_INIT_L20))