diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-04-20 12:23:49 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-04-20 12:23:49 -0700 |
commit | caec7f9d2c87e3978c51d0a4171b24cc4b363885 (patch) | |
tree | 56dfa79f4f3bad0f38165cf55978058dd7665f4c /kernel | |
parent | af4652522fd01aaec84664e65d7fe1474c578c49 (diff) | |
parent | f84a84e3f1a27b361c21fcd30fcf50c1a6586629 (diff) | |
download | yosys-caec7f9d2c87e3978c51d0a4171b24cc4b363885.tar.gz yosys-caec7f9d2c87e3978c51d0a4171b24cc4b363885.tar.bz2 yosys-caec7f9d2c87e3978c51d0a4171b24cc4b363885.zip |
Merge remote-tracking branch 'origin/master' into xaig
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rtlil.cc | 7 | ||||
-rw-r--r-- | kernel/rtlil.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 2f8715755..f6f08bb9e 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -207,9 +207,12 @@ bool RTLIL::Const::is_fully_undef() const return true; } -void RTLIL::AttrObject::set_bool_attribute(RTLIL::IdString id) +void RTLIL::AttrObject::set_bool_attribute(RTLIL::IdString id, bool value) { - attributes[id] = RTLIL::Const(1); + if (value) + attributes[id] = RTLIL::Const(1); + else if (attributes.count(id)) + attributes.erase(id); } bool RTLIL::AttrObject::get_bool_attribute(RTLIL::IdString id) const diff --git a/kernel/rtlil.h b/kernel/rtlil.h index db0a8f762..a0f1338e2 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -572,7 +572,7 @@ struct RTLIL::AttrObject { dict<RTLIL::IdString, RTLIL::Const> attributes; - void set_bool_attribute(RTLIL::IdString id); + void set_bool_attribute(RTLIL::IdString id, bool value=true); bool get_bool_attribute(RTLIL::IdString id) const; bool get_blackbox_attribute(bool ignore_wb=false) const { |