From: Eddie Hung Date: Fri, 19 Jul 2019 20:54:57 +0000 (-0700) Subject: Add an SigSpec::at(offset, defval) convenience method X-Git-Tag: working-ls180~1163^2~10 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54708dfbd786032e841f48f15af4875c1eabbbfe;p=yosys.git Add an SigSpec::at(offset, defval) convenience method --- diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 82cbfaf28..f9412e776 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -818,6 +818,7 @@ public: operator std::vector() const { return chunks(); } operator std::vector() 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_; };