From 316dd7621ab3ad74f4d390e9da8fb33fe308e2e2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 20 Jun 2025 12:44:38 +0200 Subject: [PATCH] Fixes --- himbaechel/uarch/gatemate/bitstream.cc | 10 +++++++--- himbaechel/uarch/gatemate/gatemate.cc | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/himbaechel/uarch/gatemate/bitstream.cc b/himbaechel/uarch/gatemate/bitstream.cc index 6a00ac1f..d98554b6 100644 --- a/himbaechel/uarch/gatemate/bitstream.cc +++ b/himbaechel/uarch/gatemate/bitstream.cc @@ -243,22 +243,26 @@ struct BitstreamBackend break; case id_CPE_L2T4.index: case id_CPE_L2T5.index: + case id_CPE_L2T5_U.index: + case id_CPE_L2T5_L.index: case id_CPE_FF.index: case id_CPE_RAMI.index: case id_CPE_RAMO.index: case id_CPE_RAMIO.index: + case id_CPE_LT.index: case id_CPE_LT_U.index: case id_CPE_LT_L.index: { // Update configuration bits based on signal inversion dict params = cell.second->params; uint8_t func = int_or_default(cell.second->params, id_C_FUNCTION, 0); - if (cell.second->type.in(id_CPE_LT_U) && func != C_MX4) { + Loc l = ctx->getBelLocation(cell.second->bel); + if (l.z==0 && func != C_MX4) { 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); } - if (cell.second->type.in(id_CPE_LT_L)) { + if (l.z==1) { update_cpe_lt(cell.second.get(), id_IN1, id_INIT_L02, params); update_cpe_lt(cell.second.get(), id_IN2, id_INIT_L02, params); update_cpe_lt(cell.second.get(), id_IN3, id_INIT_L03, params); @@ -270,7 +274,7 @@ struct BitstreamBackend update_cpe_mux(cell.second.get(), id_IN4, id_INIT_L11, 3, params); } } - if (cell.second->type.in(id_CPE_FF_U, id_CPE_FF_L)) { + 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); bool set = int_or_default(params, id_C_EN_SR, 0) == 1; diff --git a/himbaechel/uarch/gatemate/gatemate.cc b/himbaechel/uarch/gatemate/gatemate.cc index 911dc480..2a08d574 100644 --- a/himbaechel/uarch/gatemate/gatemate.cc +++ b/himbaechel/uarch/gatemate/gatemate.cc @@ -93,7 +93,7 @@ bool GateMateImpl::isBelLocationValid(BelId bel, bool explain_invalid) const if (ctx->getBelType(bel).in(id_CPE_FF, id_CPE_FF_L, id_CPE_FF_U)) { Loc loc = ctx->getBelLocation(bel); - const CellInfo *adj_half = ctx->getBoundBelCell(ctx->getBelByLocation(Loc(loc.x, loc.y, loc.z == 2 ? 3 : 2))); + const CellInfo *adj_half = ctx->getBoundBelCell(ctx->getBelByLocation(Loc(loc.x, loc.y, loc.z == 3 ? 2 : 3))); if (adj_half) { const auto &half_data = fast_cell_info.at(cell->flat_index); if (half_data.dff_used) { @@ -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; @@ -255,6 +255,7 @@ void GateMateImpl::postPlace() ctx->cells.erase(pcell); } delete_cells.clear(); + */ ctx->assignArchInfo(); }