Add an SigSpec::at(offset, defval) convenience method

This commit is contained in:
Eddie Hung 2019-07-19 13:54:57 -07:00
parent 3a87dc3524
commit 54708dfbd7
1 changed files with 1 additions and 0 deletions

View File

@ -818,6 +818,7 @@ public:
operator std::vector<RTLIL::SigChunk>() const { return chunks(); }
operator std::vector<RTLIL::SigBit>() const { return bits(); }
RTLIL::SigBit at(int offset, const RTLIL::SigBit &defval) { return offset < width_ ? (*this)[offset] : defval; }
unsigned int hash() const { if (!hash_) updhash(); return hash_; };