aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtlil.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-04-20 11:04:46 +0200
committerClifford Wolf <clifford@clifford.at>2019-04-20 11:04:46 +0200
commit5b915f01539c993466e83593ee8ae69b45360b81 (patch)
tree785221be69800c3afc5e1a76a80b29c289eccbcc /kernel/rtlil.cc
parent8f93999129bfcd957dbb312d804c01525af6d07e (diff)
downloadyosys-5b915f01539c993466e83593ee8ae69b45360b81.tar.gz
yosys-5b915f01539c993466e83593ee8ae69b45360b81.tar.bz2
yosys-5b915f01539c993466e83593ee8ae69b45360b81.zip
Add "wbflip" command
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r--kernel/rtlil.cc7
1 files changed, 5 insertions, 2 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