3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-23 06:01:27 +00:00

Implement at() methods on SigSpec so that SigSpec::bits().at() continues to work as it did

Fixes a regression caused by commit 745222fa3b, which caused some
third-party code to fail to build, e.g.:
5d7aa035c6/lib/Transforms/YosysOptimizer/RTLILImporter.cpp (L229)
This commit is contained in:
Robert O'Callahan 2025-11-17 09:14:51 +00:00
parent 677bf21947
commit 261a0ae9e1

View file

@ -1726,6 +1726,8 @@ public:
operator std::vector<RTLIL::SigChunk>() const;
operator std::vector<RTLIL::SigBit>() 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;