From f80da7b41dd9c12d3bd65ceab6c0c6748a70a78c Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 22 Jul 2014 22:54:03 +0200 Subject: [PATCH] SigSpec refactoring: added RTLIL::SigSpec::operator[] --- kernel/rtlil.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/rtlil.h b/kernel/rtlil.h index facd43db4..da3a2661e 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -522,6 +522,9 @@ public: int size() const { return width_; } + RTLIL::SigBit &operator[](int index) { unpack(); return bits_.at(index); } + const RTLIL::SigBit &operator[](int index) const { unpack(); return bits_.at(index); } + void expand(); void optimize(); RTLIL::SigSpec optimized() const; @@ -540,7 +543,7 @@ public: void remove_const(); RTLIL::SigSpec extract(RTLIL::SigSpec pattern, RTLIL::SigSpec *other = NULL) const; - RTLIL::SigSpec extract(int offset, int length) const; + RTLIL::SigSpec extract(int offset, int length = 1) const; void append(const RTLIL::SigSpec &signal); void append_bit(const RTLIL::SigBit &bit); -- 2.30.2