From e32f3a3792294422eedd7704b65ef50b30973368 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 20 Jun 2025 13:11:11 +0200 Subject: [PATCH] Fixes --- himbaechel/uarch/gatemate/bitstream.cc | 13 ++++++++++++- himbaechel/uarch/gatemate/gatemate.cc | 7 +++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/himbaechel/uarch/gatemate/bitstream.cc b/himbaechel/uarch/gatemate/bitstream.cc index c847f537..93432f81 100644 --- a/himbaechel/uarch/gatemate/bitstream.cc +++ b/himbaechel/uarch/gatemate/bitstream.cc @@ -86,7 +86,7 @@ struct BitstreamBackend unsigned init_val = int_or_default(params, init); bool invert = need_inversion(cell, port); if (invert) { - if (port.in(id_IN1, id_IN3)) + if (port.in(id_IN1, id_IN3, id_IN5, id_IN7)) init_val = (init_val & 0b1010) >> 1 | (init_val & 0b0101) << 1; else init_val = (init_val & 0b0011) << 2 | (init_val & 0b1100) >> 2; @@ -274,6 +274,17 @@ struct BitstreamBackend update_cpe_mux(cell.second.get(), id_IN4, id_INIT_L11, 3, params); } } + if (l.z==7) { + update_cpe_lt(cell.second.get(), id_IN1, id_INIT_L00, params); + update_cpe_lt(cell.second.get(), id_IN2, id_INIT_L00, params); + update_cpe_lt(cell.second.get(), id_IN3, id_INIT_L01, params); + update_cpe_lt(cell.second.get(), id_IN4, id_INIT_L01, params); + update_cpe_lt(cell.second.get(), id_IN5, id_INIT_L02, params); + update_cpe_lt(cell.second.get(), id_IN6, id_INIT_L02, params); + update_cpe_lt(cell.second.get(), id_IN7, id_INIT_L03, params); + update_cpe_lt(cell.second.get(), id_IN8, id_INIT_L03, params); + } + if (cell.second->type.in(id_CPE_FF)) { update_cpe_inv(cell.second.get(), id_CLK, id_C_CPE_CLK, params); update_cpe_inv(cell.second.get(), id_EN, id_C_CPE_EN, params); diff --git a/himbaechel/uarch/gatemate/gatemate.cc b/himbaechel/uarch/gatemate/gatemate.cc index 2a08d574..5781a507 100644 --- a/himbaechel/uarch/gatemate/gatemate.cc +++ b/himbaechel/uarch/gatemate/gatemate.cc @@ -221,7 +221,7 @@ void GateMateImpl::postPlace() } } } - /*std::vector delete_cells; + std::vector delete_cells; for (auto &cell : ctx->cells) { if (cell.second->type == id_CPE_L2T5_L) { BelId bel = cell.second->bel; @@ -239,8 +239,8 @@ void GateMateImpl::postPlace() loc.z = 0; CellInfo *upper = ctx->getBoundBelCell(ctx->getBelByLocation(loc)); - cell.second->params[id_INIT_L00] = upper->params[id_INIT_L00]; - cell.second->params[id_INIT_L10] = upper->params[id_INIT_L10]; + cell.second->params[id_INIT_L00] = Property(int_or_default(upper->params, id_INIT_L00, 0), 4); + cell.second->params[id_INIT_L10] = Property(int_or_default(upper->params, id_INIT_L10, 0), 4); upper->movePortTo(id_IN1, cell.second.get(), id_IN1); } // Mark for deletion @@ -255,7 +255,6 @@ void GateMateImpl::postPlace() ctx->cells.erase(pcell); } delete_cells.clear(); - */ ctx->assignArchInfo(); }