From 5d46a5eeea05920ec738ff44c80c3f81f43184c9 Mon Sep 17 00:00:00 2001 From: myrtle Date: Wed, 8 Apr 2026 14:28:53 +0200 Subject: [PATCH] ice40: Hide IO and PLL that can't be used from utilisation report (#1694) Signed-off-by: gatecat --- ice40/arch.cc | 12 ++++++++++++ ice40/arch.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/ice40/arch.cc b/ice40/arch.cc index a77dd611..86a9934c 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -361,6 +361,18 @@ bool Arch::is_bel_locked(BelId bel) const return false; } +bool Arch::getBelHidden(BelId bel) const +{ + IdString bel_type = getBelType(bel); + if (bel_type == id_SB_IO) { + return get_bel_package_pin(bel).empty(); + } else if (bel_type == id_ICESTORM_PLL) { + return is_bel_locked(bel); + } else { + return false; + } +} + // ----------------------------------------------------------------------- WireId Arch::getWireByName(IdStringList name) const diff --git a/ice40/arch.h b/ice40/arch.h index e1009ddc..2e8940ad 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -523,6 +523,8 @@ struct Arch : BaseArch PortType getBelPinType(BelId bel, IdString pin) const override; std::vector getBelPins(BelId bel) const override; + bool getBelHidden(BelId bel) const override; + bool is_bel_locked(BelId bel) const; // -------------------------------------------------