3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-22 05:36:43 +00:00

Merge pull request #5488 from rocallahan/sigspec-at

Implement at() methods on SigSpec so that SigSpec::bits().at() continues to work as it did
This commit is contained in:
Miodrag Milanović 2025-11-17 12:11:14 +01:00 committed by GitHub
commit 725a1c3a4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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;