From 7baf458ffef171b117e70f714c33a2c170374f7f Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Tue, 16 Jun 2026 23:16:36 +0200 Subject: [PATCH] ff: twines --- kernel/ff.cc | 10 +++++----- kernel/ff.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/ff.cc b/kernel/ff.cc index f7a0fbc80..d8abee38a 100644 --- a/kernel/ff.cc +++ b/kernel/ff.cc @@ -26,14 +26,14 @@ USING_YOSYS_NAMESPACE template>> void manufacture_info(InputType flop, OutputType& info, FfInitVals *initvals) { Cell* cell = nullptr; - IdString type; + TwineRef type; constexpr bool have_cell = std::is_same_v; - if constexpr (std::is_same_v) { + if constexpr (std::is_same_v) { type = flop; } else { static_assert(std::is_same_v); cell = flop; - type = flop->type; + type = flop->type.ref(); } if constexpr (have_cell) { info.sig_q = cell->getPort(TW::Q); @@ -52,7 +52,7 @@ void manufacture_info(InputType flop, OutputType& info, FfInitVals *initvals) { } - std::string type_str = type.str(); + std::string type_str = TW::str(type); if (type.in(TW($anyinit), TW($ff), TW($dff), TW($dffe), TW($dffsr), TW($dffsre), TW($adff), TW($adffe), TW($aldff), TW($aldffe), TW($sdff), TW($sdffe), TW($sdffce), TW($dlatch), TW($adlatch), TW($dlatchsr), TW($sr))) { if (type.in(TW($anyinit), TW($ff))) { @@ -331,7 +331,7 @@ void manufacture_info(InputType flop, OutputType& info, FfInitVals *initvals) { } } -FfTypeData::FfTypeData(IdString type) : FfTypeData() +FfTypeData::FfTypeData(TwineRef type) : FfTypeData() { manufacture_info(type, *this, nullptr); } diff --git a/kernel/ff.h b/kernel/ff.h index 04534f244..e3b5c1fc8 100644 --- a/kernel/ff.h +++ b/kernel/ff.h @@ -80,7 +80,7 @@ YOSYS_NAMESPACE_BEGIN // - empty set [not a cell — will be emitted as a simple direct connection] struct FfTypeData { - FfTypeData(IdString type); + FfTypeData(TwineRef type); FfTypeData() { has_clk = false; has_gclk = false;