rtlil: add AttrObject::has_attribute.

This commit is contained in:
whitequark 2020-04-16 21:49:49 +00:00
parent ff7a1a1568
commit b6f624b56b
2 changed files with 7 additions and 0 deletions

View File

@ -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)

View File

@ -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;