diff options
author | whitequark <whitequark@whitequark.org> | 2020-04-17 09:06:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 09:06:40 +0000 |
commit | 4d1db12133885d35f7ce6fe76db82e5878cee104 (patch) | |
tree | b9c1ff8281159c6fe45365bb2278ba0ed6c703d7 /kernel/rtlil.h | |
parent | c69db910acef73bbd5a1bfb015231fce5419e0af (diff) | |
parent | b6f624b56bc3adee55743c4bd383414ea5b07c72 (diff) | |
download | yosys-4d1db12133885d35f7ce6fe76db82e5878cee104.tar.gz yosys-4d1db12133885d35f7ce6fe76db82e5878cee104.tar.bz2 yosys-4d1db12133885d35f7ce6fe76db82e5878cee104.zip |
Merge pull request #1951 from whitequark/rtlil-string_attribute
rtlil: add AttrObject::{get,set}_string_attribute, AttrObject::has_attribute
Diffstat (limited to 'kernel/rtlil.h')
-rw-r--r-- | kernel/rtlil.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 17f038e36..f3b1c9ae7 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -656,6 +656,8 @@ struct RTLIL::AttrObject { dict<RTLIL::IdString, RTLIL::Const> attributes; + bool has_attribute(RTLIL::IdString id) const; + void set_bool_attribute(RTLIL::IdString id, bool value=true); bool get_bool_attribute(RTLIL::IdString id) const; @@ -663,12 +665,19 @@ struct RTLIL::AttrObject return get_bool_attribute(ID::blackbox) || (!ignore_wb && get_bool_attribute(ID::whitebox)); } + void set_string_attribute(RTLIL::IdString id, string value); + string get_string_attribute(RTLIL::IdString id) const; + void set_strpool_attribute(RTLIL::IdString id, const pool<string> &data); void add_strpool_attribute(RTLIL::IdString id, const pool<string> &data); pool<string> get_strpool_attribute(RTLIL::IdString id) const; - void set_src_attribute(const std::string &src); - std::string get_src_attribute() const; + void set_src_attribute(const std::string &src) { + set_string_attribute(ID::src, src); + } + std::string get_src_attribute() const { + return get_string_attribute(ID::src); + } }; struct RTLIL::SigChunk |