projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a87dc3
)
Add an SigSpec::at(offset, defval) convenience method
author
Eddie Hung
<eddie@fpgeh.com>
Fri, 19 Jul 2019 20:54:57 +0000
(13:54 -0700)
committer
Eddie Hung
<eddie@fpgeh.com>
Fri, 19 Jul 2019 20:54:57 +0000
(13:54 -0700)
kernel/rtlil.h
patch
|
blob
|
history
diff --git
a/kernel/rtlil.h
b/kernel/rtlil.h
index 82cbfaf28ab6408a0a957add83cd8e1f07722e55..f9412e776e4250d7198bafa7123ff924e98f3715 100644
(file)
--- 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_; };