diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-07-19 13:54:57 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-07-19 13:54:57 -0700 |
commit | 54708dfbd786032e841f48f15af4875c1eabbbfe (patch) | |
tree | 023c2962663643d64dd72d9019b0e1024ad0df12 | |
parent | 3a87dc35242598b6951fb70d4302ede60c2a96b2 (diff) | |
download | yosys-54708dfbd786032e841f48f15af4875c1eabbbfe.tar.gz yosys-54708dfbd786032e841f48f15af4875c1eabbbfe.tar.bz2 yosys-54708dfbd786032e841f48f15af4875c1eabbbfe.zip |
Add an SigSpec::at(offset, defval) convenience method
-rw-r--r-- | kernel/rtlil.h | 1 |
1 files changed, 1 insertions, 0 deletions
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<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_; }; |