From 04822c66600eef91f5b495233350abd15454348b Mon Sep 17 00:00:00 2001 From: nella Date: Mon, 2 Mar 2026 12:11:25 +0100 Subject: [PATCH] Readd builtin_ff_cell_types for plugin parity. --- kernel/rtlil.cc | 13 +++++++++++++ kernel/rtlil.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 339450c6a..66bf3b9f7 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -288,6 +288,19 @@ void RTLIL::OwningIdString::collect_garbage() dict RTLIL::constpad; +const pool &RTLIL::builtin_ff_cell_types() { + static const pool res = []() { + pool r; + for (size_t i = 0; i < StaticCellTypes::builder.count; i++) { + auto &cell = StaticCellTypes::builder.cells[i]; + if (cell.features.is_ff) + r.insert(cell.type); + } + return r; + }(); + return res; +} + #define check(condition) log_assert(condition && "malformed Const union") const Const::bitvectype& Const::get_bits() const { diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 18bac5e6a..6f26d0d39 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -737,6 +737,9 @@ template <> struct IDMacroHelper<-1> { namespace RTLIL { extern dict constpad; + [[deprecated("use StaticCellTypes::categories.is_ff() instead")]] + const pool &builtin_ff_cell_types(); + static inline std::string escape_id(const std::string &str) { if (str.size() > 0 && str[0] != '\\' && str[0] != '$') return "\\" + str;