aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtlil.h
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-08-07 11:11:50 -0700
committerEddie Hung <eddie@fpgeh.com>2019-08-07 11:11:50 -0700
commite6d5147214bd157c457654dc46547775ec6ad324 (patch)
tree420b4e76aec5d70e2f83b2aa56a783ea5b461a66 /kernel/rtlil.h
parent0c78c62d6c043925293c0ff934c41f2df6932b85 (diff)
parent5545cd3c108ef240ccf6278b2734412acf81cd2a (diff)
downloadyosys-e6d5147214bd157c457654dc46547775ec6ad324.tar.gz
yosys-e6d5147214bd157c457654dc46547775ec6ad324.tar.bz2
yosys-e6d5147214bd157c457654dc46547775ec6ad324.zip
Merge remote-tracking branch 'origin/master' into eddie/cleanup
Diffstat (limited to 'kernel/rtlil.h')
-rw-r--r--kernel/rtlil.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 275b0b269..99c683974 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -792,6 +792,7 @@ public:
RTLIL::SigSpec extract(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec *other = NULL) const;
RTLIL::SigSpec extract(const pool<RTLIL::SigBit> &pattern, const RTLIL::SigSpec *other = NULL) const;
RTLIL::SigSpec extract(int offset, int length = 1) const;
+ RTLIL::SigSpec extract_end(int offset) const { return extract(offset, width_ - offset); }
void append(const RTLIL::SigSpec &signal);
void append_bit(const RTLIL::SigBit &bit);
@@ -838,6 +839,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_; };