From 261a0ae9e13a0b05c430d0666f4933f14d7f573d Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 17 Nov 2025 09:14:51 +0000 Subject: [PATCH] Implement at() methods on SigSpec so that SigSpec::bits().at() continues to work as it did Fixes a regression caused by commit 745222fa3bf2ac570935ffd044c86fa2eb12d123, which caused some third-party code to fail to build, e.g.: https://github.com/google/heir/blob/5d7aa035c6e42394cd4dd45faca0b0933af89950/lib/Transforms/YosysOptimizer/RTLILImporter.cpp#L229 --- kernel/rtlil.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 584c4e11b..a8e43fe1d 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -1726,6 +1726,8 @@ public: operator std::vector() const; operator std::vector() const { return to_sigbit_vector(); } const RTLIL::SigBit &at(int offset, const RTLIL::SigBit &defval) { return offset < size() ? (*this)[offset] : defval; } + RTLIL::SigBit& at(int offset) { return (*this)[offset]; } + RTLIL::SigBit at(int offset) const { return (*this)[offset]; } [[nodiscard]] Hasher hash_into(Hasher h) const { Hasher::hash_t val;