From: whitequark Date: Thu, 16 Apr 2020 21:49:49 +0000 (+0000) Subject: rtlil: add AttrObject::has_attribute. X-Git-Tag: working-ls180~621^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b6f624b56bc3adee55743c4bd383414ea5b07c72;p=yosys.git rtlil: add AttrObject::has_attribute. --- diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 9ecad056f..8af941c85 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -273,6 +273,11 @@ bool RTLIL::Const::is_fully_undef() const return true; } +bool RTLIL::AttrObject::has_attribute(RTLIL::IdString id) const +{ + return attributes.count(id); +} + void RTLIL::AttrObject::set_bool_attribute(RTLIL::IdString id, bool value) { if (value) diff --git a/kernel/rtlil.h b/kernel/rtlil.h index fe9e21c31..f3b1c9ae7 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -656,6 +656,8 @@ struct RTLIL::AttrObject { dict 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;