From bbcfe052bb72a0f17f5604ae4cb98e4466cc9235 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 3 Nov 2025 11:12:26 +0100 Subject: [PATCH] block some pips --- himbaechel/uarch/gatemate/gatemate.cc | 9 +++++++-- himbaechel/uarch/gatemate/gatemate.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/himbaechel/uarch/gatemate/gatemate.cc b/himbaechel/uarch/gatemate/gatemate.cc index f818550a..3e7e72ba 100644 --- a/himbaechel/uarch/gatemate/gatemate.cc +++ b/himbaechel/uarch/gatemate/gatemate.cc @@ -308,6 +308,7 @@ void GateMateImpl::postPlace() repack(); ctx->assignArchInfo(); used_cpes.resize(ctx->getGridDimX() * ctx->getGridDimY()); + block_perm.resize(ctx->getGridDimX() * ctx->getGridDimY()); for (auto &cell : ctx->cells) { // We need to skip CPE_MULT since using CP outputs is mandatory // even if output is actually not connected @@ -317,14 +318,18 @@ void GateMateImpl::postPlace() marked_used = true; if (marked_used) used_cpes[cell.second.get()->bel.tile] = true; + if (cell.second.get()->type.in(id_CPE_MX4, id_CPE_MULT)) + block_perm[cell.second.get()->bel.tile] = true; } } bool GateMateImpl::checkPipAvail(PipId pip) const { const auto &extra_data = *pip_extra_data(pip); - if (extra_data.type != PipExtra::PIP_EXTRA_MUX || (extra_data.flags & MUX_ROUTING) == 0) + if (extra_data.type != PipExtra::PIP_EXTRA_MUX || (extra_data.flags & (MUX_ROUTING | MUX_PERMUTATION)) == 0) return true; - if (used_cpes[pip.tile]) + if ((extra_data.flags & MUX_ROUTING) && used_cpes[pip.tile]) + return false; + if ((extra_data.flags & MUX_PERMUTATION) && (extra_data.value!=0) && block_perm[pip.tile]) return false; return true; } diff --git a/himbaechel/uarch/gatemate/gatemate.h b/himbaechel/uarch/gatemate/gatemate.h index 7298325a..0813d17d 100644 --- a/himbaechel/uarch/gatemate/gatemate.h +++ b/himbaechel/uarch/gatemate/gatemate.h @@ -97,6 +97,7 @@ struct GateMateImpl : HimbaechelAPI pool multiplier_zero_drivers; std::vector multipliers; std::vector used_cpes; + std::vector block_perm; int fpga_mode; int timing_mode; std::map global_signals;