diff options
author | Jim Lawson <ucbjrl@berkeley.edu> | 2019-07-24 10:20:46 -0700 |
---|---|---|
committer | Jim Lawson <ucbjrl@berkeley.edu> | 2019-07-24 10:20:46 -0700 |
commit | c66b7402c06455535bb43ee65fe20515b5b9c0ee (patch) | |
tree | ad135d83bf75e72b65e3136b4f6746c1f9cafab3 /kernel/rtlil.h | |
parent | 349c47250a9779bc58634870d2e3facfe95fbff8 (diff) | |
parent | a66f17b6a78af8f6989235f0c72d5548b0560a58 (diff) | |
download | yosys-c66b7402c06455535bb43ee65fe20515b5b9c0ee.tar.gz yosys-c66b7402c06455535bb43ee65fe20515b5b9c0ee.tar.bz2 yosys-c66b7402c06455535bb43ee65fe20515b5b9c0ee.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'kernel/rtlil.h')
-rw-r--r-- | kernel/rtlil.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 8509670ff..82cbfaf28 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -276,6 +276,18 @@ namespace RTLIL return std::string(c_str() + pos, len); } + bool begins_with(const char* prefix) const { + size_t len = strlen(prefix); + if (size() < len) return false; + return substr(0, len) == prefix; + } + + bool ends_with(const char* suffix) const { + size_t len = strlen(suffix); + if (size() < len) return false; + return substr(size()-len) == suffix; + } + size_t size() const { return str().size(); } @@ -1315,7 +1327,7 @@ public: #endif }; -struct RTLIL::CaseRule +struct RTLIL::CaseRule : public RTLIL::AttrObject { std::vector<RTLIL::SigSpec> compare; std::vector<RTLIL::SigSig> actions; |